rockbot icon indicating copy to clipboard operation
rockbot copied to clipboard

[OPTIMIZATION] load only the needed parts from map

Open protoman opened this issue 10 years ago • 0 comments

Right now, we keep the whole map structure, three times. But those consists, in most part, of useless or unused data. For example, the map have 200x15 tiles, x2 layers, plus x1 locked flag. Even if the tile is not set to use any graphic (-1, -1), or the terrain is not locked (0), we are putting that information on memory.

To improve this, we could create a map that uses X and Y as key, and store only the entries that contains any information. A function fo acess the map will check if key does not exist, and, in this case, return the default values (-1, -1 for tile and 0 for locked).

The same could be done to the tileset, so we store each tile in memory and only the used ones for that map. This will allow us to increase the tileset image size without having to increase memory use for each stage.

protoman avatar Sep 22 '15 14:09 protoman