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.

[21520-screen+shot+2014-02-01+at+11.57.22+am.png|21520]

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.

[21521-screen+shot+2014-02-01+at+11.57.30+am.png|21521]

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?

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! =)

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.

Why don’t you just make this map in Tiled and then drag n drop to Unity and Scale it ?