Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Solutions for a tile-based game on a polyhedron

Discussion in 'General Graphics' started by unity_zjCgQ21xcO2QTQ, Dec 22, 2017.

  1. unity_zjCgQ21xcO2QTQ

    unity_zjCgQ21xcO2QTQ

    Joined:
    Oct 8, 2017
    Posts:
    1
    Hello, I am making a tile-based game. Instead of using a flat tiling I want to make each face of a goldberg polyhedron a tile. I am having some technical difficulties regarding producing different configurations between games and change textures/tile-types at runtime. There seem to be a few possible solutions.

    1. Polyhedron is a single object with one mesh, a texture atlas is generated procedurally and modified at runtime to change individual tile's textures. At the moment I have not found a way to do this, though I may experiment to see if this is possible.

    2. Polyhedron is a single object but each face/tile is a submesh, allowing me to change textures at runtime. This is what I'm currently working with but I'm reading in some places that sub-meshes produce massive overhead, if anyone has insight on this that would be great. I am also having some issue regarding the positions of sub-meshes rekltive to their colliers but I think I can figure this out.

    3. Each tile is a separate object, generated and arranged into the polyhedron at runtime. This seems like a needlessly complex solution but also like the one Unity is most suited for. I'd rather not have to figure out the math involved in constructing a goldberg polyhedron procedurally but I will if I have to.

    Have any of you had similar dilemmas? What do you recommend? What do you know about the overhead of sub-meshes and modification of images/texture atlases at runtime?

    Thank you for your time and help!

    Edit: I apologize if I have posted this in the wrong sub-forum; I'm new.
     
  2. markokecman

    markokecman

    Joined:
    Jul 27, 2017
    Posts:
    1
    Hi unity_zjCgQ21xcO2QTQ,
    I'm facing the same problems as you.
    Did you find a good solution to this problem?
    Thanks!
     
  3. najaa3d

    najaa3d

    Joined:
    Jan 22, 2022
    Posts:
    29
    I'm also interested in this solution. Did you ever achieve any success?
     
  4. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    You are best to have multiple mesh objects, as the hex map also contains pentagons. If you did have the maths to produce this shape procedurally then you’d have no problem talking about specific faces. But the main problem is talking to specific faces. Which indicates to me that it probably would be easier due to the irregular pattern to be dealing with faces as individual objects.