Page MenuHomeWildfire Games

move various values to specific fauna files
Needs ReviewPublic

Authored by Nescio on Aug 15 2020, 3:21 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

In reality all animals are different. This clean-up patch moves the <Armour>, <Attack>, <Health/Max>, <Loot/xp>, <ResourceSupply/Amount> and <UnitMotion> nodes from the various template_unit_fauna_* to the specific gaia/fauna_* files. Although this means a bit more duplication, the advantage is that it would make differentiating the various animals later easier (e.g. D497, #3778, #3918) and improves consistency.
<UnitAI/NaturalBehaviour> and the related <Vision/Range> should be done in a separate patch (cf. D2646). Afterwards the number of template_unit_fauna_* files can be greatly reduced, keeping only those that are meaningful (e.g. elephant, whale).

[EDIT] Further changes:

  • Simplified fauna_shark.xml by changing parent to the very similar template_unit_fauna_hunt_whale.xml.
Test Plan

Check for completeness and correctness. Effectively no values ought to be changed and everything should work as before.

Event Timeline

Nescio created this revision.Aug 15 2020, 3:21 PM
Owners added a subscriber: Restricted Owners Package.Aug 15 2020, 3:21 PM
Nescio requested review of this revision.Aug 15 2020, 3:32 PM
Nescio updated this revision to Diff 13198.Aug 15 2020, 4:00 PM
Nescio edited the summary of this revision. (Show Details)
Nescio updated the Trac tickets for this revision.
  • also include <Attack> node
Nescio updated this revision to Diff 13199.Aug 15 2020, 4:13 PM
Nescio edited the summary of this revision. (Show Details)
  • simplify fauna_shark.xml by changing parent to the very similar template_unit_fauna_hunt_whale.xml
Nescio added inline comments.Aug 15 2020, 4:16 PM
binaries/data/mods/public/simulation/templates/gaia/fauna_walrus.xml
33–40

Obsolete, apparently missed in D2721.

40

Inserted because the walrus has a footprint size similar to the elephants'.

binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_defensive_bull.xml
30

Not included in fauna_cattle_bull.xml, because other animals with the same or somewhat larger footprints don't have this either.

Nescio updated this revision to Diff 13202.Aug 15 2020, 5:08 PM
  • <MaxGatherers>
Nescio updated the Trac tickets for this revision.Aug 15 2020, 5:17 PM

To me this adds merely a lot of duplication actually. While I am not opposed to moving values to specific templates, without the number of template_unit_fauna_* files can be greatly reduced, keeping only those that are meaningful (e.g. elephant, whale). this patch makes little sense IMHO.
E.g. there are three bears, nicely inheriting from a *bear template, which now all three have the exact same values added. I know that in reality those three bears are vastly different and should have different stats, but until they do I do no think it is necessary to duplicate those values.

binaries/data/mods/public/simulation/templates/template_unit_fauna.xml
3

Why include this here?

without [...] this patch makes little sense IMHO.

That's a fair point. This patch does mean more duplication. When writing it, I envisioned the following:

  • move various values to specific fauna files (this patch)
  • move <UnitAI/NaturalBehaviour> and the related <Vision/Range> to specific fauna files
  • reduce the number of generic template_unit_fauna* from the current 25 to perhaps three or four that are meaningful
  • differentiate animal stats (cf. D497, #3778, #3918), affecting gameplay

The first and second are prerequisites of the third and also make the fourth easier. This patch is already quite large, however, if you believe it's better, I suppose I could merge the first three and do all those things here.

binaries/data/mods/public/simulation/templates/template_unit_fauna.xml
3

For the same reason <ResourceSupply> (below) is included: inserting <Attack disable=""/> in various specific animal templates is less work (and fewer lines) than defining all <Attack/Melee> lines in the others.