Download

Track player movement and modify terrain material.

I’m looking into the ability to track all players movement on a landscape which would allow me to determine frequently travelled areas of the map. I’m looking to use this information to dynamically change the material in high traffic paths to represent frequent use.

I already have a system in place for foliage which has a presence threshold where the mesh state will change after a player spends x time in its space, however the next step would be to visually effect the ground by making things more muddy/trodden over time and then eventually regrowing into the original material.

Decals are an option, however this is a build up over time, so gradual increase in decal use could get out of hand.

Would it be more efficient to use a grid of trigger volumes which apply and destroy decals under them, or another option? I know vertex painting would give the desired effect but this needs to happen at run time.

Edit: another method would be drawing/painting an alpha mask at runtime which could be used in the landscape material. Is there a way to. achieve that?

Thanks.

Look at heat maps

I did have a look at heatmaps, but from the looks of it UE4 doesn’t provide or use them (unlike UE3).

Would there be a way to ‘paint’ a heatmap texture at runtime using blueprints?

I’m still a tad new with correct terms and processes so this is going to be primary theory driven.
the heat map is just a grid (# by # array of ints) going from green (most vegetation) to brown (least vegetation), the more actors move through a cell the darker those cells get (cell x,x = + darker).

On map load, sort through the heat map modifying the appropriate textures and models with what ever substitution method you like, be warned it can cause some extra overhead.

Look at https://www.youtube.com/watch?v=SVUPBANXQmM&list=PLZlv_N0_O1gaCL2XjKluO7N2Pmmw9pvhE&index=98 and you can see how they are applying masks, and whatever, the heat map is just another condition to add to that

Thanks John, I suppose this would be quite expensive over a large area (1km2), with a point/int got every 1m2. So I’m creating a texture/mask based off of that information? Is there any approach to create a greyscale texture based on ints for pixel information through blueprints?

It all depends on how you implement things, and what trade off you want to have.

Heres another video Blueprint Generating Procedural Rooms | Live Training | Unreal Engine - YouTube (it jumps ahead watch from beginning)
think of those rooms hes generating as your vegetation deformation

Ahh, I think you might be misunderstanding the goal I’ve got. I have vegetation deformation sorted, I’m looking to change the underlying material on the landscape based on player movement (heat maps would be ideal).

The idea is that the more the player(s) traverse an area of landscape, the grass (landscape texture, not foliage) would slowly transition into dirt/mud in those most frequented paths.

Thanks for the help so far! :slight_smile:

I understand what you are looking to do. You missed the hint on how to optimize using quadtree created regions