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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Beginner Question: Isometric TileMaps - Necessary? Recommended? Why?

Discussion in '2D' started by perennial_pursuits, Apr 13, 2023.

  1. perennial_pursuits

    perennial_pursuits

    Joined:
    Sep 18, 2022
    Posts:
    2
    Hi all,

    Completely new to Unity and game development, and had a question about tilemaps. I know they at the very least provide a visual aid for aligning assets, but I've also encountered difficulties in aligning tiles and objects perfectly with the iso grid(even with correct settings). I was wondering then why I should fuss with it when I can place the assets directly into the scene outside the tilemap in the hierarchy and align everything by eye. Are there other benefits and functionality that come with using an isometric tilemap that make it integral?
     
  2. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    its because the tilemap uses a mesh instead of many gameobjects, which increases performance greatly.

    If you were making a mesh manually instead of using gameobjects that would be the same as using tilemaps
     
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    People usually use tilemaps because for some types of games it's overall easier than alternatives. If you feel like it makes you more work then maybe your game is not suitable for tilemaps, or you are using them incorrectly.

    You said that you had difficulties even with "correct settings", that doesn't seem right. If you really had everything set up correctly then for the most part during level editing you shouldn't need to think about aligning anything at all.

    Note that not all "isometric tile art" is equal. If you are trying to cobble together random stuff from asset store, it can be finicky to setup. You can easily have half dozen different games that can all labelled as "isometric tiles", while being implemented in slightly different ways, requiring different setup from the sprites. Sometimes the artist simply draw and export stuff without considering how it will be actually used, or maybe they optimized the layout for some different software other than Unity. Even if they wanted to some stuff will vary between different games.

    There are plenty of reasons for using tile maps
    • provides efficient way for storing and drawing them
    • provides a framework for creating a set of corner/edge pieces that fit together and quickly creating map from them (think about parts of buildings, roads, different terrain types)
    • rule based tiles
    • When editing level makes it easier to ensure that two objects don't overlap. Single tile (in a single layer) can contain only one thing. So as long as you keep the restrictions in mind while designing tiles/object, there is less work during actual level editing.
    • semiautomated generation (computer can't align stuff by eye, but with tiles it can get good results by following very simple rules). Not only at runtime, but also during development for fixed maps. It doesn't have to be fully proceduraly generated levels, it can be as simple as meadow with randomly placed stuff for variation, or smart brushes which choose compatible tiles based on context.
    • provides opportunity to make a simple level editor for players
    • Certain game scripting logic can be much easier to write if you operate with cells in a grid instead of arbitrary placed and shaped objects. With tiles you can efficiently answer to questions like what's in this cell, or what's in a cells next to this one, no need to use physics queries. Without cells you will likely have to use physics engine queries, which is more complex both in terms of performance and also mental load. The meaning of stuff being next to each other isn't as well defined for arbitrary placed objects. Grid based logic is sometimes even used for 3D games (Minecraft is a good example of this).
    • Grid based rules work well with turn based game. Players can more easily reason and make precise predictions about grid based games rules. This is less important for action games.
    • Aligning by eye doesn't really scale well in terms of time spent doing it for bigger levels, unless the art and game rules are designed for freely placed objects. But at that point you are not aligning by eye anymore, you are simply placing stuff wherever.
    • Tiles help avoiding situations where stuff gets stuck because aligning by eye resulted in some parts being 1px or maybe (0.01px) narrower than usual. Also applies to the opposite situation of stuff squeezing through 0.01 px gaps. Not exactly relevant for isometric games, but similarly tiles make it easier to ensure consistent difficulty for jumps both in terms of height and distance.
    • Tiles allow using simpler and in certain situations faster path finding algorithms. (not that Unity provides any which would be optimized for this usecase out of the box).
    • Sometimes developers choose tiled levels for specific retro aesthetics. I don't mean that tiles are retro. Just that certain older games used tile maps heavily, and if you want to reproduce their visual style it helps if you do the same.

    Final note just because you are using tiles for some of the stuff in your game, doesn't mean you have to use them for everything. Plenty of games use a mix of various techniques. You and everyone in team just have to be aware of what set of rules are chosen.
     
    perennial_pursuits likes this.
  4. perennial_pursuits

    perennial_pursuits

    Joined:
    Sep 18, 2022
    Posts:
    2
    Thanks, this is helpful! As a follow up, if I'm wanting to make a 2d isometric room where players can drag/drop/add/swap furniture around, would this then be much easier to do with tilemaps?
     
  5. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,323
    This is better with gameobjects. Rule of thumb: if it moves/changes then consider a gameobject first. The background/floor? Tilemap. Interactable? Probably gameobject.
     
    perennial_pursuits likes this.
  6. venediklee

    venediklee

    Joined:
    Jul 24, 2017
    Posts:
    148
    Heyo, as a developer with multiple isometric tilemap specific assets/tools on the asset store; my recommendation is NOT to use isometric tilemaps unless one of these applies to you:

    • You are going for a niche aesthetic(which could attract more players)
    • You are going for high performance on very low end devices
    • You are making a small game
    • You are a 2d artist(or have a 2d artist in your team and no 3d artists)
    • You don't have enough money to spend on 3d assets
    • You don't have a moderate PC to run Unity with 3d assets loaded
    • You want challenge
    In my honest opinion, 2.5d is harder to develop than 2d and 2d is harder to develop than 3d because:
    • Sprites etc. are not object oriented. For example if you have a character sprite and want to give it a sword, you can't do it easily. You have to draw a completely different sprite for a character with a sword. In 3d you can "just" put a sword object under the hand bones, then "just" import some animations and you are done.(in some cases the new 2d bone system helps with this, but you might as well go for 3d at that point)
    • Most of the time, there are lots of solutions for 3d problems, while there are very few or no 2d solutions for the exact problem.
    • It can get quite confusing trying to achieve fake 3d with just 2d objects.
    • Official 2d solutions like 2d soft shadows(2023.1 and later iirc) get implemented much slower than 3d solutions.
    I have to say 2.5d isometric games look dope, but especially for beginners it is a trap