Tested 100% work! improve Game/scene loading time method

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
Hello all
I wanted to share my findings for a test i made on improving loading times of the game, and for the scenes in your game.

**This method is not for EVERY project** Youll see what i mean later on

So first let me tell you this test was made on a heavily graphic project , and i managed to reduce the game loading time from 9.6 to 5.9 seconds! (yes i use a timer) now this may not seem a lot for everyone but trust me its huge!
Im going to implant it to another project i have and try to make a 2.5-3 second game loading time (i must mention im a pro user so no GS splash in all of this tests)

So lets go to the interesting part , how to get it done

Here is what i do:

i have lots of actors that the player dont see in the first look at the scene (cause maybe they are off screen or their alpha is 0 at initial boot or any other reason)

*in my project i have an image which is a simple 2x2 pixels white square. ( waist 1 more min of your life in photoshop to make it ;) )

thoes actors are already sized and placed in the scene , but the image i give them is this tiny square that almost dont take RAM , cause there is no need to load their original (big) image at the first boot.

Now at some point the player will have to see those actors , and we dont want him to see white squares right ,
so we need to apply those actors their graphics :

instead of giving each and every one of this actors a rule to change their images to their actual graphics ,(which will be lots of rules cause maybe you have lots of "off screen"/"invisible" actors) i have 1 manager actor that have 1 rule and make the change for them! like so:
image

Note that the manager actor must be an instance - NOT prototype in order to access this attributes

i have this rule in my manager actor :

When SELF.time > 1 (or any other trigger you like)
change Current scene>Layers>"Your LAYER">"Your actor">Image to the disairable image (for example - "manu-button.png")

Thats it , so basically what we are doing is loading the game fast , letting the "player" see the initial boot ,
and THEN loading the rest of the images in that scene.

*sure there are lots of other way to improve loading time , this method is not a replacement but another extra

i hope this will be useful for some of you ;)

Roy.

If you liked it press ----> | LIKE |

:P

Comments

  • YouKnowMeYouKnowMe Member Posts: 74
    Great post, ill keep it in mind. Thank you!!
  • apps4everyoneapps4everyone Member Posts: 103
    Very useful - I'll be incorporating this into all the games I can.

    Good work.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Great find Roy!!!

    Darren.

    image
  • YouKnowMeYouKnowMe Member Posts: 74
    Quick question: why is the photoshop 2x2 white squire 41kb while the illustrator 2x2 white squire is 4kb?
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    nice find and test p-o-m thanks for sharing...

    at YouKnowMe, the file you save needs to be a png....and I guess an 8 bit one would be best. (File/Save For Web in photoshop or illustrator.

    I imagine you are getting the files sizes as one is psd from photoshop and the other is a vector from illustrator... or I could be completely wrong. :-)
  • DizkoDizko Member Posts: 498
    Does this not bog down performance at all, at least initially while you're loading in the proper images after the scene starts? Does the frame rate drop at all since suddenly the frame buffer has to add new images to RAM while also rendering frames?
  • GamersRejoiceGamersRejoice Member Posts: 817
    I'm definitely going to try this one on my next game.
  • POMPOM Member Posts: 2,599
    Thanks guys , im happy you like it.
    If you use this method post the results!

    Roy.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    Just bumping for peoples interest.
  • expired_012expired_012 Member Posts: 1,802
    Would it be better to use a small 2x2 image as the initial graphic or the rectangle actor that gs provides you with?
Sign In or Register to comment.