DrKane
2002.11.03, 12:00 AM
I am working on a tile-based rpg. My world is represented with an array that looks like this:
#define kWorldWidth 100
#define kWorldHeight 100
#define kMaxLayers 3
TileStruct worldArray[kWorldWidth][kWorldHeight][kMaxLayers];
I keep my world divided into maps of 100x100 tiles. One map file is 350k. And since my game will be using somewhere around 30 maps, the space really starts to add up. Now I do have a tilePalette which is bassically a lookup table and holds all of my tile definitions for my level editor. I was considering just having an array of TileStruct ptrs, so that I could save about 2/3 space on my maps. Would I be able to use an array of ptrs by setting all of the ptrs in my level editor, or would this cause some wierd memory thing. Or maybe there's a better solution?
#define kWorldWidth 100
#define kWorldHeight 100
#define kMaxLayers 3
TileStruct worldArray[kWorldWidth][kWorldHeight][kMaxLayers];
I keep my world divided into maps of 100x100 tiles. One map file is 350k. And since my game will be using somewhere around 30 maps, the space really starts to add up. Now I do have a tilePalette which is bassically a lookup table and holds all of my tile definitions for my level editor. I was considering just having an array of TileStruct ptrs, so that I could save about 2/3 space on my maps. Would I be able to use an array of ptrs by setting all of the ptrs in my level editor, or would this cause some wierd memory thing. Or maybe there's a better solution?