How do I Resize Images Like Construct Editor Does?

Get help using Construct 2

Post » Fri May 15, 2015 9:12 pm

In the Construct editor you can reduce a sprite's size a lot and it doesn't loose quality, which is amazing!

I did this with a lot of sprites and decorated an entire layer that im using as a background, so i have small trees here and there and small bushes and hills and what not but the issue is that all these re-sized sprites are making the game's fps drop so i need to convert the layer i've decorated with sprites to a single image so that all those sprites dont take so much temporary memory

Problem is, when i go to photoshop and re-size the images, for example the trees, and make them smaller (like i did with the sprites on Construct's editor) the images loose resolution/quality and everything becomes awful.. plain ugly!


Do you guys know a work around to this issue? I thought about doing everything with this ugly new look and then adding a blur to the background so that it wouldnt be noticeable but then the final result wont be as good looking as the one before and that's a real bummer :/
B
5
Posts: 48
Reputation: 319

Post » Fri May 15, 2015 11:47 pm

what resolution size are the game sprites being imported from photoshop ?
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Sat May 16, 2015 9:01 am

The sprites are not high resolution, they are like 800x300
B
5
Posts: 48
Reputation: 319

Post » Sat May 16, 2015 11:06 am

zhroguexe wrote:all these re-sized sprites are making the game's fps drop

This is doubtful - modern GPUs are so good at rendering that they can often render resized sprites just as fast as non-resized sprites. What measurements have you made that indicate this and are you certain it's not something else?

i need to convert the layer i've decorated with sprites to a single image

This is not necessarily better or even faster - see remember not to waste your memory
Scirra Founder
B
397
S
236
G
88
Posts: 24,422
Reputation: 194,558

Post » Sat May 16, 2015 11:56 am

thanks for the reply

Well, i read the link you posted and it did say some interesting things (about mobile's having about 100mbs to work with and that's why you should use few background images to make a good looking background) and that's basically what i've done for my backgrounds!

I have 1 sprie for the grass, 1 sprite for the fog, 3 cloud sprites, 1 hill sprite, 1 distance hill sprite. 1 tree and 1 bush

Total sprites that are making the background: 9 (which are repeated)
If we count the other layers' sprites theres about 10/20 more at max 22!


I was under the impression that having all those sprites in 1 image would solve the issue but you said that that wasn't an issue so im stunned, what should i do to solve these "fps drops" that my friends experience on their phones from time to time?

I dont mean that it's an awful fps drop i mean that they get a second or half of a second of Fps drop here and there :/
B
5
Posts: 48
Reputation: 319

Post » Thu May 28, 2015 3:48 am

@zhroguexe I would check your collision masks, maybe your sprites have too many collision points.

800 x 300 is probably why your experience fps drops , remove it & try playing the game on mobile .

Since you mentioned "Total sprites that are making the background: 9 (which are repeated)" - If the fps still drops try making sure that sprites are being properly managed when off-screen i.e if you have to delete them then do that or if they "loop" (like in flappy birds &/or doodle jump) make sure its looping properly.
[Looping is always better for performance oppose to creating/destroying sprites that are repeatedly used in the layout]

I'm sure you already know this but make sure your game's resolution is 16:9 ( For best support across multiple screen size ) - https://www.scirra.com/tutorials/73/sup ... reen-sizes
- You may have to research your hardware's resolution specs

Suggestion for Debugging:

Try stripping down your game.
Remove everything & disable events that don't have to do with the core functionality of the player

Also : "Every Tick" events consume a lot of memory thus could have a negative impact on your game's performance
Also : Try disabling collision for the background sprites unless you explicitly need collision detection for them
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Thu May 28, 2015 12:38 pm

@EyezWidee Hey man thanks for the reply!

What i've done is I disabled all the collision checks that were not needed (and there were a lot!) and i've also added an option (in the settings) for the user to disable the graphics (so if its set to disabled the layer with all the details is set to invisible).

What im interested in is the 16:9 resolution thing... i've set my game settings to have the window size of 864, 486 because that's what my phone uses and i've noticed that on some devices the screen cuts off so i think i'm not using 16:9

For this reason i wanted to ask: How should i set up the project for a 16:9 resolution? Also i've been using the "Scale Inner" and i read that it should be Letterbox Scale.. what's the difference? (also which is better for mobile?)


Thanks for the replies anyway!

P.s. i Already posted this somewhere else but to boost performance i've also:
Lowered code lines and removed unused variables, used Minify Script and also removed the millions of unused sprites in the Objects folder... so far so good! (could be better tho :p)
B
5
Posts: 48
Reputation: 319

Post » Thu May 28, 2015 12:45 pm

Have you checked your game using the debug-layout mode?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 28, 2015 2:13 pm

@littlestain Hey there man yes i have, just now infact :)

why?
B
5
Posts: 48
Reputation: 319

Post » Thu May 28, 2015 3:15 pm

I asked because sometimes sprites are duplicated unexpectedly and/or some other aspects of your game/events show up that take a great amount of processing power, that could affect the fps..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, ST314, TheRealDannyyy, tunepunk and 34 guests