r/Unity3D•
cessern

Is it better to use one big picture or lots of small ones?

Question

I'm creating a tile editor. Just wondering what you guys think of how I should create my tiles. Lots of small ones may lag unity because of how many object created, but its easier to organize.

Posted Jan 12, 2016, 1:39 PM UTC

17
ThatAblazeExpert•

The most efficient way to do it would be to put all your tiles on one texture and use the tiling and offset fields in the material to only draw a small piece of that texture on each individual tile.

All textures should be a power of two (i.e. 128x256 or 512x64 etc) so they fit cleanly into the video card buffers.

2
darkon76•

you can use the unity sprite packer.

When you import the sprite set the same "Packing Tag".

After you run the game. go to window=>Sprite Packer to see the magic.

Most of the time it will be batched in one draw call if marked static.

2
wstdsgn•

As long as you're prototyping, you should favour simplicity and flexibility (=small tiles) over performance.

If you happen to run into performance issues at some point, you can still find a solution, like decreasing the view distance, batching groups of game objects etc.

Don't worry about performance!

PS: how many tiles are we talking about? And whats your target platform?

1
cessernOP•

I'm trying to recreate RPG maker in unity. I guess editing maps will be pc platform, while the gameplay can be any. The amount of tiles we're talking about is the amount of tiles you'll want in a game/map.

1
wstdsgn•

Ok, I see. Well, I'm not an expert, so don't take my words for facts, but I dont think its a problem. A tile is just 2 triangles, so you shouldn't run into problems concerning the complexity of your meshes.

AFAIK having a lot of different materials (=draw calls) in your scene is one of the biggest performance killers, so you should be fine if you combine all of your textures into one single atlas/material.

http://docs.unity3d.com/Manual/DrawCallBatching.html

But again ... as long as you're prototyping, don't spend too much time thinking about performance. Just follow your goal as straight as possible and see where you get!

2
cessernOP•

It is correct to use sprite renderer right? I'm really new to how to reduce lags and such.

1
ThatAblazeExpert•

Only use the sprite renderer if you know that you are never going to look at the tile at an angle.

1