Opened 7 years ago

Closed 6 years ago

#4436 closed defect (wontfix)

Huge or dynamically changing amount of repeated XML elements

Reported by: elexis Owned by:
Priority: Nice to Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by elexis)

Using the repeated element in XML GUI page descriptions, the contained GUI objects can be duplicated and used as an array.

This pattern is applied

  • by the player assignments in the gamesetup (8 players)
  • when displaying resources in the top panel (#3934)
  • by the buttons in the training/research selection panel

The number of repetitions is hardcoded unfortunately, while the number of repeated GUI objects actually used changes dynamically.

This implies that we either 1) set a huge number of repetitions (for example 4096 (#4004, #4210) player assignment and civ choice dropdowns and AI config buttons) or 2) Reload the GUI page each time when the number of actually used repetition changes. The number could be passed as a new argument to the SwitchGUIPage, PushGUIPage calls. For example an object where each property relates to the name of a repeated GUI object.

Change History (1)

comment:1 by elexis, 6 years ago

Component: UI & SimulationCore engine
Description: modified (diff)
Keywords: beta removed
Milestone: Backlog
Priority: Should HaveNice to Have
Resolution: wontfix
Status: newclosed

The worst problem is the memory reserved that is never going to be used.

If we truly need so many GUI objects that it becomes worth to implement is questionable, but it would not be too bad to construct the GUI pages with the exact amount wanted when loading the GUI page, before validation.

Can be reopened once we have a precedent for so many GUI objects that the memory matters. 4096 observers are unlikely to require repeated GUI elements, number of players is probably to be capped at 256 if we don't make this an MMORPG. Also if we have so many players, it is unlikely that a user will be able to scroll through 256 objects and instead would work with grouping (like entity selection).

Note: See TracTickets for help on using tickets.