Opened 4 years ago

Last modified 4 months ago

#3049 new defect

Rewrite/restructure gamesetup

Reported by: leper Owned by: leper
Priority: Should Have Milestone: Backlog
Component: UI – Game setup Keywords:
Cc: Patch:

Description (last modified by elexis)

Currently gamesetup.js is not really extensible to support trigger/campaign maps where some settings should be fixed while others can be changed (e.g. allowing the player to assign himself to slots 1 and 3 on a 4 player map). See also #4838.

The logic to decide what settings can be changed (for RMS, Skirmish Maps, and Scenarios) is also quite duplicated. (done in r19504)

The code could also use some improvement such that the persistent game settings can work with just storing the minimum of information needed to recreate the settings instead of saving everything and then hoping that it doesn't cause conflicts/issues later (see #3044, #3033).

Change History (11)

comment:1 Changed 4 years ago by Itms

In 16346:

Some hacks to fix game setup persisting problems, patch by @aBothe.
Fixes #3033, #3034.

The whole gamesetup.js system should be eventually re-factored to remove those hacks and to improve the robustness of the code: see #3049.

comment:2 Changed 4 years ago by Alex

Is there a gamesetup-wishlist?

Things like the ability that each player in a networked gamesetup should be able to choose his/her own civ/color/position - perhaps a more AOE-like behaviour could be taken, so that colors are hardwired to positions or such.

Anyway, yes, gamesetup needs a rewrite.

comment:3 Changed 4 years ago by stanislas69

If you could have a look at #1580 I'd be happy :) else #1834 also #812


comment:4 Changed 4 years ago by fabio

Description: modified (diff)

See also #3013.

comment:5 Changed 4 years ago by leper

In 16445:

Some gamesetup cleanup. Refs #3049.

comment:6 Changed 4 years ago by elexis

Milestone: Alpha 19Backlog

comment:7 Changed 3 years ago by Imarok

I CC me to this ticket

comment:8 Changed 2 years ago by elexis

In 19504:

Unify gamesetup option handling, fixes #3994, refs #3049.

Removes a lot of duplication and ugly GUI handling code with very similar, yet different code paths.
Move the setting specific logic to the functions of that setting and keep the universal logic in global atomic functions.
Make gamesetup.xml agnostic of all gamesetup settings.

Adding a new gamesetup option now only requires adding one hunk with the titles and values and one line in g_OptionOrderGUI.
Opens up the possibility to iterate over all settings, refs #3806, #3883.

Allow starting singleplayer games in observermode with only AIs assigned, fixes #4078.
Autocomplete translations of all setting titles and selected title values like playernames and victory conditions.

Transfer the AI difficulty when swapping with a player.
Move logic from onTick to the GUI handling functions.
Change some global consts to var, so that contributors become invited to change them from a different place.
Add missing startGameButton tooltip translation.

Differential Revision:
Reviewed By: wraitii
Some strings reviewed By: leper

comment:9 Changed 20 months ago by elexis

Description: modified (diff)

comment:10 Changed 20 months ago by elexis

Description: modified (diff)

comment:11 Changed 4 months ago by Imarok

Component: UI & SimulationGame setup

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

Note: See TracTickets for help on using tickets.