#34342 - gauauu - Tue Jan 18, 2005 7:35 am
Ok, I've been thinking about the scrolling engine for my next project, and here's what I come up with:
Use "text" or "regular" scrolling background, 512x512, using tile strip copying to allow large maps to be scrolled both horizontally and vertically.
For the map definition, I had planned on using "metatiles" similar to what a lot of old nes games did, where I define blocks of tiles (4x4 tiles) with a metatile number, and build the map out of these.
Now, here's my questions. I'm trying to think through my tile strip copying algorithms before I start, to do things efficiently. In thinking about it, I've realized that using these blocks makes the calculations for copying in a strip significantly more complicated.
1. Instead of copying 1 strip, I could copy a block (metatile) at a time. This would be fine and dandy, but seems harder to deal with when the block straddles the "wraparound" point of the map. Oh...I just had the realization that the 512 pixel background is a factor of 32, meaning the blocks will never straddle that line. Ok, next question.
2. Is it even worth it to use metatiles? My reasons for using them were:
But it seems clear that it will take more calculation to copy a row of blocks into place than it will a row of tiles.
Also, I just had the sudden realization that if I don't use a 32x32 pixel block, I can avoid having to use a bigger background (can use 256x256, with 2 tiles off the screen horiztonally at all times for strip copying). This would simplifiy the calculations of where the new tiles should end up.
Edit: I guess you only guarantee 1 tile column off the screen at a time, since you could have a portion of the left one, and a portion of the right onscreen at the same time.
Anyway, I'm confusing myself, but the question is this: does it tend to be worthwhile to use metatile blocks? Do any of you ever use them? Do commercial games tend to use them? If so, what sizes do you use?
Sorry for the rambling.
Use "text" or "regular" scrolling background, 512x512, using tile strip copying to allow large maps to be scrolled both horizontally and vertically.
For the map definition, I had planned on using "metatiles" similar to what a lot of old nes games did, where I define blocks of tiles (4x4 tiles) with a metatile number, and build the map out of these.
Now, here's my questions. I'm trying to think through my tile strip copying algorithms before I start, to do things efficiently. In thinking about it, I've realized that using these blocks makes the calculations for copying in a strip significantly more complicated.
1. Instead of copying 1 strip, I could copy a block (metatile) at a time. This would be fine and dandy, but seems harder to deal with when the block straddles the "wraparound" point of the map. Oh...I just had the realization that the 512 pixel background is a factor of 32, meaning the blocks will never straddle that line. Ok, next question.
2. Is it even worth it to use metatiles? My reasons for using them were:
- To save memory storing the levels
- To store other locational map data, like collision info, in the same logical place as the tile data
- It seemed like it could make designing levels easier
- I spent way too long last year trying to hack the old castlevania NES rom (of course, with no useful results)
But it seems clear that it will take more calculation to copy a row of blocks into place than it will a row of tiles.
Also, I just had the sudden realization that if I don't use a 32x32 pixel block, I can avoid having to use a bigger background (can use 256x256, with 2 tiles off the screen horiztonally at all times for strip copying). This would simplifiy the calculations of where the new tiles should end up.
Edit: I guess you only guarantee 1 tile column off the screen at a time, since you could have a portion of the left one, and a portion of the right onscreen at the same time.
Anyway, I'm confusing myself, but the question is this: does it tend to be worthwhile to use metatile blocks? Do any of you ever use them? Do commercial games tend to use them? If so, what sizes do you use?
Sorry for the rambling.