Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Feb 22, 2010 21:00:09 GMT -5
Is there any way to manipulate the order in which Sprites are rendered? I suspect the hardware just reads the Sprite "register" front-to-back, which means it is the developers duty to make sure this data is sorted as desired. However, there doesn't seem to be any function in BasiEgaXorz that allows you to set the address of a Sprite ( independent of its handle ) .. help?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Feb 25, 2010 13:09:45 GMT -5
Just to elaborate on why you'd want to do this ( and bump this thread ). In Streets of Rage characters are drawn in order of their Y position to create the "illusion" of depth. A video of this effect in action ..
|
|
|
Post by TheMVRules on Feb 25, 2010 13:22:51 GMT -5
Try adding the foreground sprites first then the background. Also, you could try to add Priority(1) at the propsprites command, but I haven't tested that. Like this: propsprites MySprite, 256+priority(1), 0
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Feb 25, 2010 15:17:23 GMT -5
The order in which you add Sprites does determine the order in which they are drawn indeed. But the difficulty of the Streets of Rage example is that sometimes the player is in front of the robots, and sometimes he is behind. So the order needs to be changed on the fly .. Priority doesn't seem to work on sprites ( when used on the tile address in propsprite ). Guess I'll just have to locate the maximum amount of 1x1 sprites ( 8x8 pixels ) and dynamically re-assign my "objects" ( and their tiles ) each time the order is changed.
|
|
|
Post by ScroGer on Feb 25, 2010 16:05:45 GMT -5
someones making a game....please dont be like most people and just talk about it.........When its done or even playable please share it with us....
|
|
|
Post by Mairtrus on Feb 26, 2010 8:29:23 GMT -5
I think you will need to deal with a Z-axis, or something. In other words, save the sprites's info into a buffer with the Z-axis value of the current character(main, enemy, whatever), then draw the sprites from the lowest to the maximun Z(suposing that the lowest Z is the most far from the "camera")
|
|
|
Post by TheMVRules on Feb 26, 2010 13:02:06 GMT -5
Redrawing sprites would probably cause some flickering when you move up/down...
And Gens KMod's sprite debug screen says priority, and I've seen some games that uses bit set.
|
|
|
Post by Mairtrus on Feb 26, 2010 16:34:03 GMT -5
Redrawing sprites would probably cause some flickering when you move up/down... Not if you redrawn them during the Vertical Blank period... And Gens KMod's sprite debug screen says priority, and I've seen some games that uses bit set. The priority only works with the planes with respect to the other plane and sprites, not sprites with sprites. What I mean is, the screen in drawn in this order: Sh > Ah > Bh > Sl > Al > Bl (A,B=planeA/B; S=Sprites; h,l=high/low priority) which means some tiles in the the PlaneB will overlap the PlaneA if those are in high priority, unless some tiles in the PlaneA have high priority. BUT the sprites are drawn following the sprites order: the sprite #0 overlap the sprites #1...79, the sprite #1 overlap the sprites #2...79, etc, not matter what priority they have. In other words, if the sprite #1 have high priority, it will be always overlap by the sprite #0, despite its priority.
|
|
|
Post by theelf on Feb 26, 2010 17:58:42 GMT -5
Hi, im all day thinking the same, and i have a idea... is possible to a scroll plane to overlap sprites? i have a example of what i think scroll 1 scroll 2 And the final result... If the scroll 2 can overlap sprites, i can resolve the problem of making one sprite of every object in game to overlap the player
|
|
|
Post by TheMVRules on Feb 27, 2010 12:07:32 GMT -5
TEXTPRIORITY HIGH / LOW Sets the tile priority of text printed using the text printing commands. Use as simply: OPTION TEXTPRIORITY HIGH, or OPTION TEXTPRIORITY LOW. This command makes no difference in distinguishing priorities between tile planes A and B, but sprites that are shown over high priority text will be shown behind the text.
Why can't somebody read the documentation?
However, this is not very useful if you want to have some backgrounds because both SCROLL_A and SCROLL_B are before sprites.
But if you only want to have the HUD before the sprites, you can have that as sprites. I think most games is like that or have sprites between the tile layers (that does BEX not support).
|
|
|
Post by theelf on Feb 27, 2010 14:55:17 GMT -5
Then, TheMVRules, what do you think is the solution to my problem?
Ah, maybe you need edit your last message because is changing the forum format ..is very long...?
|
|
|
Post by TheMVRules on Feb 28, 2010 11:28:29 GMT -5
Changing the VDP registers. But you would need to use Assembly to draw all of the objects. I'm afraid there's no other option than that, and use sprites for now. But we can always bug DevSter to add a new Textpriority option that puts sprites between the layers.
|
|
|
Post by Mairtrus on Feb 28, 2010 12:53:53 GMT -5
|
|
|
Post by theelf on Feb 28, 2010 14:23:38 GMT -5
The problem of read the HELP is understand it...
Now i understand how to do, time to use this new learning to coding something.. ;D
like always...THANXS MAIRTRUS
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Mar 1, 2010 22:38:58 GMT -5
I really don't expect everyone to understand the documentation. The documentation is really unfriendly, and really does not make it apparent that you can use these functions along with your tile number . I wish someone could make a high-level document based on my low-level docs Back to the original issue on ordering sprites....BasiEgaXorz does this automatically for you. The first created sprite with AddSprite will always have the highest priority. The Sega Genesis hardware is much better than this! The sprite attribute list is actually a linked list, where sprites actually do have their own priority level. I originally written the tile/sprite routines assuming that nobody will ever create a complicated game that will require sprite priority levels (I was thinking space invaders, donkey kong, 4-bit mario kinda stuff). As suggested, one way I can implement priority levels is through a Z-axis dimension. Another way is to actually have a priority level for each sprites. Both these methods requires re-structuring the linked list inside that sprite attribute table for each sprites when the Z-coordinate, or priority level is changed. Another way is to make the user enter in the linked list themselves . I dunno, I'll think of a way....I like Z-axis because of the simplicity and flexibility - nobody's going to do any crazy updating the the Z-coordinates are they?
|
|