How should create a map for a top-down tile based 2d game?
So far when working on tile-based games I've been using Tiled. The problem is that this doesn't really seem to integrate with the Unity's visual editor. For example in 3d I can use the terrain tool, which is simply amazing.
Having looked over some of the tutorials for tile based games in Unity, most people seem to place a prefab plane for each tile. I can't imagine how that would scale if the world was larger and I wanted to edit a bigger part of it? With the 3d terrain tool, one can take a brush and simply "paint" large areas, much like I would do in something like Tiled, but afaik this can't be done if each tile is a single plane?
I know there are a few asset packages on the store that add some support for Tiled itself, but from a short look they don't seem to do more than just simply import everything at runtime, not allowing for much editing in Unity itself.
I don't really want to use Tiled, but I do want to make a top-down 2d game where I can visually edit the world, and where the world can be reasonably large (say 1000 tiles width/height), while doing as much as I can from within Unity itself. How should I do this? How do people make tile-based games in Unity?
Also a secondary question, would it be possible to write a Unity plugin that extends the editor in a way that it essentially becomes something like Tiled? I don't have that much experience with Unity yet, so I'm not sure what level of customization is possible.
Having looked over some of the tutorials for tile based games in Unity, most people seem to place a prefab plane for each tile.
I honestly can't believe this to be true as using seperate GameObjects for each tile is the first thing that people are advised against when maing a tile based game. Even for a small 100x100 map that's 10,000 GameObjects, which quickly becomes far too much for Unity to handle. Ins$$anonymous$$d, the tiles are quads (two polygons) which are part of a larger mesh, or chunk, and these chunks together form the map. The same thing is done for $$anonymous$$inecraft-like engines, only with an aded third dimension.
Back to your question. Personally. I think TilEd is an awesome tool for creating 2D maps to use in Unity. I also don't see the need to have it all be done inside the Unity Editor. Anyway, if you really don't want to use TilEd then either you have to use one of the 2D map editors from the asset store or write your own (which, speaking from experience, is a massive undertaking and can take as much time, or even more, than developing the game itself). I'd only really consider it if you want users to make maps by themselves, hence the need for a runtime editor (which something like TilEd is not capable of, because it exports prefabs). If you want to develop you own editor, the first thing you have to do is to take a look at the $$anonymous$$esh class so you learn how to create meshes via script.
Answer by J0hn4n · Sep 04, 2017 at 05:50 AM
I know its a old question but 1st, you dont need draw the entire map just only what the player can see(separe your map in scenes or just load what you can see), 2nd make your colliders statics (this means that they arent supose to move),3rd if your game its top/down you dont need physics so mimic the wall collision with your tile data(Blocked/free).
also just use a mesh to draw all the floor, or the base floor like if you are in the forest your base floor can be a dirt texture and just overlap the details of the scene with game objects.
remeber use sprite atlas to avoid extra draw calls.
Your answer
Follow this Question
Related Questions
Tiled: What’s the best way to identify objects? 1 Answer
diffuse shaders cause occasional vertical lines in 2d maps 0 Answers
Issues with dropping an object on multiple objects separetly - Simple 2d Drag & Drop 0 Answers
DontDestroyOnLoad not working properly on build (i think thats the problem atleast) 0 Answers