Search Unity

3D Tile Grid Animation

Discussion in 'Scripting' started by Myhijim, Nov 8, 2015.

  1. Myhijim

    Myhijim

    Joined:
    Jun 15, 2012
    Posts:
    1,148
    Hey all,

    Been going at a grid system for a while now with a focus on performance, but I have run into a problem with my thinking. This is mostly related to my search for a way to make a performance friendly 3d Tile System with animation capability.

    There are chunks of 256x256 'cells'.

    In each 'cell' there are 3 different things : A floor tile, an array of walls and a object.

    The idea is to have the floor as one mesh utilizing a texture atlas in chunks of 256x256, then ontop of that the walls as a separate mesh over this grid using a texture atlas for both sides. Finally comes the more tricky part, the objects that reside on the tiles.

    My original plan was to have them also in one submesh with each complex mesh combined in order to save the hassle of having to instantiate/pool gameobjects in the scene. But this seems to have a few conceptual issues.

    A) The texture space is VERY limited, especially if there are to be many objects and they are fairly complex models.

    B) Animation on this one very large mesh of individual objects.

    My question is, is my quest to eliminate gameobjects on a per cell basis over-engineering it? What I am trying to do overall is to have 3 layers of grid in a 3D isometric like fashion.

    If I had to choose an example of this, it would have to be something like the Sims.

    The alternative is to leave the floor as one single tile mesh, have the walls in separate generated combined sub-mesh, and to then have a gameobject for each individual object in a chunk, but this leaves a few questions :

    A) Performance issues with say 256 individual objects ontop of these tiles

    B) Management of cell data becomes more of a hassle.

    Thanks a bunch, I will update with images as I progress.
    Myhi