diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index 7974f5059f..19a1795d55 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -337,6 +337,7 @@ scale = 1.0 ; GUI scaling factor, for improved compatibili [gui.gamesetup] enabletips = true ; Enable/Disable tips during gamesetup (for newcomers) assignplayers = everyone ; Whether to assign joining clients to free playerslots. Possible values: everyone, buddies, disabled. +aidifficulty = 3 ; Difficulty level, from 0 (easiest) to 5 (hardest) [gui.session] camerajump.threshold = 40 ; How close do we have to be to the actual location in order to jump back to the previous one? diff --git a/binaries/data/mods/public/gui/gamesetup/gamesetup.js b/binaries/data/mods/public/gui/gamesetup/gamesetup.js index 5136c68a61..615b5ddb28 100644 --- a/binaries/data/mods/public/gui/gamesetup/gamesetup.js +++ b/binaries/data/mods/public/gui/gamesetup/gamesetup.js @@ -1015,11 +1015,14 @@ function initDefaults() // Remove gaia from both arrays g_DefaultPlayerData = clone(g_Settings.PlayerDefaults.slice(1)); + let aiDifficulty = Engine.ConfigDB_GetValue("user", "gui.gamesetup.aidifficulty"); + // Don't change the underlying defaults file, as Atlas uses that file too for (let i in g_DefaultPlayerData) { g_DefaultPlayerData[i].Civ = "random"; g_DefaultPlayerData[i].Team = -1; + g_DefaultPlayerData[i].AIDiff = aiDifficulty; } deepfreeze(g_DefaultPlayerData); diff --git a/binaries/data/mods/public/gui/options/options.json b/binaries/data/mods/public/gui/options/options.json index c3b2da563b..f8c9acb7a2 100644 --- a/binaries/data/mods/public/gui/options/options.json +++ b/binaries/data/mods/public/gui/options/options.json @@ -33,12 +33,6 @@ "tooltip": "If you disable it, the welcome screen will still appear once, each time a new version is available. You can always launch it from the main menu.", "config": "gui.splashscreen.enable" }, - { - "type": "boolean", - "label": "Enable Game Setting Tips", - "tooltip": "Show tips when setting up a game.", - "config": "gui.gamesetup.enabletips" - }, { "type": "boolean", "label": "Detailed Tooltips", @@ -75,23 +69,6 @@ "tooltip": "Always show the remaining ceasefire time.", "config": "gui.session.ceasefirecounter" }, - { - "type": "boolean", - "label": "Persist Match Settings", - "tooltip": "Save and restore match settings for quick reuse when hosting another game", - "config": "persistmatchsettings" - }, - { - "type": "dropdown", - "label": "Assign Players", - "tooltip": "Automatically assign joining clients to free player slots during the match setup.", - "config": "gui.gamesetup.assignplayers", - "list": [ - { "value": "everyone", "label": "Everyone" }, - { "value": "buddies", "label": "Buddies" }, - { "value": "disabled", "label": "Disabled" } - ] - }, { "type": "dropdown", "label": "Late Observer Joins", @@ -352,6 +329,49 @@ } ] }, + { + "label": "Game Setup", + "options": + [ + { + "type": "boolean", + "label": "Enable Game Setting Tips", + "tooltip": "Show tips when setting up a game.", + "config": "gui.gamesetup.enabletips" + }, + { + "type": "boolean", + "label": "Persist Match Settings", + "tooltip": "Save and restore match settings for quick reuse when hosting another game", + "config": "persistmatchsettings" + }, + { + "type": "dropdown", + "label": "Default AI difficulty", + "tooltip": "Default difficulty of the AI.", + "config": "gui.gamesetup.aidifficulty", + "list": [ + { "value": 0, "label": "Sandbox" }, + { "value": 1, "label": "Very Easy" }, + { "value": 2, "label": "Easy" }, + { "value": 3, "label": "Medium" }, + { "value": 4, "label": "Hard" }, + { "value": 5, "label": "Very Hard" } + ] + }, + { + "type": "dropdown", + "label": "Assign Players", + "tooltip": "Automatically assign joining clients to free player slots during the match setup.", + "config": "gui.gamesetup.assignplayers", + "list": [ + { "value": "everyone", "label": "Everyone" }, + { "value": "buddies", "label": "Buddies" }, + { "value": "disabled", "label": "Disabled" } + ] + } + ] + }, { "label": "Lobby", "tooltip": "These settings only affect the multiplayer.",