Journal

Finishing a Major Legacy Code Cleanup

Posted by:

This week’s update is about one of the less flashy but very important parts of finishing Last Dream II: removing old legacy systems that have been replaced by the newer architecture.

Over the past several months, we’ve been rebuilding major parts of the game around clearer, safer systems. Recently, we focused on auditing and deleting old code for enemies, equipment, party management, recruitment rewards, shop discounts, prologue inventory handling, Monk forms, and battle rewards.

A lot of this work is about making sure old functionality is not lost before removing the old files. For example, we verified that enemy behavior now runs through the modern battle/action systems, equipment logic now uses the newer instance-based equipment architecture, and party recruitment now properly handles special one-time rewards when characters join.

We also cleaned up several smaller but important RPG systems:

Shop discounts can now be removed through data-driven state expiration rules instead of hardcoded party logic.

Battle rewards now apply party-wide gold and remains bonuses through a cleaner reward multiplier system.

Prologue gold and items now have a proper persistent stash system, so items collected during separate prologue sections can be stored and restored safely.

Monk Forms now support menu icons directly from data, which makes the battle form menu easier to present and extend.

The goal of all this is to continue moving away from old global, fragile systems and toward a codebase where each system has a clear responsibility.

This kind of work does not always produce an obvious screenshot, but it matters a lot. Every legacy file we can safely delete means fewer hidden dependencies, fewer old assumptions, and less risk when we finish new content.

The codebase is becoming much cleaner, and that puts us in a much better position to finish the game.