Page MenuHomeWildfire Games

split template_gaia_flora*
ClosedPublic

Authored by Nescio on Sep 4 2020, 11:55 AM.

Details

Summary

Currently the public folder has:

template_gaia_flora.xml
template_gaia_flora_bush.xml
template_gaia_flora_bush_berry.xml
template_gaia_flora_tree.xml
template_gaia_flora_tree_fruit.xml

The first one is meaningful and defines the wood.tree resource and the corresponding map colour, among other things; the third and fifth replace that with food.fruit; the second and fourth only define a footprint and are thus not really worth a separate template. The bush vs tree distinction is arbitrary (and varies between languages, cultures, and people); functionally there is no difference in game.

This patch changes it to a cleaner and clearer:

template_gaia_fruit.xml
template_gaia_tree.xml

Having one generic template corresponding to a resource subtype is also consistent with:

template_gaia_fish.xml
template_gaia_ruins.xml
template_gaia_treasure.xml

For the specific gaia/flora_*.xml templates:

  • the parents are updated accordingly;
  • <ResourceSupply/Amount> is inserted to those that didn't have it yet;
  • unnecessary Dead and Tree are removed from specific name strings.

[EDIT] And removed the ForestPlant class, since it's not used in the public mod.

Similar patches include:

Test Plan

Check for completeness and correctness. Verify everything works as before.

Event Timeline

Nescio created this revision.Sep 4 2020, 11:55 AM
Owners added a subscriber: Restricted Owners Package.Sep 4 2020, 11:55 AM
Nescio edited the summary of this revision. (Show Details)Sep 4 2020, 11:55 AM
Nescio added inline comments.
binaries/data/mods/public/simulation/templates/template_gaia_fruit.xml
12–13

Unnecessary.

Nescio requested review of this revision.Sep 4 2020, 11:59 AM

This change seems to be for the better.

binaries/data/mods/public/simulation/templates/gaia/flora_tree_poplar_dead.xml
4

I guess we don't need to specify it is not alive anymore?

binaries/data/mods/public/simulation/templates/template_gaia_fruit.xml
22

Can't you omit that here?

binaries/data/mods/public/simulation/templates/template_gaia_tree.xml
19–20

I guess you need that for bush as well.

24

Can't you omit that here?

Nescio added inline comments.Sep 4 2020, 3:01 PM
binaries/data/mods/public/simulation/templates/gaia/flora_tree_poplar_dead.xml
4

What do you mean?

binaries/data/mods/public/simulation/templates/template_gaia_fruit.xml
22

<ResourceSupply/Amount> is mandatory, like <GarrisonHolder/Max>.

binaries/data/mods/public/simulation/templates/template_gaia_tree.xml
19–20

Maybe, I wasn't sure, fruit is typically placed individually or in small numbers on maps, unlike trees, so I guessed fruit doesn't really interfere with wall placement.

Freagarach added inline comments.Sep 4 2020, 4:06 PM
binaries/data/mods/public/simulation/templates/gaia/flora_tree_poplar_dead.xml
4

That some trees that are dead do not have the Dead in their specific name and I think it can be omitted in the ones that still have it.

binaries/data/mods/public/simulation/templates/template_gaia_fruit.xml
22

But you overwrite it in all the child templates?

binaries/data/mods/public/simulation/templates/template_gaia_tree.xml
19–20

Better safe than sorry, I guess. Although I am not fond of just adding it "because it used to be that way", I think it is quite hard to verify.

Nescio updated this revision to Diff 13396.Sep 4 2020, 4:41 PM
Nescio edited the summary of this revision. (Show Details)
  • purge Dead from specific name strings, as requested by @Freagarach
  • insert <DeleteUponConstruction> in template_gaia_fruit.xml
binaries/data/mods/public/simulation/templates/template_gaia_fruit.xml
22

Yes. See also e.g.

  • <ResourceSupply/Amount> in template_unit_fauna.xml in D2953
  • <GarrisonHolder/Max> in template_structure_defensive_wall.xml in D2760/rP24020
  • <Footprint> in template_unit_ship.xml in D2744/rP23963
  • <Footprint> in template_unit_fauna.xml in D2721/rP23930
  • most <Attack> values in template_unit_infantry_ranged.xml
Freagarach added inline comments.Sep 4 2020, 4:48 PM
binaries/data/mods/public/simulation/templates/template_gaia_fruit.xml
22

Hmm, true that.

Nescio updated this revision to Diff 13398.Sep 4 2020, 4:52 PM
Nescio edited the summary of this revision. (Show Details)
  • purge unused ForestPlant class
Nescio edited the summary of this revision. (Show Details)
Freagarach edited reviewers, added: Freagarach; removed: Restricted Owners Package.Sep 10 2020, 11:39 AM
Freagarach accepted this revision.Sep 10 2020, 7:30 PM
  • Forest plant: Indeed unused, can be added later if deemed a necessity.
  • Effectively nothing has changed. Complete.
  • Change is nice, it clears it up nicely.
This revision is now accepted and ready to land.Sep 10 2020, 7:30 PM
This revision was automatically updated to reflect the committed changes.