As described in #4876, it is cumbersome for new (experienced) players to always have to change the AI difficulty when they want to always play easier (harder) levels. This patch adds the difficulty in the options and use it when setting a new game in gamesetup.
For the moment, a new tab "AI config" is set as there was no good place for it, probably this tab could regroup all options linked to gamesetup.
Details
- Reviewers
elexis - Commits
- rP20566: Add AI difficulty in options
- Trac Tickets
- #4876
test it :)
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Would the user expect that the setting is also overwritten on mapchange if a skirmish map sets a default AI level?
binaries/data/config/default.cfg | ||
---|---|---|
339 ↗ | (On Diff #4478) | add this here? |
binaries/data/mods/public/gui/gamesetup/gamesetup.js | ||
1018 ↗ | (On Diff #4478) | (Wouldn't hurt performance to inline since it's only performed on init and that's cached in C++) |
binaries/data/mods/public/gui/options/options.json | ||
356 ↗ | (On Diff #4478) | A new page for only option seems a bit sad. We could move the "Windowed Mode" option to the graphics options and put this one under General. |
360 ↗ | (On Diff #4478) | slider possibly. tooltip might not end up nice enough |
I don't think we have any map currently which defines the AI level, and i guess that's one of the few parameters which should stay settable by the player (even on skirmish and scenarios).
binaries/data/config/default.cfg | ||
---|---|---|
339 ↗ | (On Diff #4478) | ok gui.gamesetup.aidifficulty is fine |
binaries/data/mods/public/gui/gamesetup/gamesetup.js | ||
1018 ↗ | (On Diff #4478) | yep, but i find it better as is done (it's clearer that it is a same value for all players). |
binaries/data/mods/public/gui/options/options.json | ||
356 ↗ | (On Diff #4478) | As said in the ticket description, that's not supposed to stay. My current idea would be to rather move "Enable game settings tips" and "persist match settings" to this new page and call it "Game settings" or whatever. |
360 ↗ | (On Diff #4478) | Yes, would work too. I've no strong opinion about it, so keep it with dropdown for the time being. |
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
I think on scenario maps it may not even be settable (like the other settings are fixed too).
Yep, skirmish maps set many things by default. I don't have a preference if the options setting or map setting is overwritten.
Currently no map sets the difficulty.
I've done a quick test with this patch and adding AIDiff: 1 to Acropolis Bay and it works as advertized (i.e. map setting preferd).
Accepting assuming the default.cfg, options.js label and you either moving the three other gamesetup settings over, or reviewing that move of the gamesetup settings.
binaries/data/mods/public/gui/options/options.json | ||
---|---|---|
356 ↗ | (On Diff #4478) | A gamesetup tab would be great. How the label "Match Setup" or "Gamesetup" instead of "AI Settings" in this diff? I'd really avoid a page with only one setting however. |
360 ↗ | (On Diff #4478) | Ah well, Vladislav slider granularity patch didn't make it in (yet) and we probably aren't happy with an AI level of 3.27. |
binaries/data/mods/public/gui/options/options.json | ||
---|---|---|
370 ↗ | (On Diff #4478) | (The dropdown values are still translated, but without translation context or comments, so translators have to guess what that label means, but shouldn't be hard to conclude) |