Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPTIMIZATION] load only the needed parts from map #16

Open
protoman opened this issue Sep 22, 2015 · 0 comments
Open

[OPTIMIZATION] load only the needed parts from map #16

protoman opened this issue Sep 22, 2015 · 0 comments

Comments

@protoman
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant