-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ai-battle cli #1652
base: master
Are you sure you want to change the base?
Add ai-battle cli #1652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few remarks to fix compilation
This will likely glitch on Windows though:
`printf("\x1b[%dA", 8 + world_.GetNumPlayers()); // Move cursor back up`
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
You are right. It seems that I could fix this by calling I will have to set up a windows build machine to test it. |
There is a condition that Something like
Core ideas:
BTW: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I marked a few comments as "Optional", you can skip those if you want. If you fix the others (and CI passes) we can merge this.
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Thank's a lot. I will try to apply the other suggestions as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, great!
There are 2 constness issues (Rule is: Use const
always unless you really need to modify the variable/parameter)
CI fails due to 1 conversion issue and an unrelated issue with test replays on master which will be by #1676
extras/ai-battle/main.cpp
Outdated
("objective", po::value<std::string>()->default_value("domination"),"domination(default)|conquer") | ||
("replay", po::value(&replay_path),"Filename to write replay to (optional)") | ||
("save", po::value(&savegame_path),"Filename to write savegame to (optional)") | ||
("random_init", po::value<unsigned>()->default_value(std::chrono::high_resolution_clock::now().time_since_epoch().count()),"Seed value for the random number generator (optional)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiler complains about signed->unsigned.
- use an optional and
value_or(std::chrono...)
- Or:
const auto defaultSeed = static_cast<unsigned>(std::chrono::high_resolution_clock::now().time_since_epoch().count())
next to replay/savegame_path and use it here
Adds an optional binary that runs headless (no UI) AI battles.
This can be useful when creating training data or testing new AIs.
I'm not sure if this is placed correctly or whether it should even be part of the master branch.
In any case, I would like your feedback on this tool. It aims to reuse as much of s25main as possible in order to create accurate replays.