I studied game development years ago and I’m trying to get back to it in the form of a 2D top down adventure game, however I can’t find a proper answer to the following question.
My (terrain) atlas size is 2048x2048 in an 8x8 grid (64 tiles, 256x256 each tile) and I heavily underestimated how many tiles I’ll need as I’ve almost filled all 64 tiles and this is only for 1 out of at least 6 different environments I have in mind.
I’d like to support maximum resolution (4K, 3840x2160) so I don’t think reducing the tile size to something like 128px will work in my favor, so my questions are the following:
From what I’ve read, it’s adviced that an atlas doesn’t go over 4096x4096 resolution. Is this true? If so, is it okay for me to have 3 atlases of that size for all the terrains I have planned and then a bunch of other atlases for decorations, units, items, etc.? Is that the normal? Is 256px tiles a good resolution, too small or too much?
I may possibly want to bring this game to mobile later. What things should I have in consideration to make my life easier in the future if I do decide to port it to mobile when it comes to art and atlases?
The advice to not go over 4096x4096 stems from mobile development. Most older devices cannot handle texture sizes larger than that, some really old devices 2048 is the max. If the game is only destined for PC/MAC than you can go over that without worry. Having multiple atlases is very common so don’t worry about that too much.
256 is on the large size for tiles, but if you want lots of detail in those tiles you can go that route. Sometimes though having more layers for your tile map to add the details on top of the base tiles (grass, stone, dirt, etc.) is a more efficient way to do it. Half or even a quarter the size for tiles may do just fine and allow you to add a good amount of detail with a detail layer or two.
For mobile you might want to look into SpriteAtlas variants to use smaller resolution textures on older hardware that cannot support 4096+.
Terraria did nothing to their sprites when introducing 4K support, it was all about changing how it scaled to higher resolutions so you wouldn’t see so much of the map. Using aspect ratio is a better way to scale and is how Unity does it out of the box. 4K is still 16:9 so its a pretty linear scale up from 2k(1080.) If you really want that extra detail you need to trade that off for build size and maybe performance. Remember SD to HD was a huge difference while HD to UHD not as much, you will get diminishing returns with higher resolutions.
sprite atlas has pagination, so it will start creating extra pages for you if your sprites dont fit on the 2048x2048 space
having a lot of sprite atlas will increase the ram your game demands while running, thats what you have to keep in mind in this scope if you want to port to mobile. If it becomes too burdensome you will have to start looking into loading and unloading atlases, so that you only load the atlases that have tiles that are currently on screen.
Thank you very much for the replies!
Specially Chris, very detailed reply, thank you a lot. One last question: as you said 256px is on the larger side of tile sizes, what size would be more standard? I do want some detail but nothing over-the-top so maybe I can use a smaller size. 128px maybe?
As a rough estimate I expect to have around 20x12 tiles (240 tiles) on the camera.
256 might be more suited to 4K I’m not sure, I have not done any development for it. Something you need to take into account, how many people have a 4K monitor and are going to benefit from that? Is it worth the increased build size? Mobile is another ball game, there is more than just build size and texture size involved with developing for android. iOS not as much due to there being a fraction of the devices available, 24,000 android devices compared to 42 iOS devices.