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


Forums > C64 Coding > AGSP - how to use sprite pointers for both sprites and char gfx
2013-06-10 08:47
Oswald

Registered: Apr 2002
Posts: 5094
AGSP - how to use sprite pointers for both sprites and char gfx

just wondering, would it be possible to change screen after sprite pointers have been loaded and before badline operation ? that would solve the problem of visible sprite pointers :)

badline + 8 sprites that is. there is maybe 1-2 free cycle with RMW but where in the line? cant find vic article with google.

or maybe one could write a multiplexer which only allows 7 sprites where critical.
 
... 17 posts hidden. Click here to view all posts....
 
2013-06-10 15:59
Fresh

Registered: Jan 2005
Posts: 101
@HCL
Sorry for bothering you but I think I didn't quite get it.
If I make room (clearly losing 2 sprites) for one STA $d018 before bl and one, say, STX $d018 after it (possibly starting before bl but having its write-cycle after it), how should I get 3-4 garbage characters on either side? Does VIC update char bank some cycles after changing $d018?
2013-06-11 07:28
HCL

Registered: Feb 2003
Posts: 728
Hmm, on a second thought, i didn't answer your question.. it was the answer to some other question perhaps :P.

So what you want to do is first some AGSP or whatever you call it..well, then you find out where the badline is that will display the sprite pointers as colors, Wait until all sprite pointers have been read, change $d018 just before the badline is triggered, and if possible change $d018 back before sprite pointers are read again. Ok, now even i am with out :).

Not sure if the first part is possible even, but i'm sure that doing both d018-stores are not possible as i think i recall there is only one cycle left when you have both badline and 8 sprites. If reducing number of sprites, maybe..

So.. the answer became sort of the same :P. The issue with loosing some 3-4 chars on the screen was related to something else i made, though similar problem.. It's so cool your heads would probably explode if i told you, but at the same time it didn't work with less than loosing 3-4 chars on either side of the screen :(.
2013-06-11 08:04
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: Hmm, on a second thought, i didn't answer your question.. it was the answer to some other question perhaps :P.

So what you want to do is first some AGSP or whatever you call it..well, then you find out where the badline is that will display the sprite pointers as colors, Wait until all sprite pointers have been read, change $d018 just before the badline is triggered, and if possible change $d018 back before sprite pointers are read again. Ok, now even i am with out :).

Not sure if the first part is possible even, but i'm sure that doing both d018-stores are not possible as i think i recall there is only one cycle left when you have both badline and 8 sprites. If reducing number of sprites, maybe..

So.. the answer became sort of the same :P. The issue with loosing some 3-4 chars on the screen was related to something else i made, though similar problem.. It's so cool your heads would probably explode if i told you, but at the same time it didn't work with less than loosing 3-4 chars on either side of the screen :(.


Spoke to my bro and according to him Exilon/HZ did some research with this for a game and came to the conclusion that 6 sprites are possible. Trust the old lords!
2013-06-11 09:28
Oswald

Registered: Apr 2002
Posts: 5094
6 is pretty reasonable. it must be rare that in a typical platformer more than 6 will gang up on THAT specific line.

and when it happens, live with it, do the flicker :) the solution is much better give n take ratio than others. you can have more than 8 pixel / frame scrolling and still a LOT of cpu free for doing a tight multiplexer, many char sprites and what not, while having almost a fullscreen window.
2013-06-11 12:45
doynax
Account closed

Registered: Oct 2004
Posts: 212
Is the cost of just brute-force copying really all that high?

You could perform all sorts of raster tricks to speed this up or limit copying but eating away two sprites will be a significant limitation when it comes to level design, and complicating your display with this scheme is going to get in the way when you want to combine it with other special-case raster effects.

Just keep a cache of 8-16 fixed sprites/characters and only copy in new graphics on-demand when something changes. Replace the sprites lazily in the spare raster time even, with the old pattern kept until the new one is ready. That's what I do for copying/flipping my main character and you'll be hard-pressed to spot the difference.
2013-06-11 14:03
Oswald

Registered: Apr 2002
Posts: 5094
16 sprite with templates makes 32 sprites, thats 32 chars you also have to copy gfx in and keep track of that aswell. I'd rather go for only 6 sprites in some cases, and have all the cpu time no platformer ever had.

Tho I have to admit I've no experience on cpu demands of 2d scrolling games. maybe loosing time to sprite and char copying is not that crucial.
2013-06-11 14:27
doynax
Account closed

Registered: Oct 2004
Posts: 212
Quoting Oswald
16 sprite with templates makes 32 sprites, thats 32 chars you also have to copy gfx in and keep track of that aswell.
Templates? At minimum you need nine sprites/chars to do lazy updates cleanly. One for each hardware sprite plus the buffer for off-screen rendering.

Of course you may want a couple more to expand the cache and be able to reuse previously copied sprites more often but 32 seems rather excessive. Admittedly you're not getting around copying the character data when a sprite pattern or channel changes though.

The point is that animations are short, slow, and highly repetitive, so you can get away with doing very little actual work on average.

Quote:
I'd rather go for only 6 sprites in some cases, and have all the cpu time no platformer ever had.
Aside from Mayhem in Monsterland? ;)

Quote:
Tho I have to admit I've no experience on cpu demands of 2d scrolling games. maybe loosing time to sprite and char copying is not that crucial.
It depends. In my experience the real cycle eater, aside from traditional scrolling, is attempting general logic. That is modelling every actors as a generic physics object traversing the world, a flexible animation system linking together multi-sprite objects, etc.

Beyond that the problem is spreading the pain evenly. You're going to have a fair bit of trouble with certain frames being loaded down while the workload on others is relatively light, so anything work unit which can easy be spread over multiple frames or performed ahead of time during spare cycles is a big plus (the sprite cache above, scrolling, background loading, pre-rendered music and so forth.)
2013-06-11 16:12
Oswald

Registered: Apr 2002
Posts: 5094
with 32 I was thinking that each sprite needs a copy buffer - obviously not :)

mayhem had to copy d800 after scrolling 40 chars, thats quite a bottleneck, tho I dont see it doing anything that it really needed that VSP code. It could have been done with a couple of half unrolled screen&color copy code. there's not even more than 8 sprites on screen at once I think - and that tells a lot - having a rasterline where the sprite limit is 6 is certainly not a bad compromise.

btw not even 16 bit games kept track of actors offscreen (except some limits) for the usual platformer, thats an overkill imho. usually you just run through the world, you dont need them to have their on lives in it, you kill them or leave them behind and thats it.

anyway I really wish some time I will have the time and motivation and dive into the subject, generic ingame sprite multiplexing is a very cool problem to tackle, also having a player interacting with the level and other sprites, and bullets. hopefully one day I'll get my hands dirty with this... :)
2013-06-11 16:57
JackAsser

Registered: Jun 2002
Posts: 2014
@Doynax+oswald: I know I'm being lame and stupid now, but how does that solve the problem of visible sprite pointers in the GFX while AGSPing?
2013-06-11 17:13
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
generic ingame sprite multiplexing is a very cool problem to tackle, also having a player interacting with the level and other sprites, and bullets.

multiplexing is not hard - collisions are what gives you grey hair =P
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
X-Raffi/X-Rated
LordCrass
USID/The Guards; Tra..
Chrx/Design/Chaos
zscs
macx
Guests online: 101
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.046 sec.