3D 'Tile' based world

Hello,

I’m trying to find an efficient method to implement my Game-World using UE4. I tried some approaches but can’t find any solution that really works well. So I hope someone can point me in a good direction.


First let me explain what I want to achieve:

  • 3D world composed of several 100 ‘Tiles’
  • Tiles can change their ‘Tile-Status’ which is reflected by changing their texture (using a texture atlas). Tiles can belong to a certain player which is reflected by the color of the texture.
  • Tiles can have different shapes (which are never changed during gameplay)

Think for example a simple sphere composed of hexagons and pentagons. Each of these ‘Tiles’ can have a different ‘Tile-Status’ e.g. ‘Normal’, ‘Player1’, ‘Player2’, ‘PowerUp1’, ‘PowerUp2’. The status defines the texture or color of the ‘Tile’.


This is what I have done so far:

  • First I tried spawning an actor for every tile which allows me to implement all my requirements but became very slow after ~150 actors (was testing on mobile device).

  • Then I tried using Instanced Static Meshes which greatly improves the performance allowing for 1000+ tiles.Using multiple ISM-Component i can simulate switching materials by removing an instance from one ISMC and adding it to another ISMC. The problem I have here is that mainly due to the different ‘Tile-Types’ I would require again a lot of ISMC and probably run into a similar same issue as with the actors.

  • Currently I’m thinking about using a single mesh where certain polygons represents one tile. I can create a table containing every tile and the related vertices of the mesh via a preprocessing step and use this for accessing the correct vertices. The problem is I don’t know how to modify the vertex data to represent the ‘Tile-Status’. Initially I was thinking to use the vertex color or an array of bytes to let the shader know about the type and then select the texture, color based on this. Though based on my research both options don’t seem to be possible.

So my question is if there is any other clever way how to handle this or maybe I just overlooked something in my previous tries.

Hi did you ever figure out an answer to your problem? I’m having a similar dilemma.