# Flat ground, different tiles

**URL:** <https://forums.unrealengine.com/t/flat-ground-different-tiles/1260043>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [August 13, 2023, 10:39pm UTC](https://forums.unrealengine.com/t/flat-ground-different-tiles/1260043 "2023-08-13T22:39:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [August 13, 2023, 10:53pm UTC](https://forums.unrealengine.com/t/flat-ground-different-tiles/1260043/2 "2023-08-13T22:53:49Z")

</div>

> [@salzwer](#):
>
> 10,000 static meshes

Unlikely to ever hit 10.000 at once on a 2D game unless the tiles are really tiny as in Terraria tiny. Can still chunk load it both visually as for gameplay purposes.

Instanced static meshes make your pc suffer less. Better approach though is to store corner points of your grass plane, points of the corners on the roads, then triangulate using Delaunay. Gives you a single mesh. See my full delaunay implementation:

> [Math in Delaunay triangulation algorithm, too many triangles appearing - #4 by Roy\_Wierer.Seda145](https://forums.unrealengine.com/t/math-in-delaunay-triangulation-algorithm-too-many-triangles-appearing/677429/4)

> [@salzwer](#):
>
> A single huge mesh object with a size of 100x100 tiles for grass, and the path overlapping it, like 1 pixel higher in the Z index

Smart, but why then tile it in the first place and not have a 4 vertice plane with an X vertice road mesh on top?

> [@salzwer](#):
>
> for my purpose of telling them “make the element (13,79) have the dirt material instead of grass”.

You can assign multiple materials to a single mesh, if you build it in Blender for example. You can also procedurally generate meshes in UE and assign materials to that. You can even instruct a single material to change appearance with an internal switch or by altering a material parameter externally.

> [@salzwer](#):
>
> “make the element (13,79) have the dirt material instead of grass”

This could also be a case for a procedurally built mask in the form of a material parameter. For example you could track where the player walks through snow and write those positions to a grid on a mask as white on black, then read that mask in the snow material. Any spot on the mask marked white is lowered to generate footsteps or flattened snow. Same type of mask can be used to blend between multiple materials, you would just write a value on the mask representing the material you want. A material parameter collection is useful here for global access.

> [@salzwer](#):
>
> “straight path” and “corner”

This is easy enough. Since the path is procedurally generated you can walk from start to end and use the dot product on the current direction vs the next direction. The dot product returns 1 if the direction remains the same, 0 for a corner.

Also, if you define the path up front as connected vectors you can easily place the corner points as verts afterwards. Don’t start optimizing before you got it working though.

---

_[View the full topic](https://forums.unrealengine.com/t/flat-ground-different-tiles/1260043)._
