Page MenuHomeWildfire Games

Show fauna silhouettes
ClosedPublic

Authored by temple on Oct 21 2017, 1:38 AM.

Details

Summary

When hunting, it's hard to find animals hiding in forests even though they're visible on the minimap. Adding silhouettes would help. Notice that the silhouette shows for the carcass too.

(This change affects fish too, but silhouettes don't show through water, only terrain, so I think it's fine. It doesn't affect the hawk, which uses template_unit_fauna_decorative instead.)

Test Plan

Agree with the change.

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

temple created this revision.Oct 21 2017, 1:38 AM
elexis added a subscriber: elexis.Oct 21 2017, 1:46 AM

It is not only tolerable but intentional to show fish and whale, as they might be occluded by by trees too, right?

We can say intentional, I guess.

At least it would be consistent for all kinds of animals.
It's a bit ugly visually, the whale in particular, but good for gameplay and it probably doesn't occur that often ingame that it would be too annoying

bb added a subscriber: bb.Nov 25 2017, 10:33 PM

Certainly good for gameplay, if people do not like it visually they could just disable silhouettes imo

Why doesn't peacocks, crocodiles, asian elephants, tigers, wolves and zebras have silhouettes. To me this sequence seems rather random, but there gotta be something why they don't show.

Hawks and other decoratives are indeed good to avoid here (they already have a tag for that)

In D965#42302, @bb wrote:

Why doesn't peacocks, crocodiles, asian elephants, tigers, wolves and zebras have silhouettes. To me this sequence seems rather random, but there gotta be something why they don't show.

That's bizarre. Looks like this is the problem:

~/0ad/binaries/data/mods/public/art/actors/fauna$ grep basic_trans * -R
crocodile.xml: <material>basic_trans_parallax_spec.xml</material>
elephant_asian.xml: <material>basic_trans_parallax_spec.xml</material>
hawk.xml: <material>basic_trans.xml</material>
peacock.xml: <material>basic_trans.xml</material>
tiger.xml: <material>basic_trans.xml</material>
wolf.xml: <material>basic_trans.xml</material>
zebra.xml: <material>basic_trans.xml</material>
zebu.xml: <material>basic_trans.xml</material>

temple updated this revision to Diff 4380.Nov 26 2017, 12:45 AM
temple added a subscriber: Stan.

Removed translucent materials.
I'm not sure how that works so maybe @Stan or someone could check it's okay.
Some fauna have material defined but others don't. I don't know how it affects things.

~/0ad/binaries/data/mods/public/art/actors/fauna$ grep material *
elephant_african_bush.xml: <material>basic_specmap.xml</material>
elephant_african_forest.xml: <material>basic_specmap.xml</material>
fish_generic.xml: <material>basic_spec.xml</material>
rhino.xml: <material>basic_specmap.xml</material>
shark.xml: <material>basic_spec.xml</material>
sheep1.xml: <material>player_trans.xml</material>
whale_fin.xml: <material>basic_spec.xml</material>

Stan added a comment.Nov 26 2017, 12:59 AM

Hmm don't delete materials :)
Just because it's optional doesn't mean we should have actors who don't use them :) (We do but I guess it's a consequence of the past.)
About what basic_trans* is for it's as opposed to player trans supposed to render alpha as transparent. If you remove it I don't know what will happen. Also in the case you remove parallax and spec it means the game will no longer handle bump maps and reflection which would be a loss.

In D965#42326, @Stan wrote:

Hmm don't delete materials :)
Just because it's optional doesn't mean we should have actors who don't use them :) (We do but I guess it's a consequence of the past.)
About what basic_trans* is for it's as opposed to player trans supposed to render alpha as transparent. If you remove it I don't know what will happen. Also in the case you remove parallax and spec it means the game will no longer handle bump maps and reflection which would be a loss.

I'm not deleting the materials, just the reference to them in these actors, sorry if that wasn't clear.
For example, the difference between wolf and wolf_snow is that wolf has no material and wolf_snow uses basic_trans. What difference does that make? Does it hurt anything to remove basic_trans from wolf_snow?

Basic_trans enables alpha transparency (i.e. blending) in the engine, as Stan says. I think it's used in those animals for the manes or feathers they have.

The reason for this behaviour is documented in Renderer.cpp:L1402:

 		// (This won't render transparent objects with SILHOUETTE_CASTER - will
		// we have any units that need that?)

Seems like the answer to this 2011 question is "yes" after all.
I think adding a call to CallTranspModelRenderers would fix the problem and hopefully won't be a performance mess.

wraitii requested changes to this revision.Nov 26 2017, 9:28 AM
This revision now requires changes to proceed.Nov 26 2017, 9:28 AM
temple updated this revision to Diff 4406.Nov 26 2017, 6:37 PM

With this change the transparent animals show silhouettes.

Maybe someone could do some profiling? I can't figure it out in this case.

wraitii accepted this revision.Nov 26 2017, 7:01 PM

Gambia river shows the submission group for transparent models is 60 entities big, so I doubt it's a big performance impact on most maps.

Thanks for the patch, I'll commit it along the rest in a few days to let people come in and warn if they know something else.

This revision is now accepted and ready to land.Nov 26 2017, 7:01 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Dec 3 2017, 11:21 AM