Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Limited size tile-map in 3D

Discussion in 'Getting Started' started by PixelPrime11, Mar 19, 2017.

  1. PixelPrime11

    PixelPrime11

    Joined:
    Mar 19, 2017
    Posts:
    14
    Hi all!

    I'm creating a 3D representation of a 2D tile-map that measures no greater than 50 x 50 tiles. This kinda deal: http://imgur.com/a/Y2MNQ

    I'm using single meshes to represent a 'tile' object of varying types, stitched together to represent the landscape (as viewed from an RTS-style perspective). These are heavily optimised meshes weighing in at no larger than 10 polys each.

    Ideally, I want to build up this model at runtime from all of the tile meshes based on a 2D representation of the map (so that I can later randomise it) - but my question is how best to optimise this? Let's say you can only view about 14 x 14 tiles in the camera view at any time, should I be breaking up the map at runtime into chunks and enable / disable them as needed based on the camera frustum, or is that overkill for something like this?

    I'd like to start this the correct way rather than try and retrofit my un-optimised version later down the line!

    Thoughts and advice would be most appreciated, thanks!
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Unity automatically culls things outside the camera frustrum. I think you shouldn't worry about it — 50x50 lightweight meshes isn't all that much nowadays. Especially if you will usually be zoomed in on some smaller portion thereof, I really don't think it will be a problem.
     
    Schneider21 likes this.
  3. PixelPrime11

    PixelPrime11

    Joined:
    Mar 19, 2017
    Posts:
    14
    This is really helpful, thanks!
    I've now done a quick test of this in Unity (instantiating a variety of custom meshes in a 50 x 50 grid) and there doesn't appear to be any real issues handling it (I tested on a GeForce 750M for good measure). I'll probably build in some other optimisations along the line, but as a baseline this is really useful info - thanks again :)
     
    JoeStrout likes this.