For top down Tile based shooter, should i be importing each tile individually?

Bit of an odd one i think…

At the moment i am making 32x32 sprites, and using Tiled to assemble them into a map, and them importing them into unity, but because i then turn it into a material to add to a quad, the resolution is slightly altered and i loose some of the detail, and i cant find a Point Filter style option but for the material so the map doesnt loose quality.

My other thought would be to import each tile as its own sprite but that seams ridiculously time consuming AND fiddly and a waste of time from all points.

It may be a case of i need to change my export settings in Tiled, or just use a whole different thing for assembling a tiled map?

If you are using tiles, you could make a public array of GameObjects that show in the inspector, for your level prefab object. Create a prefab for each tile and assign that prefab into the GameObject array. Essentially you will then have a tile from number 0 to X, where X is the number of tiles minus 1.

When you build you map, you could simply use a 2 dimensional array of Ints which you use to instantiate the appropriate tile.

absolute_disgrace has a good idea but if you have loads of tiles it might be a better idea to create a single prefab and create a script to add the different properties e.g this is a wall, potion, food etc. that’s how I do it.

Tiled is good, though I have my own MLE (Multi Level Editor), mine allows for hundreds of sprite sheets in one project.

Yep 2 dimensional array but use a class instead e.g private Cell[,] mCells; now it’s an array of cell objects.

Sorry im slightly new so just want to make sure i understand.

I make prefabs of my tiles: that being a prefab of a wall, a prefab of a walkway ect and then…

No i’m lost. The way im reading it sounds like scripting entirely makes the map? Or am I making the map in Tiled, importing it, and then using scripts to assign where is a wall, where is a walkway and so on?

It would be better to use a proper Unity tile system. The one in my sig does import Tiled maps, if you don’t want to recreate it.

–Eric

Thank you so much!
I didnt make a big map, it was only 10x10 so i dont mind recreating it, it was made purely for the purpose of learning/getting to grips to it.
I currently just did box colliders 2d over the walls, im sure thats not the more efficient way of doing it, but im assuming thats all it is, make map> import map> set colliders so sprites know what is a wall?

Eric5h5,

do you have the code or idea how unity saves its collider data I’ve been wanting to put this in my Map Editor for a while I know it’s XAML code but I’ve not created any project in it before, I’m usually a winforms developer.