- Home /
Tile-Based 2D Isometric RPG. Building a map?
Hey All,
I'm new to unity.
I'm working on a tile-based 2D RPG game in isometric perspective, similar to final fantasy 2 and chrono trigger. The art style is 16x16 pixel sprites, and 16x16 square tiles for the map. I am making the game in the 3d mode, so I can achieve isometric perspective (while the game is really 2D, if that makes any sense).
After quite a bit of messing around in unity, I managed to set up an isometric camera using the "orthogonal" mode, set x:30 y:45. However, I don't know the first thing about how I would actually set up the tile map that the characters would go around on.
I've tried making a "plane," and using one of my tiles to cover it, but this just results in that same tile repeated over and over again. This is fine for an empty, monotonous landscape, but I need to create a map that I can edit, placing a variety of different tiles down in chosen places. I know that I could technically do this by creating a ton of planes, each with a different tile, and arranging them into the map I want, but doing that would be extremely time consuming and impractical.
This is a screenshot of the plane that has the repeated tile on it. The problem is, I have no way of placing a single tile down.
It works in isometric perspective, but there is no way for me to add other things to the map (buildings, other tiles, etc.)
I also want to alternate between different grass tiles, not just have a single one repeated, but with my limited knowledge this seems pretty much impossible.
Any ideas on how I could pull this off?
It would be best to create or buy a tile system. The Unity editor isn't really appropriate for tile-based levels.
Answer by Halleflux · Feb 01, 2014 at 08:44 PM
You could use a single background plane, and then have other smaller tiles put on top of the background tile (just slightly above, couldn't be noticed). This would be a good setup for your basic level. I'm afraid that there isn't really any good way to get by the 'placing a few hundred tiles' problem. It's going to take a while.
One idea is to create your own inspector tool, I think it's possible to allow changes when you play to carry over back to the edit mode if you setup your serialization correctly (Link to thread on serialization). This would allow you to interactively put down tiles, which, once you have the script setup, would be a massive time saver. However, if you aren't making that big of a game, it's probably more effective to just do it by hand.
As for different grass textures... You could create a new texture, which would be one texture in the top left and bottom right, and the other in the top right and bottom left, like this:
10
01
This would allow you to loop the two texture over and over. Another idea is to use a texture with transparency (as in, it has black around the edges, fades in slightly) and an appropriate shader to overlay onto a background, which would give a more seamless grass transition for areas.
I hope I've been clear enough on this and that it help out and gives you some ideas. Best of luck! =)
Thanks! I'll definitely try your suggestion. The custom inspector tool is something I might consider in the future when I actually get to making the entire game map, but for now the hand placement method should work. It just seems strange that Unity wouldn't have any sort of "map editing" tool, considering the number of games that operate that way.
Really appreciate the response!
Thanks
I personally haven't looked into it, but you could create a custom file, and use an editor tool that you make in Unity to make maps and export them as that file, which you then interpret through scripts, and place objects where needed and such.
Something I had considered was using a map editor such as "tiled," if you've heard of that, to create a map outside of unity, and then import that into unity where I would actually do all the coding for the game. However, map editors like that aren't extremely flexible and will only export in strange filetypes (others on this forum have had issues with actually putting maps they made into unity). I personally haven't had that much experience in unity, which I see to be one of my main problems, but I think creating and editing the maps within unity as you are suggesting would be a good idea.
However, I'm not exactly clear on the process of actually creating or obtaining the proper editor tool to make the maps in the first place.
Custom Editors in Unity That is one place to start, but you will need to do a large amount of research in order to actually get what you want. There are plenty of tutorials out there, though, so just search up "Custom inspector Unity" or something along those lines and you will come up with plenty of stuff to get started with.
Best of luck!
I will definitely try that! Thanks for all your help and suggestions. They've proven quite useful to me.
Answer by Mizipzor · May 28, 2014 at 09:35 AM
Rather than spending time on implementing your own map editor within Unity I would suggest that you use Tiled, a tile map editor, and spend the time on writing code that imports those maps instead. I found a project on GitHub that seems to have the foundation for importing Tiled maps. For other ways to actually handle and render the tile map in Unity you could probably find some snippets of use in my library UnityTileMap.
Answer by RIw · Feb 15, 2015 at 09:22 AM
Why don't you just make this map in Tiled and then drag n drop to Unity and Scale it ?
Can you now import tiled maps into Unity without any plugins?
Your answer
Follow this Question
Related Questions
Isometric tile-based RPG: Restricting turns to 45 degrees? 2 Answers
Is support for isometric sprites planned for integration with tilemaps? 0 Answers
GameObject rendering behind the top half of my isometric map 0 Answers
Tilemap Border Size 2 Answers
2D C# isometric Tile-based movement and collision problem 1 Answer