Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Is it possilbe to make a 2D building system using Tilemap?

Discussion in '2D' started by aybarsmete1, Oct 26, 2019.

  1. aybarsmete1

    aybarsmete1

    Joined:
    Oct 26, 2019
    Posts:
    43
    I was looking on Youtube for any 2D building system that uses Tilemaps until I realized there was no such thing. Is it possible and if it is, can anyone describe me how?

    Thanks
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,200
    Just to clarify your question, do you mean that you were looking for a system that allows you to build something on Tilemaps? Or something that concerns "buildings" and you want to do something with them on a Tilemap?

    In the first case, you probably should start from the elemental question, which is how to modify a Tilemap runtime. That will most likely return quite a few search engine hits.
     
  3. aybarsmete1

    aybarsmete1

    Joined:
    Oct 26, 2019
    Posts:
    43
    I'm looking for a system that allows you to build on Tilemap while in game, like Terraria.
     
  4. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,200
    Try Youtube/google, they will bring a few hits.
     
  5. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    936
    I haven't found Unity's tilemap system to be very good for this and so I wrote my own system. I found Unity's system to be more tailored to building in the Unity editor. A few issues I had:

    - Performance wasn't good when setting large amounts of tiles at once, especially when using tilemap colliders.
    - Functions for setting groups of tiles at once were buggy and behaved incorrectly (hopefully fixed by now).
    - Performance for a large tile map is questionable. Unity has a culling system for rendering, but only for rendering.
    - Trying to use a separate tilemap for 'chunks' has way more performance overhead than writing your own system using Unity sprites (or meshes), and I found behaved incorrectly - tilemaps weren't visible despite tiles being on screen, tiles appearing at incorrect locations, etc.

    Some of this was caused by the tilemap system having almost no useful documentation about the internal workings of the system and not understanding it as a result.

    I believe if you don't plan to make a large tilemap and don't plan to set large amounts of tiles at once, the built in system should be sufficient. Depends on your needs.

    Edit: for clarity, it IS "possible" - you can create/set tiles at runtime just fine. It's really just a matter of performance.
     
    MisterSkitz likes this.
unityunity