What would it take to run DF in dwarf-mode without actually running the game loop? In other words, to populate the memory structures in df::global (for example, using data from
RemoteFortressReader) and to allow in-game menus to operate, but not to spin the game-logic loop (i.e. no pathfinding, no combat simulation, no time progression whatsoever), nor to let the in-game menus write to df::global (ideally), rather capturing the user's requested changes (e.g. enabling a labor on a dwarf) and sending them elsewhere (for example, over
RemoteFortressReader).
Is DFHack currently capable of this?
- Is DFHack capable of preventing the game-logic loop from running, and populating/updating df::global with data from RemoteFortressReader between frames?
- What about intercepting user actions from the UI (e.g. a designation, adding a new task for a workshop) and sending them over RemoteFortressReader? Can DFHack at least copy user actions and send them over RemoteFortressReader (with the local result later overwritten by an update, as described above)?
Note that blocking the game-logic loop isn't exactly equivalent to pausing (although presumably it would happen via the same code), because whether the "*PAUSED*" label is displayed on the UI would depend on what is populated into df::global. Even if it isn't displayed (if RemoteFortressReader is reading from a remote game that is unpaused), the local game-logic must not run.
Note also that since game data is coming from elsewhere (RemoteFortressReader), there are no local save files. So DFHack needs a way to get the program from the main menu to a state where it's running dwarf-mode on data whose initial state was supplied by DFHack.
This builds off
another thread about simultaneous multiplayer and a Dwarf Fortress network client.
Edit: presumably dwarf-mode's core loop will still run, but the portion that runs when a normal game is *unpaused* should be suppressed. This amounts to DFHack keeping the game "paused" regardless of whether it says it's paused or not.