2d tile set editor tool

Hi!
Im looking into making 2d tilebased game with a world map with squares. I have a question but would also like to hear general tips or your own experiences. My idea is to map the tiles to 1 unity meter and make the movement like a chess board, one square at a time.

So im thinking in using a prefab with a script called Tile and then have a collection of instances of a Terrain class. The terrain class will have a sprite and other info about the terrain. Each tile will have a terrain which will give the tile the sprite it will use to render itself.

Now to my question. I am imagining the world map as some kind of multi dimension array like 256x256. How would i go about making a editor tool that lets me take a grid and click on each square, get a list of all the terrain types and lets me choose one?

I realize its a big question so maybe someone can tell me some conecpts i can look up and read more about?

That won’t work with such a huge number of GameObjects (256x256 = 65K). You’ll either need to use a different method of rendering (such as making combined mesh chunks instead of sprites), or else use a pooling system so that only the actually visible sprites are created and rendered.

–Eric

But i wont use a separate sprite for each tile. My idea is to have a set of sprites and that each tiles uses one of them. You still say it will be to heavy?

What you described does use a separate sprite for each tile…whether you have 2 textures or 200 (or whatever number) isn’t relevant, you’re still use a GameObject per tile. So yes, 256x256 is far too heavy for such an approach.

–Eric

OK! I see. Well great that i asked here before starting for real. :slight_smile:
Can you tell me a bit more about the alternatives? I will start researching them. Thank you!

I’m using 2dtoolkit, it has a built in tile-set systems that’s pretty decent.