Page MenuHomeWildfire Games

Prevent corpses from clipping through hilly terrain
Changes PlannedPublic

Authored by Sandarac on Mar 25 2017, 11:08 PM.

Details

Reviewers
wraitii
Trac Tickets
#2031
Summary

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).

Test Plan

Test on a hilly map - like the random map "Pyrenean Sierra".

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 891
Build 1396: Vulcan BuildJenkins

Event Timeline

Sandarac created this revision.Mar 25 2017, 11:08 PM
Sandarac planned changes to this revision.Mar 25 2017, 11:29 PM

pitch-roll doesn't work so well with buildings.

Vulcan added a subscriber: Vulcan.Mar 25 2017, 11:53 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/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?

Stan added a subscriber: Stan.Jan 5 2019, 6:02 PM

Well according to @Sandarac's first post, it doesn't work well with buildings.

This comment was removed by TheCake91.
elexis added a subscriber: elexis.Jan 6 2019, 4:03 PM

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)

In D263#69588, @elexis wrote:

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)

In order to avoid pitch roll for building rubble?

wraitii requested changes to this revision.Jan 6 2019, 4:54 PM
wraitii added a subscriber: wraitii.

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.

TheCake91 added a comment.EditedJan 7 2019, 11:13 AM

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?

elexis added a comment.Jan 7 2019, 1:49 PM

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.

elexis added a comment.Jan 7 2019, 2:07 PM

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?