Page MenuHomeWildfire Games

clean up fauna templates
Changes PlannedPublic

Authored by Nescio on Aug 15 2020, 3:21 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
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.
[EDIT] Further changes:

  • Moved <UnitMotion/WalkSpeed> multiplier to the specific gaia/fauna_* files, rounded to the nearest 0.05, for clarity.
  • Moved <UnitAI/NaturalBehaviour> to the specific gaia/fauna_* files.
  • Removed 20 template_unit_fauna_* files, hence less work for maintaining and less confusion for future additions.
  • Simplified fauna_shark.xml by changing parent to the very similar template_unit_fauna_hunt_whale.xml.
  • Renamed template_unit_fauna.xml to template_unit_animal.xml to match class, name, and proper English (fauna is a collective mass noun), and adjusted children accordingly.
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.

39

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.

Nescio updated this revision to Diff 13524.Sep 23 2020, 8:36 PM
Nescio edited the summary of this revision. (Show Details)
Nescio added a reviewer: Restricted Owners Package.
  • rebased and updated
  • moved <UnitAI/NaturalBehaviour> to specific gaia/fauna_* templates and deprecated 20 generic template_unit_fauna_* templates, per @Freagarach
  • renamed template_unit_fauna.xml to template_unit_animal.xml
Nescio updated this revision to Diff 13525.Sep 23 2020, 8:47 PM
Nescio retitled this revision from move various values to specific fauna files to clean up fauna templates.
Nescio edited the summary of this revision. (Show Details)
  • remove walk speed multiplier from template_unit_fauna.xml
Nescio edited the summary of this revision. (Show Details)Sep 23 2020, 8:48 PM
Nescio planned changes to this revision.Jan 12 2021, 10:37 PM
Nescio edited reviewers, added: Restricted Owners Package; removed: Restricted Owners Package.

This needs a rebase.

I can ping you if I find some time/motivation for this. I want to merge D2646 first anyway ;)