Landsc ape: Paint: reading from blueprint possible?

I have a landscape and used the paint (6 different materials).

Now I want to read from the landscape what type of paint is below a character’s feet. Based on that I want to play different sound for steps (e g walking on gras sounds different than stone), limit character speed, possibly change movement animation, and much more.

Is there a way to read the type of paint at a defined coordinate (x,y) from a blueprint?

but you can set each layer to a Physical material, which will cause a response to be avaliable.

thanks for the precise inspiration, it works

I assigned different physical materials and did a line trace to get the information. It works.

But doing a line trace that often (e g with every footstep) might consume a lot of calculation power. Is there a better way to get the information than doing that line trace?

Nope. If you want your footsteps to produce the proper sound, then you have to trace each step. Imagine having a grass material, but you’re walking on a wood floor, sidewalk, dirt patch etc.

If there’s no possible chance of stepping on a surface other than the painted landscape, then you could set up overlap volumes to switch the sounds. This would probably give you more headaches than it’s worth.

Line/shape traces are fast and efficient, but they do run on the CPU which will pause the game threads execution during the trace. You can typically get away with 50± per frame, BUT that depends on all other logic complexity per frame, per game. Thus performance varies game to game. In general a trace should execute in 0.001ms

Bottom line… if a trace per step is having a huge impact on your games performance you really need to take a look at your games overall performance. Time to start profiling.

In reality, the info of the capsule is already avaliable.

Second. A line trace costs next to nothing…

Third. This is core gameplay, so you can make it however expensive it has to be…

I never found this to be precise enough. For example if one foot is on a dirt surface and the other on concrete and the capsule side is touching a wall.

When you set it up it usually doesn’t matter. You’ll get a few missteps - it’s inconsequential.

If you resorted to using the existing trace result due to performance issues,
a) you are doing something else very wrong and
b) you just have to live with the limitation. It’s one trace, not 2.

In professional or even indy projects you usually have foot Ik going that gives you 2 traces anyway. As well as a way to make the sounds play without a notify (using the curve).

What you can count on, always, is for things to go like they did in .22 (if I remember the version correctly) where we were left for around 4 months without a landscape physmat response due to whatever “improvements” they made at the time :stuck_out_tongue:

For simple stuff I go the notify trace route. For foot Ik I pull from those traces. Haven’t touched curves for footstep sounds. Interesting approach.

The majority of my demo stuff is in 4.22 and I haven’t run into the physmat issue. I do remember your posts on it though.