Opened 9 years ago

Last modified 2 years ago

#3049 new defect

Rewrite/restructure gamesetup — at Version 10

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 (10)

comment:1 by Itms, 9 years ago

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 by Alex, 9 years ago

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 by Stan, 9 years ago

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

:)

comment:4 by fabio, 9 years ago

Description: modified (diff)

See also #3013.

comment:5 by leper, 9 years ago

In 16445:

Some gamesetup cleanup. Refs #3049.

comment:6 by elexis, 9 years ago

Milestone: Alpha 19Backlog

comment:7 by Imarok, 8 years ago

I CC me to this ticket

comment:8 by elexis, 7 years ago

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: https://code.wildfiregames.com/D322
Reviewed By: wraitii
Some strings reviewed By: leper

comment:9 by elexis, 6 years ago

Description: modified (diff)

comment:10 by elexis, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.