Rolling Tilemap Arrays?
BlitzMax Forums/BlitzMax Programming/Rolling Tilemap Arrays?
| ||
Anyone have experience with rolling tilemaps, such as those for the early Ultima games where they are paged in from disk as needed? Eg. when you come to the edge of one, another one is paged in and the one you are farthest away from is dropped from memory? In my application newly-visited areas will be generated procedurally for the first time from edge tiles of the current gridsquare. If visited later they will be spooled from disk, and when areas are left they will be saved to disk. |
| ||
I would question whether it's necessary on modern hardware. You can fit a lot of tilemap in say 100Mb of memory. I would do some calculations first. |
| ||
Why dont you use a fixed size array ... your camera defines which portion of the array you are at. Each array entry with a bigger distance than X could then get "renewed". bye Ron |
| ||
I did something like this in java earlier this year. Ie generate procedurally on enter new zone and store zones on disk. In reality you dont need to store that much other than the value of the seed at each zone so you can recreate it...in terms of the zones static components. |
| ||
I'm going to need to use chunks and spool the chunks. John Galt: The problem isn't just memory usage, it's save + load time. |
| ||
Thinking the way to do this is to have absolute addressing (-maxint to +maxint tiles or something like that) with tile lookups that gloss over chunk boundaries in eg. 256x256 sized chunks. |