How do I Resize Images Like Construct Editor Does?

0 favourites
  • 12 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • 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 :/

  • what resolution size are the game sprites being imported from photoshop ?

  • The sprites are not high resolution, they are like 800x300

  • 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?

    [quote:kyfru9h8]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

  • 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 :/

  • 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

  • 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)

  • Have you checked your game using the debug-layout mode?

  • LittleStain Hey there man yes i have, just now infact

    why?

  • 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 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..

    And how would you go on about seeing if this happens or not.. i mean what should you look for?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • zhroguexe

    Check out : list of true 16:9 resolutions : https://pacoup.com/2011/06/12/list-of-t ... solutions/

    To set up your project for 16:9 just adjust your window size (I usually go with 1280x720 for landscape & 720x1280 for portrait since it has great universal display across other devices) or (Tablets : 1920x1080 landscape / 1080x1920 portrait)

    Correct it would be display better if you use Letterbox Scale oppose to Scale inner. The difference has to do with scaling your viewport. Scale Inner should only really be used if your using Ludei's CocoonJS.

    If you add the Browser object to your project you'll be able to access it in your event sheet.

    Try this : On start of layout - Set fullscreen "Letterbox Scale" (Browser)

    That should make your game fullscreen on your device and scaled to letterbox.

    btw minify script won't really boost performance in some cases it might break your game depending if your using cordova or not to export.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)