HomeWildfire Games

Move GenericName, History and Icon from the civ-JSON to cmpIdentity.
Concern RaisedrP26298

Description

Move GenericName, History and Icon from the civ-JSON to cmpIdentity.

Since the players/civs already have cmpIdentity, use it.
This forces civs to have corresponding XML in the special/players/ folder.

Also moves the files from special/player/ to special/players/ consistent with other folders. And moves the generic player.xml one level up.

Differential revision: https://code.wildfiregames.com/D4473
Help and comments by: @Stan, @wraitii

Event Timeline

bb raised a concern with this commit.Feb 10 2022, 10:16 PM
bb added a subscriber: bb.
bb added inline comments.
/ps/trunk/binaries/data/mods/public/l10n/messages.json
26โ€“29

That is an invalid json. (Translation scripts complaining)

This commit now has outstanding concerns.Feb 10 2022, 10:16 PM
bb accepted this commit.Feb 11 2022, 1:12 PM
All concerns with this commit have now been addressed.Feb 11 2022, 1:12 PM
bb added inline comments.Feb 11 2022, 2:05 PM
/ps/trunk/binaries/data/mods/public/l10n/messages.json
16

Gone?

bb added inline comments.Feb 11 2022, 2:24 PM
/ps/trunk/binaries/data/mods/public/l10n/messages.json
26โ€“29

Also these strings are extracted twice now: they also exists in gui-templates-other. Should add some excludemask

/ps/trunk/binaries/data/mods/public/simulation/data/civs/athen.json
24โ€“26

These are not extracted anymore, due to the messages.json change...

bb raised a concern with this commit.Feb 11 2022, 4:49 PM

(Seems I keep returning...)

/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
26

That engine function is not available from the sim. Open survival of the fittest and see some errors. Probably need to move the GetTemplate function to a more global realm.

This commit now has outstanding concerns.Feb 11 2022, 4:49 PM
Freagarach marked 2 inline comments as done.Feb 18 2022, 7:54 AM
Freagarach added inline comments.
/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
26

Included in D4486.

wraitii raised a concern with this commit.May 1 2022, 12:18 PM

Gonna raise a concern, I've convinced myself this needs to be mostly reverted. See https://code.wildfiregames.com/D4630#196827, rephrased below:

This diff does three things:

  • Use the player-entities's Identity component instead of the cmpPlayer to get the civ code and the name < probably a good change, reduces duplication
  • Move the historical data from JSON files to XML, making a lot of the code awkward and resulting in the Engine.GetTemplate fiasco < definitely a bad call, IMO. Just load the JSON data and populate the player-entity Identity at game start.
  • Made the Civ template XML the 'core truth' of what civ were available < Definitely broken. JSON files were working well, and the civ XMLs are just setting the gameplay element.

I think only point (1) is actually worthwhile, point (2) just leads to awkwardness and makes point (3) necessary when point (3) is IMO a move in the wrong direction altogether.