zaimoni / Cataclysm

A post-apocalyptic roguelike. New features relative to C:Whales are scheduled for after 0.2.0, the savefile breaking release.
http://www.bay12forums.com/smf/index.php?topic=174897
Other
27 stars 3 forks source link

Load only those submaps liable to be modeled in detail #13

Open zaimoni opened 4 years ago

zaimoni commented 4 years ago

That is, treat maps.txt as a database whose keys are the leading tripoint of the absolute location.

This includes both loading and unloading operations.

Zireael07 commented 4 years ago

Hm, trying to understand what your problem with Whales' legacy here is. AFAIK Cata only loads submaps in range 3x3 around the player, and with you starting from such an old codebase, there's no question of Z-levels...

zaimoni commented 4 years ago

It only runs submaps of size 12x12 in range 11x11, centered on the player's submap.

I was advised on the Bay12 forum that there had been a savefile directory restructuring to cut down the number of files considerably (the reference start game only has 12 files), so exploring 2 cities worth is only ~500 files instead of ~100,000 . Since I forked from the very last commit, I inherited that (and vehicles, and the bodypart hp subsystem).

Every single submap is being loaded to RAM at once, even though only 11x11 are actually needed. I'm thinking ahead to what an Earth-scale simulation would do to RAM loading.