Headless replay player#1950
Conversation
|
Replay-Player is very similar to AI-Battle and theoretically could be implemented as an additional mode to it instead of completely separate app. I've decided to implement it like this but I'm not entirely convinced that this is the way to go. |
Flamefire
left a comment
There was a problem hiding this comment.
Looks good but I'm wondering if we can unify loading the replay. Especially with the fish fix it becomes a maintenance burden. Can you investigate this?
And it doesn't make sense to count asyncs: Every NWF after an async will be async too. So you can stop right there. Or at least report it only once if you see any use for letting it continue.
|
Great idea having a headless replay! I have been wanting this feature myself. My suggestion would be to make HeadlessReplay a class instead of just a collection of types and helper functions. The binary in this PR checks replays. I would like to be able to create another binary, that uses the same class and extracts training data from replays. How about something like this: class HeadlessReplay
{
public:
HeadlessReplay(const boost::filesystem::path& replay);
bool Run();
}; |
Summary
Adds a new headless
replay-playertool that loads and plays back.rplreplay files without a GUI, reporting live progress and detecting desyncs.New files
extras/replay-player/CMakeLists.txt- build target linking againsts25Mainand Boost; includes DLL gathering on Windows.extras/replay-player/HeadlessReplay.h/.cpp- supporting types and helpers:HeadlessGameState- minimalILocalGameStateimplementation (player 0 / host);forwards LuaSystemChatmessages to stdout.ReplayStatus- tracks game reference, total GF count, wall-clock start time, and last-reported GF for progress display.printConsole()- cross-platform console output: usesWriteConsoleAwith VT100 mode enabled on Windows,boost::nowide::coutelsewhere.printTable()- live-updating stats table using ANSI cursor-up escape codes, refreshed every second. Shows current GF / total GFs, game clock, wall clock, GF/sec, and per-player Country / Buildings / Military / Gold statistics. Defeated players are shown with strikethrough.printInitialInfo()- prints replay metadata (map name, version, type, size, seed, GF range) and a player roster before playback begins.extras/replay-player/main.cpp- main program:--replay/-ror as a positional argument.GameCommand.--verbose/-Vadditionally dumps the full async log.0if no desyncs were found,1otherwise (also1on any load/parse error).<RTTR_X>placeholders and leading~viaRTTRCONFIG.ExpandPath().Two-tier help: brief usage on no-args or parse error; full option list with path expansion reference on--help/-h.--version/-vprints title, version, revision, compiler, and OS.Edit: