Journal

Reworking Treasure and Map Systems

Posted by:

Treasure has also gone through a major refactor.

The older treasure system relied on a mix of global state and map-specific logic. That worked for a while, but it became hard to manage as the game added more treasure types, randomized rewards, mimic chests, blue chests, gold chests, dungeon phases, revisits, and roguelite-style progression.

The new treasure system tracks chest state more explicitly. Treasure can now be initialized deterministically, saved properly, restored when returning to maps, and resolved through cleaner reward logic.

We also refactored map transfer and location systems so the game has a better understanding of where the player is, where they are going, and how to restore their position after loading or returning from battle.

These systems are a big part of making exploration feel solid.