#19118 - mr_schmoe - Sun Apr 11, 2004 4:26 pm
He's what I'm thinking. And maybe this isn't very practical if you have more sprites data than memory, but if you have a small number of sprites then this could work just fine. What if you whipped out a 256 x 256 image (or 256 x 128 if in 256 color mode), layed out all your sprites just as they should apper in the game, not cut up into peices like you would need to do in 1d mode. But then take that data, plop it all into the 2d sprite memory, then just set the OAM to the proper sprite memory location and there you go.
That's the idea I had. But if any of you think there are better ways of doing stuff like that, why don't we start a discussion on the differences, good and bad, between the two? I can definitely see the advantage of either one, but I'd like to hear what ya'll have to say. Let me know.
#19120 - poslundc - Sun Apr 11, 2004 4:34 pm
You're then dealing with a very inflexible format, which may be fine for a very small and limited game, especially if you have all of your sprites pre-determined before you start programming.
Most games are constantly changing Sprite VRAM, though, and rarely can be created with a single sprite template that won't change often.
Furthermore, if you're going to write a program to convert a single image into this single data block, it isn't much more work to write a more flexible program that can decompile more complicated images into sequential tiles. Remember that in the end you still need to break up your image into 8x8 tiles, regardless of 1D or 2D ordering of those tiles.
In the end it depends on the type of application you are trying to create.
Dan.
#19122 - tepples - Sun Apr 11, 2004 5:59 pm
Kirby: Nightmare in Dream Land for GBA constantly swaps sprite cel VRAM in 2D mode. So do many Super NES games, because the Super NES didn't have a 1D mode. If you copy a row of tiles at a time, it becomes straightforward after a bit of thought. But yes, 1D mapping mode makes the technique described in my white paper slightly easier to implement.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#19127 - poslundc - Sun Apr 11, 2004 7:36 pm
I should perhaps clarify: I didn't mean to suggest that 2D mode was inflexible, only that taking the single-snapshot approach to sprite VRAM was inflexible.
2D mode is fine if you know how your sprites are laid out in memory. I think most programmers find it more bothersome to deal with than 1D, though.
Dan.
#19138 - tepples - Sun Apr 11, 2004 9:52 pm
Super Mario Bros. for NES and other NES games of that era took a single-snapshot approach to pattern data. In fact, they used only 256 tiles for background tile patterns and 256 tiles for sprite cels. So if you aren't going to be using more than 1024 tiles in one shot (where "shot" is defined as in cinematography), it's OK to load them all at once.
Another way is to compromise, to treat 2D sprite cel VRAM as eight "banks", each 256 pixels or 32 tiles wide and 32 pixels or four tiles tall. This mirrors what a lot of later NES games did with the MMC3 mapper.
If you want to learn more slick tricks for how to make the most of limited VRAM, run some NES ROMs in PocketNES in VisualBoyAdvance and watch the Tile Viewer closely.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.