Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Marksman ! (Registered 2017-10-23) You are not logged in 
CSDb User Forums


Forums > C64 Coding > Sprite sorting for DYSP or alike?
2017-10-02 14:27
dano

Registered: Jul 2004
Posts: 111
Sprite sorting for DYSP or alike?

Arising from the other threads about sorting, i asked myself if one needs a proper sprite sorter for "controlled" effects like a DYSP or a for moving sprites in a circle-manner?

As i have not coded a multiplexer of this kind before up to now, i was puzzled if there was a smarter way round to achieve a proper movement like so?

A hammer-until-things approach from the top of my head could be something like stepping through Y values and then setting up the needed IRQs for that. Or analysing the movement on compiletime and setting up 1..x Tables for the IRQ-D012-Values..

What would you recommend me as a multiplexer n00b to do?
2017-10-02 15:25
Groepaz

Registered: Dec 2001
Posts: 8222
find symmetries. eg a simple sinus can simply be splitted horizontally in a few zones. (circle is the same thing). no need for sorting in such cases :)
2017-10-02 15:31
dano

Registered: Jul 2004
Posts: 111
you mean like for 24 sprites define 3 zones and then put the needed sprites into those zones?

what you mean by "finding symmetries"? doesn't quite ring a bell on how or what was this helps for the ordering?

am i thinking too complicated (again)?
2017-10-02 15:42
Groepaz

Registered: Dec 2001
Posts: 8222
if you put N objects evenly on a circle, and then cut the circle in half horizontally, each half contains exactly N/2 objects. that makes having 16 sprites on a circle trivial and obvious :) and you can repeat the process on the halves (not really symmetric now, ok). the same can be done on sinus-movements (and a lot of other things).
2017-10-02 15:46
lft

Registered: Jul 2007
Posts: 303
Consider a simple sinus Y-movement. At any given time, half of the sprites will be moving upwards, and half of them will be moving downwards. Place the first half in sprites 0-3 and the second half in sprites 4-7. Now you can just apply a round-robin schedule to each half.

Did you mean something like that, groepaz?
2017-10-02 15:48
lft

Registered: Jul 2007
Posts: 303
You beat me to it. =)
2017-10-02 17:00
dano

Registered: Jul 2004
Posts: 111
@LFT: as far as i understand it, that implies to have the full sinus on screen all the time?

meaning if one doesn't have the full data on screen, one can't take full effect on similarities and such.

so if i understand it correctly you would all analyze the movement in beforehand/on compile time?
2017-10-02 17:05
Groepaz

Registered: Dec 2001
Posts: 8222
you just look at the full period, it doesnt really matter if all of it is visible all the time - the logic behind it stays the same.
2017-10-03 16:44
Perplex

Registered: Feb 2009
Posts: 197
If the length of your y movement table is a multiple of the number of objects, say 32 objects and 128 values in the movement table, then the y values used by those objects will repeat every 4 frames. Just create 4 separate multiplexing code blocks, then alternate between them. No sorting needed, and you will always know in each code block how many cycles will be used by sprites on each line throughout the screen.
2017-10-03 16:48
Groepaz

Registered: Dec 2001
Posts: 8222
yeah, dividing whatever your effect does into "animation frames" is another thing that helps a lot
2017-10-03 16:55
Compyx

Registered: Jan 2005
Posts: 271
That's what I usually did. Split the movement into 'frames', so for example after 8 updates you reset the Y-positions to their 'frame 0' state and move sprite pointers.

For sideborder stuff involving graphics on screen with badlines, I'd usually write separate routines for each frame.

Absolutely no need to sort anything, but the y-movement is fixed.
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
Trash
LocalH/BCI
Steel/SCS & TRC/G★P
Kakka/Extend, Damone..
pcollins/Excess
Scooby/Light
JEZ
Jazzcat/Onslaught
Metal Maniac/Dual Crew
Grue
Tom-Cat/Nostalgia
Skrjablin/Hokuto Force
Guests online: 62
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Lunatico  (9.6)
6 Quad Core 100%  (9.5)
7 Comaland 100%  (9.5)
8 Incoherent Nightmare  (9.5)
9 Wonderland XII  (9.5)
10 Comaland  (9.5)
Top onefile Demos
1 Pandemoniac Part 2 o..  (9.6)
2 Synthesis  (9.6)
3 Dawnfall V1.1  (9.5)
4 Daah, Those Acid Pil..  (9.5)
5 Treu Love [reu]  (9.4)
6 Field Sort  (9.4)
7 Dawnfall  (9.3)
8 KAOS 64  (9.3)
9 Hardware Accelerated..  (9.2)
10 Globe 2016 [reu]  (9.2)
Top Groups
1 Booze Design  (9.4)
2 Pond  (9.4)
3 Censor Design  (9.4)
4 Oxyron  (9.4)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Mitch  (9.8)
3 Mr Zero Page  (9.8)
4 Snacky  (9.8)
5 MWS  (9.8)

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