Page MenuHomeWildfire Games

Merge wolf templates
ClosedPublic

Authored by elexis on Mar 24 2017, 12:42 PM.

Details

Summary

The wolf and snow wolf templates are duplicated.
Typically when duplicating templates, people forget to update both when intending to change one or
change the wrong one as happened in rP19254.

Test Plan

Make sure those things still spawn on polar sea / northern lights for the snow one and rhine marshlands for the regular wolf.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Mar 24 2017, 12:42 PM
Vulcan added a subscriber: Vulcan.Mar 24 2017, 1:26 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/588/ for more details.

leper added inline comments.
binaries/data/mods/public/simulation/templates/template_unit_fauna_wolf.xml
2 ↗(On Diff #926)

This was changed from _aggressive in a certain commit, was that change really needed?

This was changed from _aggressive in a certain commit, was that change really needed?

Given that it was committed with non-violent wolves, no, the map is still usable without.

Aggressive animals behave weirdly, one can run through a bunch of them and none of them reacts to the unit, even if if collides with them. In the same replay with a violent wolf the unit is dead on arrival. So the map would certainly benefit from it.


Now that the map has an own template, the stance can be moved to that template, though I'd still prefer nuking that template, implementing a CanMove boolean, allowing the templates to set it (so that we can have owned immovable chicken, owned INDIVIDUALs that can't be moved and support weird mods that don't want to rely on the Domestic tag while removing the hardcoded class checks) and using special_filter/CanMove.xml to accomplish removing the exotic template.

Now that we have a second difference to the casual snow wolf, maybe it's best to keep the exotic template.

Aggressive animals behave weirdly, one can run through a bunch of them and none of them reacts to the unit, even if if collides with them. In the same replay with a violent wolf the unit is dead on arrival. So the map would certainly benefit from it.

Could that be related to some animal/gaia visibilty change from a few years back? I seem to recall that some commit broke "wild" (most likely aggressive) animals from actually attacking anything. Also most of the difference between those stances is pursuing targets out of vision range, so it does seem likely.

Now that the map has an own template, the stance can be moved to that template, though I'd still prefer nuking that template, implementing a CanMove boolean, allowing the templates to set it (so that we can have owned immovable chicken, owned INDIVIDUALs that can't be moved and support weird mods that don't want to rely on the Domestic tag while removing the hardcoded class checks) and using special_filter/CanMove.xml to accomplish removing the exotic template.

Now that we have a second difference to the casual snow wolf, maybe it's best to keep the exotic template.

Some special maps might just need special templates, as long as we don't mix them with those for normal gameplay (and gameplay modes) I don't mind having a few of those around as examples to modders and to show what we can do with template changes only.

That said I'd go with making those actual INDIVIDUAL state entities, and providing a small hook/extension to UnitAI that adds a roaming state if you really need one, or does that thing itself.

elexis updated this revision to Diff 933.Mar 24 2017, 10:58 PM

Merge wolf templates, revert casual wolves to aggressive and make polar sea wolves violent, assuming that we keep the special template.
(Notice ice bears (only texture change would be required) and snow fox (crappy & creepy visual actor exists) were originally thougt about too, but discarded to keep it more reasonable.
Having a horde of wolves attack makes more sense than having an entire zoo attacking you.)

Trying INDIVIDUAL and changing UnitAI from the trigger script now, if that is considered more sane. Going to post whether I succeeded.

Trying INDIVIDUAL and changing UnitAI from the trigger script now, if that is considered more sane. Going to post whether I succeeded.

It does seem more fitting given that this is sort of a trigger/mod map, so using some of those things we have available seems at least worth a try. Especially considering that then we can actually test for any side effects caused by that instead of having to hope that other animals don't start doing weird things, or causing other bugs down the line.

binaries/data/mods/public/simulation/templates/trigger/fauna_wolf_snow_domestic.xml
1 ↗(On Diff #933)

(Actually related to the file name) Why not fauna_wolf_snow_attack.xml or something like that, given that the domestic property isn't interesting, but that it is used for attacks or attack hordes or whatever name you want to use for that is.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/593/ for more details.

elexis added inline comments.Mar 26 2017, 11:08 PM
binaries/data/mods/public/simulation/templates/trigger/fauna_wolf_snow_domestic.xml
4 ↗(On Diff #933)

This also changed the attack behavior and ranged units will now use the slaughter attack against wolves instead of the ranged attack.

elexis added inline comments.Mar 26 2017, 11:11 PM
binaries/data/mods/public/simulation/templates/trigger/fauna_wolf_snow_domestic.xml
4 ↗(On Diff #933)
<Slaughter>
  <Hack>50.0</Hack>
elexis updated this revision to Diff 1007.Mar 30 2017, 12:48 PM

Rename fauna_wolf_snow_domestic.xml to fauna_wolf_snow_attack.xml, so that the template name becomes agnostic of the way it accomplishing it's goal.
The INDIVIDUAL proposal should be in a separate diff as the two wolf templates are innocent and if we ever would have reason to revert such an INDIVIDUAL change,
we wouldn't have to look at the merging of the two old templates.

fatherbushido accepted this revision.Mar 30 2017, 1:30 PM
fatherbushido added a subscriber: fatherbushido.

While polar wolf and classic wolf aren't as different as a bear and a wolf the merge makes sense.
(Tested)

binaries/data/mods/public/simulation/templates/trigger/fauna_wolf_snow_domestic.xml
4 ↗(On Diff #933)

The converse would we bad ;-)

This revision is now accepted and ready to land.Mar 30 2017, 1:30 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/640/ for more details.

Thanks for the review and feedback fatherbushido and leper!

This revision was automatically updated to reflect the committed changes.