Sprite and Texture size

I’m handling porting a game to the Switch, and one thing I need to do is reduce the size of the game.

Since it’s a 2D games, it mostly involved sizing down texture. But for some reason, a majority of the texture on this game are non-power of 2. And they are all sprite.

So, if I force using to clamp the max texture size, I usually lose the DXT5 compression, as it needs multiple of 4.
If change the texture size in Photoshop, the sprite position get all messed up. For some reason their position is not in %, but in pixels (who had that brilliant idea?)

So… How do I reduce all those texture without having to recreating thousand of sprite boxes??

Before the solution, I would like to know the reason behind why all sprites are NPOT.

Eh… Nope. Never happen to me before if you fully understanding the canvas concept.

Not quite understand this sentence. I assume you didn’t use canvas at all?

  1. No clue. Not our project. We are just porting it.

  2. They use atlas. A texture in multi-sprite. The sprite position on the texture are in pixels, not in %. Changing the texture size, doesn’t update the sprite position.

  3. No clue what canvas has to do with the texture importer?

They are using a hand-made atlas sprite sheet instead of Unity packing tag generated one? Haha. I can feel the problem now. You can try to turn off mip-maps to save some space. This is the only quick way I can think of. Or, you really need to re-do everything already. Make them standalone and setup packing tags and let Unity automatically pack for you on build so that you can easily adjust texture size anytime.

Can you show some screenshot to demonstrate the problem? I’m still worrying maybe I misunderstand something.

Mipmaps are already off.

And no, because of NDA cannot show anything.

One option you can try (no idea if this really works) is to create a Sprite Atlas asset and add all the loose sprites to the Sprite Atlas, which is just a drag&drop operation really. Then, you’re hopefully able to use the Sprite Atlas MaxSize setting to change the entire atlas size without affecting sprite boxes.

Depending on the Sprite Packer Settings, Unity will then use sprites from the atlas. The atlas that Unity generates is square and power-of-two, on platforms where this is required.

Wouldn’t that require me to set back all the sprite in all the game?

If you mean to replace every reference to those Sprites now with the SpriteAtlas, then no. If you just drag&drop all the individual Sprites in that SpriteAtlas asset, all the references to those individual sprites are magically detoured to the SpriteAtlas (at runtime). If you delete the SpriteAtlas asset, Unity uses the individual Sprites again. It’s magic.

Sounded so good! It would have been auto-magic if for not a small flaw…

They somehow made multiple similar sprite. For example, if a character keeps the same pose for many frame, the tool they use create many sprite at exactly the same place.

SpriteAtlas doesn’t appear to be bright enough to figure that out. So instead of 1 texture, the SpriteAtlas generates dozen filled with similar bitmap.