Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

high memory usage #61

Open
klusark opened this issue Dec 5, 2015 · 1 comment
Open

high memory usage #61

klusark opened this issue Dec 5, 2015 · 1 comment

Comments

@klusark
Copy link
Contributor

klusark commented Dec 5, 2015

Lets say I have a dungeon with 100 levels where each level is 70x70 tiles, that equals a total of 490000. Each tile is around 128 bytes (according to the chrome debugger). That means the dungeon alone takes around 60MB of memory.

Instead of generating and storing all the levels, maybe just generated them as needed and store only the current one, and any levels that a player has died on? That would leave a max of around 3MB of memory.

@seiyria
Copy link
Owner

seiyria commented Dec 5, 2015

What could be done is phase old dungeon floors out of memory (adventurers never ascend). I generate the whole dungeon, though, because it lets me populate all of the info for the dungeon tab (plus, some victories add on to the bottom of the dungeon, which would be hard to estimate if a victory condition generated a random number of floors).

I'd be open to a PR that can retain all existing functionality and generates on demand, though. A place to start would be to phase out the old floors while descending.

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

No branches or pull requests

2 participants