Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

PowerQuest

A Nifty 2D Adventure Toolkit for Unity · By Powerhoof

Scale sprite/characters?

A topic by EmanueleK created Nov 04, 2023 Views: 173 Replies: 4
Viewing posts 1 to 2

Hi, first thing first: thank you for powerquest, it's an incredible tool.

I was wondering what's the process for scaling sprite /characters. Is the only option to create a smaller source file (i'm using the aseprite import pipeline) since scaling down the prefab is useless? (I've come to understand that everything done in the prefab is overridden animation-wise by the framework, like when placing manually characters prefab in a room gets ignored)

You can use the scale property of Regions. You add them in the Room tab, define where you want them to be in the scene and then in the Inspector you set Scale top and Scale bottom to the values you like — this will gradually change the scale from one value to the other as your characters pass through the region. So if you need a room where characters are always seen from far away, you just create a region that covers the whole room and set both scale values to the value you need. 

Right, that could work in rooms where I already haven't set a region to scale based on height (as intended). 

Talking about that, to avoid making another thread, I was wondering if there's documentation on how the scaling work, because I have rooms with very different perspectives and I my original plan I intended to use (and maybe abuse) the scaling regions while keeping a single sprite with fixed sizes, but I'm seeing more and more that the scaling is a bit unpredictable and the sprites get deformed in so many different ways, which is fine for very small downscale (like in distance), but a bit less convincing when I need just a little scale down up close. I wonder if anyone was ever in my situation and how it was tackled, maybe create the same sprite at a small subset of sizes?

I don't think there's any in-depth documentation on how scaling works per se, but just from PQ code it simply scales the character's transform by the value calculated from the position in the current region, and then the pixel-perfect camera effectively applies the "nearest neighbour" interpolation to the result. So the unpredictable result at lower scales is sorta expected.

Don't think there are built-in solutions for your case. And in case of overlapping scale regions, it looks like instead of combining the scales, it uses the values from one of them, which is not really useful.

I'd recommend joining the Discord server and asking in the general chat or creating a topic, the discussion over there is much more active

Is this for pixel art? Generally this is solved for pixel art games simply by designing them so that you dont have to scale characters. It's something I learned early making games with AGS, that scaling pixel art never looks great. So now I always avoid scaling up, prefering to shrink down the room instead as a cut-away.  And I tend to do room art with the character in them so I can avoid too much scaling down too.

For hi-res games, you also have scale control on the sprite importer, so that might be what you're looking for.

For the other scaling issues, it's hard to know what you mean without screenshots/vid maybe?