in reply to OT: Tile maps
Here's a simple way to do it:
Chunk your world into fairly big blocks, call 'em "areas". Each area has a tile palette of 256 (or however many) tiles. (This way, you get a simple form of compression: each area probably has fairly similar graphics, and you only have to keep a few of your tiles in memory at once.) Store nine areas in memory at once: the one your player's in, and the eight adjacent areas.
On disk, store your areas the obvious way, as well as a map of which areas go where. When your player gets crosses the boundary of his current area, move him to the next one, shift which areas are which (bottom-left, centre, etc), and load the new areas when you have time.
This makes it easy to add areas to the world, gives you seamless transitions, lets you do all kinds of crazy image-processing stuff on the areas later if you so desire, and it's pretty simple to implement.
--
F
o
x
t
r
o
t
U
n
i
f
o
r
m
Found a typo in this node? /msg me
The hell with paco, vote for Erudil!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (OT) Tile maps
by BUU (Prior) on Feb 14, 2003 at 05:45 UTC | |
by FoxtrotUniform (Prior) on Feb 14, 2003 at 06:28 UTC |