Page MenuHomeWildfire Games

Add AI difficulty in options
ClosedPublic

Authored by mimo on Dec 1 2017, 7:36 PM.

Details

Reviewers
elexis
Commits
rP20566: Add AI difficulty in options
Trac Tickets
#4876
Summary

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.

Test Plan

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

mimo created this revision.Dec 1 2017, 7:36 PM
elexis added a subscriber: elexis.Dec 1 2017, 7:43 PM

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.
(There are one or two revision for reordering options.)

360 ↗(On Diff #4478)

slider possibly. tooltip might not end up nice enough

mimo added a comment.Dec 1 2017, 8:08 PM
In D1096#43371, @elexis wrote:

Would the user expect that the setting is also overwritten on mapchange if a skirmish map sets a default AI level?

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.
But i don't really mind in fact.

360 ↗(On Diff #4478)

Yes, would work too. I've no strong opinion about it, so keep it with dropdown for the time being.

Vulcan added a subscriber: Vulcan.Dec 1 2017, 8:25 PM

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...
Vulcan added a comment.Dec 1 2017, 8:26 PM
Executing section Default...
Executing section Source...
Executing section JS...
elexis accepted this revision.Dec 1 2017, 8:38 PM

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?
The tab order is correct.

I'd really avoid a page with only one setting however.
In a second diff one could move move these three settings you mentioned and gui.gamesetup.assignplayers to this new page.
(The order of the match setup settings doesn't matter really.)
I personally wouldn't complain if the second diff is committed as accepted by me directly if it's only moving these 4 settings without change here. I can do it too if you prefer review that diff instead.

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.

This revision is now accepted and ready to land.Dec 1 2017, 8:38 PM
elexis added inline comments.Dec 1 2017, 8:39 PM
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)

This revision was automatically updated to reflect the committed changes.