HumankindAssetFramework

Unit facing persistence

Humankind’s own save does not store which way a unit is facing. The simulation Unit/Army have no orientation field — facing lives only on the presentation (PresentationUnit.FormationAngle, an int world heading) and is recomputed from movement/actions on load, so a reloaded unit resets its heading to neutral.

This feature restores it, in a HAF-owned side-file that never touches the game save.

Where

BepInEx/config/haf_state/facing/<saveName>.facing

One file per save, named after the save (quick-save.facing, auto-save 3.facing, your manual name…). Plain text, one line per army:

<armyGUID>,<angleDegrees>

armyGUID = the army’s serialized SimulationEntityGUID (the same id survives the reload — that’s why it’s the key, not a tile position); angleDegrees = its FormationAngle.

How

Patches/FacingPersistPatch.cs, all reflection (the game types aren’t referenced), fail-soft throughout:

Config

Factory / PersistUnitFacing (BepInEx config), default on. Applies to all armies (vanilla + custom), keyed by GUID, per-save file. Turn off to disable capture and restore entirely.

Reusable knowledge

The save/load choke points found here are useful for any HAF state that must survive a reload: