Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#4838 closed defect (fixed)

Map-specific gamesetup settings

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 24
Component: UI – Game setup Keywords:
Cc: Patch:

Description (last modified by elexis)

It would be really awesome if maps could specify custom gamesetup options.

Use cases:

  • Scripted enemy strength on Survival Of The Fittest and Danubius
  • Water level rising speed for Extinct Volcano
  • Which of the 10+ map variations of the Unknown map
  • Which of the two Fert map variants to generate (Phab:D1634)
  • Player placement options #4110
  • Which character we want to represent in a specific scenario
  • ...

As of Phab:D322 (gamesetup option unification), a new gamesetup option only requires a small hunk to add a new option. The JSON file of the map could specify the short mapname_gamesetup.js file to be loaded (just like it can specify a trigger script file)

refs #3049

Change History (13)

comment:1 by elexis, 6 years ago

Description: modified (diff)

comment:2 by elexis, 6 years ago

Priority: Nice to HaveShould Have

comment:3 by elexis, 6 years ago

Description: modified (diff)

comment:4 by FeXoR, 5 years ago

Yes, yes, yes! Please, please, please ;)

It could be realized by adding a new tag to the map.json file (e.g. CustomOptions) that holds an associative array(key/value pairs] with the keys being the strings of the setting seen in gamesetup and the value can be and translates to GUI object:

  • Boolean -> Checkbox with the given value as default state
  • Array of strings -> Dropdown with the strings as values with array[0] as default
  • Number array pair -> Spinner with the number as default, array[0] as minimum, array[1] as maximum and array[2] as increment step width if given, else 1

And there could be more ofc.

Version 0, edited 5 years ago by FeXoR (next)

comment:5 by elexis, 5 years ago

Owner: set to elexis

JSON isn't sufficient because we also need JS logic. Seems like I didn't mention that I'm sitting on a patch for this.

comment:6 by Imarok, 5 years ago

Component: UI & SimulationGame setup

Move tickets to Game Setup as UI & Simulation got some sub components.

comment:7 by elexis, 4 years ago

There is also the analogous improvement for the session, i.e. map-specific session code, refs #5387.

The incentive to use that would be having a triggerscript that uses GUIInterface PushNotification with a custom event type and event data, and the map provides GUI session code processing that map event.

comment:8 by elexis, 4 years ago

In 23374:

Gamesetup class rewrite, fixes #5322, refs #5387.

  • Decouples settings logically which in turn allows fixing many problems arising from previous coupling.
  • Fixes the persist-match-settings feature, refs #2963, refs #3049.
  • Improves performance of the matchsetup by rebuilding GUI objects only when necessary.

Provides groundwork for:

  • UI to control per-player handicap, such as StartingResources, PopulationCap, StartingTechnologies, DisabledTechnologies, DisabledTemplates, ..., refs #812.
  • Map specific settings (onMapChange event), refs #4838.
  • Chat notifications announcing which settings changed, refs D1195,
  • Multiple controllers setting up the game (since setting types can check for permissions in onUpdateGameAttributes without the need for a new data model or a second gamesetup data network message type), refs #3806, subsequently dedicated server, refs #3556.
  • MapBrowser (MapCache, MapTypes, onUpdateGameAttributes interface), refs D1703 and D1777,
  • Multiplayer saved games (decoupling and setting dependent unique logic), refs #1088.

Refs https://wildfiregames.com/forum/index.php?/topic/20787-paid-development-2016/ https://wildfiregames.com/forum/index.php?/topic/20789-paid-development-2016/

Enable maps to restrict setting values:

  • If a map specifies an AI or Civs for a playerslot, the controller can't assign a player/other AI or Civ to that slot, refs #3049, #3013.

Fix per player StartingResources, PopulationCap, StartingTechnologies, DisabledTechnologies, DisabledTemplates following rP12756, refs #812, fixes #4504. Use this for DisabledTechnologies on Polar Sea.

Persist user settings for Skirmish maps:

  • All user chosen settings are persisted when changing the selected map or maptype, except where the selected map overwrites the setting value and except for Scenario maps which still use the default value where the map doesn't specify the setting value.
  • Tickets relating to that Skirmish mapchange user setting persistance:
    • Selecting a map doesn't change the selected civilizations, fixes #3120 (together with r23279 removing map specified Civs).
    • Selecting a map type doesn't reset the selected settings, fixes #5372.
    • Selecting a map doesn't change the selected victory conditions, unless the map specifies those, refs #4661, #3209. (Atlas still writes VictoryConditions to every map.)
    • Consume the player color palette from Skirmish maps, refs rP17040 / #1580. Preserve the selected playercolors when switching the Skirmish/Random map by chosing the most similar colors if the map comes with a different palette.

Rated games:

  • Hide and disable Rated game setting unless there are exactly two players, fixes #3950, supersedes D2117.
  • Display conspicuous warning if the game is rated, so players are perfectly aware.

Autostarted games:

  • Allow using the gamesetup page to autostart matches with arbitrary maps, not only this one tutorial, as reported in D194 and rP19599, refs D11.

Networking:

  • Keep gamesetup page open after disconnect, allowing players to read chat messages indicating why the host stopped the server, fixes #4114.
  • The message subscription system allows new and mod settings to run custom logic on arbitrary setting changes (most importantly on map change). This removes hardcoded logic restrictions from the gamesetup option unification rewrite in rP19504/D322, refs #3994, such as the hardcoding of setting references in selectMap to biomes from rP20115/D852 and the difficulty from rP20760/D1189, RelicDuration, WonderDuration, LastManStanding, RegicideGarrison, TriggerScripts, CircularMap, Garrison, DisabledTemplates.

Checkboxes:

  • Display values of disabled checkboxes with Yes/No labels, fixes D2349, reviewed by nani.

Clean g_GameAttributes of invalid values and gamesetup GUI temporaries, refs #3049, #3883:

MapCache:

  • Refactor to MapCache class, store maps of all types and use it in the replaymenu, lobby and session as well.

SettingTabsPanel:

  • Remove hardcodings and coupling of the SettingTabsPanel with biomes/difficulties/chat UI from D1027/rP20945.

GamesetupPage.xml:

  • Restructure the page to use hierarchical object organization (topPanel, centerPanel, centerLeftPanel, bottomPanel, centerCenterPanel, centerRightPanel, bottomLeftPanel, bottomRightPanel), allowing to deduplicate object position margins and size math and ease navigation.

New defaults:

  • Check LockedTeams default in multiplayer (not only rated games).
  • Persist the rated game setting instead of defaulting to true when restarting a match, which often lead to unintentional rated games when rehosting.
  • 60 FPS in menus since they are animated

Autocomplete sorting fixed (playernames should be completed first).
Refactoring encompasses the one proposed in Polakrity and bb D1651.

Differential Revision: https://code.wildfiregames.com/D2483
Tested by: nani
Discussed with:

Emojis by: asterix, Imarok, fpre, nani, Krinkle, Stan, Angen, Freagarach

comment:9 by elexis, 4 years ago

Description: modified (diff)

comment:10 by elexis, 4 years ago

In 23392:

Landscape and Daytime gamesetup options for the Unknown, Danubius and Polar Sea, refs #4838.

Allow gamesetup options other than biome to determine the map peview image, refs #4962, rP21523.
Add previews for the 12 Unknown, 2 Danubius and 2 Polar Sea variations.
Concludes deduplication of the Unknown (rP12545), Unknown Land (rP12654) and Unknown Nomad (rP12747), refs #4317.

Differential Revision: https://code.wildfiregames.com/D2564

comment:11 by elexis, 4 years ago

In 23434:

Gamestup option to select the time the sea level starts to rise on Extinct Volcano (and other maps thay may want to use it), refs #4838.

Differential Revision: https://code.wildfiregames.com/D2593

comment:12 by elexis, 4 years ago

Milestone: BacklogAlpha 24
Resolution: fixed
Status: newclosed

The infrastructure, the example settings described in the ticket are there (Phab:D2607 another, except for Danubius difficulty, but that doesn't really need the ticket to be implemented, nor isn't a must-have).

comment:13 by elexis, 4 years ago

In 23473:

Gamesetup setting for map specific team placement, fixes #4110, refs #4838.

Differential Revision: https://code.wildfiregames.com/D2607

Note: See TracTickets for help on using tickets.