As described in the trac ticket, corpses clip severely through hilly terrain. When pitch-roll is used, they align correctly to the terrain, which drastically reduces clipping (although some may still occur for large units).
Details
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 891 Build 1396: Vulcan Build Jenkins
Event Timeline
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/599/ for more details.
Tested in Atlas editor using VS 2017 with VS 2015 v140 (Windows XP) pipeline and seems to work: https://imgur.com/a/SdGXItq. Is there something else missing?
Someone who knows more about the simulation might tell me if it would be reasonable to have a case distinction for structures in Health.prototype.CreateCorpse and use a new special filter template for units that adds pitch-roll for units (not introducing duplication in the special filter templates)
What's weird looking with buildings is the 'falling' animation which jolts and doesn't fall vertically (i.e. along the Y axis), and this does look odd. The rubble might have pitch-roll, but current rubble handles this nicely enough.
Likewise units jolt at the beginning of their animation when they don't have pitch-roll by default. Not sure how to fix this.
The first point is a blocker for me, the second not sure. I think elexis' suggestion is reasonable on the first point.
That would mean something like "corpse|unit_corpse|<templateName>" for units? The additional special template unit_corpse would only add pitch-roll. I am not sure though if it is possible to chain multiple special templates?
If I recall correctly, chains are supported. Doesn't cost much time to test if it is. Make sure petra AI doesn't get a stroke.
Perhaps corpse_unit should be pitch_roll if it doesn't contain anything else.
Otherwise we could also examine to use inheritance for special filter templates, this way it could avoid the duplication and the filename could be corpse_unit (so the use case is more clear and extensible for other properties).
I suspect it's not supported, (which doesn't mean that one can't add support).
I did a test trying to use multiple special filters which failed. Although I do not yet know why exactly. I think the approach with inheritance would be nice and I am happy to implement this feature. Having a pitch_roll only filter would not be much different of setting the anchor property directly in the Health component.
rP19302 introduced the special filter templates, so TemplateLoader.cpp would be the entrance point for extensions.
I implemented the feature in order to support inheritance in template filters. However, I guess this patch should be commited on a separate ticket as this is a general feature that does not only apply to this corpse case?