[Solved] Better to scale sprites down, or have more than one version of each?

Hello. In my game I have two versions of my player character. When he’s indoors, he’s about 500 pixels tall. When in outdoor scenes he’s 260 tall. Both have the same amount of animation frames. My question is whether it’s better, in terms of filesize on disk vs performance of the game, to (1) Have more than one version of a spite object for each character that is required to be indoor and outdoor or (2) scale the largest versions down for outdoor scenes.

My concern is the size of the game on disk verses how hard the engine is having to work on scaling my character constantly. Is scaling characters a demanding thing for the engine to do and will I be courting trouble if I build my game around it? I think it’s unlikely I’ll ever have more than 4 scaled-down characters in any outdoor scene. Thanks for any advice.

I am assuming being indoors is not your core game mechanics
Cause if it would you would have higher res player and scale him down
Not other way around

So with that in mind that being indoors is just some part of your game
And not main focus of it
It is like worry about shoving in a lot effects on result screen
It can lag it is not handling other demanding logic
So it can be spammed with demanding stuff

And this is for your concern is scaling demanding for your game
Even if it is looking at what i wrote above you should not care and allow it

As for if its actually demanding
I can’t list how many of us scale UI or whole Menus
Enemies and other stuff
And no one is complaining
So i would assume scaling itself is not demanding task

As for scale or have 2 separate image sets for player
SCALE
I found ultra rare case scenarios where i would wish or need to have more than one of same set of animation for my object
And having resized sprite object based on its image is NOT one of them
Scale scale and don’t care

1 Like

GDevelop uses Pixi for 2D rendering. Pixi has 2 modes: linear (bilinear I guess) or nearest.

Bilinear scaling is very fast and probably done by the GPU, but the result is usually blurry when scaling up and thin lines can be too crispy when scaling down.

If you think the result look good enough, scaling is not an issue for efficiency.

1 Like

Thank you very much, Davy.

Thank you, ZeroX4, for your input.

The engine already creates smaller versions of textures. They are called mipmaps.

For maximum performance, use textures with power-of-two dimensions (32, 64,128,256, etc px) and scale the render the same way when zooming out (50,25, 12.5 etc % ).

The game is 2D. I should have specified. Thanks for your input, but I have the info I need now.

2d or 3d makes no difference fyi.

In that case, I don’t fully understand. My game is using spite objects with art created as PNGs of arbitrary sizes (the large character in the screenshot is 460 px tall). Been using GDevelop for a couple of years but I haven’t encountered anything about mipmaps or keeping to power-of-two for max performance, or sprite object graphics referred to as textures. That’s all new lingo to me that I haven’t seen in the Wiki or any of my GDevelop YouTube travels. Do you have a link to any further information on that? Thanks.

This is about how graphics rendering works in general and is not specific to gdev.

You can research mipmaps and power of two textures.

1 Like

There is no mip map generation support in the PIxiJS version used by GDevelop, at least not for 2D assets. so I’m not sure what you are referring to.

I think mipmap generation was only added in a late version of Pixijs 7, which isn’t used in GD5 currently.

1 Like

from your ss looks great

1 Like