How to create bulk materials?

Do you have any ideas how to implement bulk materials such as sand or gravel with which you can interact?
For example, to collect sand in a shovel and then pour it out? Or pour gravel into a dump truck

Hello, Welcome to the Forums.

I think the answer depends on what type of game you’re trying to make and what platforms you’re targeting.

The first thing that comes to mind is a super-simple lightweight system.
You have a shovel → You click ‘use’ on ground with shovel in your hand → The shovel mesh changes to a shovel with sand in it (or you spawn/attach a sand mesh to the shovel)

You could then ‘dump’ the sand which would revert the shovel back to the empty state and drop a ‘sand pile’ mesh onto the ground. (The sandpile would have the ability to be interacted with by empty shovels)

For the idea of filling a truck/wheelbarrow - I imagine a truck with different meshes for the ‘fill level’ of sand/gravel - so as you move sand from shovel to container, the mesh changes to represent rising levels of material.

Check out Hydroneer (Made with UE!) for some ideas too!

Yes, thanks, it might work with a shovel, but how to make something more realistic. For example, as in the game construction simulator 2022

I’m not familiar with that game - so I found a video to see what you’re talking about.

The only thing that comes to mind when watching the excavator dig is ‘Dynamic Heightmaps’

The UE Landscape system is driven by heightmaps, which is basically a 2d grayscale texture where color information is converted into height information.

I think you’re a genius :slight_smile:
Yes, it looks as plausible as possible. It turns out that elevation maps are used to edit the landscape, which is why you can make pits where the angle will be as high as 90 degrees, because elevation maps cannot display what will be underground. Yes, it makes sense, it’s just that I’m still new to this. If you add more effects, it will be plausible. And then how can you realize the fact that bulk materials end up in the back of a dump truck?
As I understand it, this can be done as in farming simulator. Only I am not strong in terms, but it seems to me that there, depending on the volume and the point where it is poured out, some kind of object or texture of the material is created, which has a customized shape, correct me or tell me how it is correctly called and can be done.
It remains only to understand how to dynamically change the landscape in certain places, and how to understand how much to change it, because an excavator bucket can ljust a little bit, or maybe dial a full bucket. Are there any tools or methods that can be invoked to do this? Or it can be calculated somehow using a bucket collision. That is, it is interesting to calculate the volume of the excavated landscape and its change in real time.
I apologize for the voluminous answer, thank you again for your help, but I really want to find out everything so that it remains only later to do.
Also sorry for English, it’s not my native language and I use a translator.

Hi @ClouDeerPC!

As odd as an answer this is, I think this tutorial series might lead you to your answer:

This tutorial describes a method of drawing landscape interaction to a render target, then reading that back in the material. The benefit of this is a lightweight system that accurately deforms for actual objects. You could use this to drive landscape tessellation, similar to how many people use this system to create tracks in snow.

Something to note- landscape tessellation was removed in I believe 5.3, then reimplemented in 5.4 but only for Nanite landscapes. You could instead affect the normals or world position offset, but based on your description it seems like tessellation will work best for you.

For the dump truck (fill levels) you’d create a Mesh for each material type (sand, rubble, dirt etc). Then create LoD’s for the fill levels. LoD 0 will be the fully filled. LoD 4 will be the smallest level.

You can then use dynamic material instance to force which LoD is used.