- Start AoE4_ReplayOverlay.exe.
- Start Age of Empires 4 with the command line argument '-dev'
- Load a replay.
- Open the in-game command prompt via CTRL + SHIFT + `.
- Copy the command provided by AoE4 ReplayOverlay to the system clipboard.
- Paste it into the in-game command prompt (CTRL + V) and execute it(RETURN).
Age of Empires 4 has an in-game command prompt. By default there is hardly anything noteworthy that can be done with it. However if Age of Empires 4 is started with the command line argument '-dev' a whole host of commands useful for interacting with the game becomes available.
The command prompt basically interprets input as lua scripts with a few minor restrictions(no file access, no debug...). This allows for a script that can extract information from a running game(OverlayDataCollector.lua).
On the down side starting Age of Empires 4 with '-dev' blocks multiplayer including observing ongoing games but it does not block access to replays.
Performance may become an issue if the script becomes too complex.
Age of Empires 4 writes everything sent via the lua command 'print' to its 'warnings.log' file located in '~\Documents\My Games\Age of Empires IV', which is then read by the overlay application.
In the future a more sophisticated method may become necessary.
Credit goes to Maguro. This was built using his AoE4 Overlay as foundation.