Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > sprite clipping at the top while using AGSP
2017-04-27 01:07
knue

Registered: Dec 2012
Posts: 10
sprite clipping at the top while using AGSP

Hi all,

I'm currently coding a game using an AGSP scroller. Since enemies are supposed to enter the screen from all sides, I have to clip the sprites entering from the top as the first 25+8 raster lines are used for the AGSP stuff. The question is: What is the best way to do this?

I can think of the following:


1) don't clip at all.

The sprite would simply pop up at full height when it enters from the top. This one is a bit ugly but wouldn't be the first game suffering from such problems...


2) set sprite pointers to a zeroed sprite.

While this basically works, the timing in the AGSP stuff gets incredibly complicated. I don't know whether this is even possible (without going insane). I mean I would need an immense amount of logic to time various areas in the AGSP stuff correctly depending on how many sprites are visible in this raster line.


Are there other options on the table or is 2) doable with some fancy lookup table or sth?

You can find the code here if someone is interested:
https://github.com/leissa/c64engine

Thanks in advance for any help.
 
... 17 posts hidden. Click here to view all posts....
 
2017-04-27 22:12
knue

Registered: Dec 2012
Posts: 10
Thank you so much for all your helpful input. I'm now doing the following in this order for the AGSP:
* fld
* line crunch
* VSP
After the VSP I have naturally 8 raster lines where timing is not that critical. I do the software zero-sprite-frame trick in that area. So the remaining 21-8=13 raster lines the sprite just pops out. Some sort of middle ground.

As others have suggested, when everything else runs, I can come back to this and see whether I can come up with sth even more sophisticated.
2017-04-28 08:44
lft

Registered: Jul 2007
Posts: 255
Quoting Digger
Could you use one of the illegal modes for $d011 in the upper AGSP area to turn off the screen and hide the sprites behind? Then just switch the sprite priority after the line crunch.
I guess this might not work for some reason, otherwise someone would have already suggested it ;-)


This could work if you ensure that only foreground pixels are emitted. Use for instance the ECM+multicolour mode, and select a font bank with two pages' worth of $ff.

But you would still have to deal with the timing problems, so there is no improvement over the empty-sprites approach.
2017-04-28 12:19
knue

Registered: Dec 2012
Posts: 10
Quoting lft
Quoting Digger
Could you use one of the illegal modes for $d011 in the upper AGSP area to turn off the screen and hide the sprites behind? Then just switch the sprite priority after the line crunch.
I guess this might not work for some reason, otherwise someone would have already suggested it ;-)


This could work if you ensure that only foreground pixels are emitted. Use for instance the ECM+multicolour mode, and select a font bank with two pages' worth of $ff.

But you would still have to deal with the timing problems, so there is no improvement over the empty-sprites approach.


ah, didn't know that. In my case memory consumption is even worse since I'm using bitmap mode.
2017-04-28 13:59
WVL

Registered: Mar 2002
Posts: 825
Quote: You might wanna check how we did it in Pinball Dreams. Can't remember right now, but the top paddles must have been properly clipped against the AGSP-area.

@WVL: Do you remember?


Yes, the paddles never go into the AGSP zone :-) They only go in the lower border, never in the AGSP area.

The levels are designed that way (well, we were just lucky..)
2017-04-28 14:25
JackAsser

Registered: Jun 2002
Posts: 1215
Oh!! I thought the upper paddle on Ignition would go under that area when furthest down
2017-04-28 21:07
Tom-Cat

Registered: Apr 2003
Posts: 13
What upper paddle? All four Pinball Dreams tables only have lower two paddles... :)
Now PLEASE re-start the work on PD C64 because bloody CPC camp is getting an upper hand. And their ball has a black outline, for christ sake.
2017-04-29 13:39
ptoing

Registered: Sep 2005
Posts: 204
Couldn't you put 8 sprites at the top that are essentially empty or otherwise invisible, but are highest prio, never flicker. So that they will clip off the incoming pixels of the sprites coming from the top.

There are several NES games that make use of similar techniques, should be doable on C64 too, I think.

But then again, I am not a coder.
2017-04-29 17:33
knue

Registered: Dec 2012
Posts: 10
ChristopherJam already suggested this solution. It could definitely work. However, I wouldn't have sprites left to display points, life and other status info on the top because I would need all sprites to fight the clipping.
2017-04-29 21:54
ptoing

Registered: Sep 2005
Posts: 204
Ah, I see, so you could not have stuff in the borders. Makes sense.
2017-05-16 16:37
ptoing

Registered: Sep 2005
Posts: 204
This just randomly popped into my mind, but why can't you have your point/lives/whatever display up in the border, make sure it is 8 sprites for all lines, and then have those at a higher priority setting as the stuff that comes floating onto the char screen? That would work just fine, no?
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Powerslave/Tronix
Cpt.Power/Anarchy
Dymo
Dr.Strange/Atlantis
St☯rmfr☯nt/ExCeSs
Linus/MSL^Oxy^SHAPE
Flavioweb/ASURA/HF
Didi/Laxity
Guests online: 60
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 The Shores of Reflec..  (9.6)
4 Coma Light 13  (9.6)
5 Lunatico  (9.6)
6 Comaland 100%  (9.6)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Daah, Those Acid Pil..  (9.5)
3 SidRok  (9.5)
4 Treu Love [reu]  (9.4)
5 Tunnel Vision  (9.3)
6 Dawnfall  (9.3)
7 One-Der  (9.2)
8 Hardware Accelerated..  (9.2)
9 Globe 2016 [reu]  (9.2)
10 Safe VSP  (9.1)
Top Groups
1 Booze Design  (9.4)
2 Oxyron  (9.4)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Camelot  (9.2)
Top Hardware-Gurus
1 Soci  (9.9)
2 Wiesel  (9.9)
3 Grue  (9.8)
4 Zer0-X  (9.8)
5 Lemming  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2017
Page generated in: 0.185 sec.