Disch wrote:
This seems like it could be easily expanded by having multiple tilesets and assigning 1 to each level.
Yeah, I guess. I don't do that because each 16KB ROM bank holds: the 256 blocks of each type, the metatiles, the collision maps of the metatiles and the level headers. All of these use a total of 8KB, and the other 8KB are used for level maps and object definitions.
It shouldn't be hard to separate the block definitions from all the mapping, since those are not accessed at the same time (the level map is accessed only when the camera enters a new screen, to get the index of the new screens and to load their objects, but the blocks are accessed every frame, because of collision and rendering).
Quote:
IE: rather than having only 256 "screens" (256x256 pixel blocks) to split across every level
It's not across every level, just across all the levels whose maps are in the same ROM bank. Since this is a Sonic game, Each ZONE will have it's own bank, and all the ACTS of that ZONE will have their maps in the same bank, since ACTS of a ZONE do use the same metatiles and mappings after all.
I said I can fit about 6 levels in a ROM bank, all using the same blocks and metatiles. Since I have 2 characters the player can choose, each could have their own 3 ACTS in a zone easily, so I didn't see this as a problem.
Quote:
you could assign a tileset to each level, and each tileset would have its own 256 screens to choose from.
Your idea is indeed good. The way I'm doing right now forces each tileset to have a certain number of screens worth of level maps, but by separating them I can distribute the use of the tilesets less uniformly.
Quote:
If tilesets can fit in one 16k page -- you can take advantage of this without any speed loss by putting each tileset in its own page and just swap to the desired page when loading your level data.
My tilesets (metatiles + all blocks) use only 8KB of ROM, which I placed at $8000. The remaining 8KB of the bank is used for level maps and object placement (although it is possible to have them in the first 8KB too). If I keep this layout, I just have to remember in which ROM bank the tileset used by the level is, and in which bank the level map is, and they are not hardwired to each other anymore.
You had a great idea, thanks. I'll have to shuffle some data around (specially the level headers) to make this work though, but I'll see what I can do.