GS Mythbusters? White Square Image loading optimisation

2»

Comments

  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    StuartY said:
    Mago, use change attribute self.image to WHATEVER.png

    thanks Dude!
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    StuartY said:
    Mago, use change attribute self.image to WHATEVER.png

    thanks Dude!
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    And How Can I Remove an Image of an Actor?
    OR I just add a new ultra small image?
  • StuartYStuartY Member Posts: 134
    Mago, I think this strategy works;
    LudwigHeijden said:
    About having to build your game in white squares.

    What if you build the game with an image in the actor and then before publishing throw them out. The actors will turn white again but no problem there because the .self trick is in it. My suggestion is to use a different name than the one in the .self trick ore you will get blanks there when the images are thrown out.
    For example make a copy of each image and call them image.png and XXXimageXXX.png
    The XXXimageXXX.png will be the one you throw out.

    I just did a test and this works fine ;)

    A small image might work also.
  • PhoticsPhotics Member Posts: 4,172
    You can also edit the XML of the actor and remove the "image" part.

    You might want to make a back-up copy of your project before you mess with the XML.
  • LumpAppsLumpApps Member Posts: 2,881
    Hi,

    I have been trying to work with the white actor trick but somehow it didn't improve loading times.
    In Penny Shoel I have a scene with 30 of the same pucks with lots of rules and the loading time of this scene was about 7 or 8 seconds. (21, 22, 23 method ;)
    The white actor thing did close to nothing.

    What did work though was having another actor spawn the 30 pucks on scene start. (using a rule, a timer and an attribute to count down from 30 to zero).
    The results are amazing.
    Loading times are 3 to 4 seconds! That is half the time!!!!

    So instead of the white image you could also determine the exact spot where actors should be on the scene and have one actor spawn them all. I realize this is hard to work with because you would have a scene with one actor spawning them all but in some cases this might be doable.

    Please let me know if this works when you try it.

    Cheers!
  • PhoticsPhotics Member Posts: 4,172
    Spawning too many actors at once can cause bad lag.
  • LumpAppsLumpApps Member Posts: 2,881
    Yes but on startup it doesn't really matter does it? I see nothing happening. But the pucks spawn of screen and called on screen one by one when the player is playing.
  • MichaelRandoMichaelRando Member Posts: 16
    Well, in my mind, you guys should definitely not do this. Circumventing the scene's asset loading to load an image at time of request will make it very hard for a game built this way to benefit from any future performance improvements to asset loading.

    And trouble mapping asset names and extension also happens that we've along the lines of: 'mybitmap' vs 'mybitmap.png' vs 'mybitmap.jpg/dvr' etc.
  • PhoticsPhotics Member Posts: 4,172
    MichaelRando said:
    Well, in my mind, you guys should definitely not do this.

    I don't see much of an alternative. If GameSalad improves scene loading times, I can easily switch my game back to the traditional method of image loading.

    The first post on page six of the BOT game progress thread shows how I view this issue...
    http://gamesalad.com/forums/topic.php?id=15896&page=6

    I reduced the loading times by 25%-50% with this method. If BOT is played by 100,000 people, that's like saving one life every 140 days.
  • GamersRejoiceGamersRejoice Member Posts: 817
    Photics said:
    I don't see much of an alternative. If GameSalad improves scene loading times, I can easily switch my game back to the traditional method of image loading.

    The first post on page six of the BOT game progress thread shows how I view this issue...
    http://gamesalad.com/forums/topic.php?id=15896&page=6

    I reduced the loading times by 25%-50% with this method. If BOT is played by 100,000 people, that's like saving one life every 140 days.

    The problem with saying that "it's like saving one life every 140 days" is that you are ignoring the opposite statistic. Which is how many people you are killing every 140 days they play your game. If 100,000 people are playing BOT than how many people would you be killing? :) lol
  • PhoticsPhotics Member Posts: 4,172
    GamersRejoice said:
    If 100,000 people are playing BOT than how many people would you be killing? :) lol

    I've thought a lot about this issue.

    EverQuest, Guild Wars, World of Warcraft... these games have loading times when you change zones. Some of them can be really long loading times. In Guild Wars, if you had to download new files, it could take a while to load a map. In World of Warcraft, there were wait queues.

    Unfortunately in life, there are lines... like sitting in traffic, waiting at the DMV. Fortunately, it's not murder to make players wait.

    But even though loading times are common in MMORPGs — and even though waiting is a part of life — I still know that it can hurt the reviews of my app. The single biggest weakness of my game is the length of loading times. It's like 2-3 seconds on an iPhone 4... and like 3-6 seconds on an iPod Touch (Second Generation). The player will likely change scenes every 30 seconds... so that's like 5-10% of the game just waiting.

    There's seemingly no loading times on the Mac, so I'm planning to release a Mac desktop version of BOT — for those that hate waiting.
  • LumpAppsLumpApps Member Posts: 2,881
    MichaelRando said:
    Well, in my mind, you guys should definitely not do this. Circumventing the scene's asset loading to load an image at time of request will make it very hard for a game built this way to benefit from any future performance improvements to asset loading.
    And trouble mapping asset names and extension also happens that we've along the lines of: 'mybitmap' vs 'mybitmap.png' vs 'mybitmap.jpg/dvr' etc.

    That is something to consider indeed. In my case on the other hand I just have to change 2 lines in 2 actors so it will not be such a problem. Thanks for your concern.

    Phonics: the lag is an issue at the moment the scene starts afer all. For a second (when the actors are spawning I get some lag. I added a nice loading bar to resolve this, which may sound stupid but the total loading time is still seconds shorter than it was so it helps.

    There is no killing in my game so I just safe lives ;)
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    How can you make this with an Image with Animate? How Can you Not use Animate (Because animate pre loads image) and use Change image and other Rules to Animate?
  • PhoticsPhotics Member Posts: 4,172
    You could use constrain and the self.image attribute.

    Constrain self.image to...

    "picture-name"..(game.time*60)%10..".png"
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    Photics said:
    You could use constrain and the self.image attribute.

    Constrain self.image to...

    "picture-name"..(game.time*60)%10..".png"

    Thanks, and that code will animate with how many FPS?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    @MagoNicolas: I have an animation controller demo under my profile that you can dig through:
    It does not use the animation behavior or Constrains to set the image.

    http://gamesalad.com/game/3158
  • AppsRacKAppsRacK Member Posts: 346
    Well to add some info regarding this myth i'll share some of my experiences.

    When the 0.93 came out i decided to redo the project which is like 35% done already to the latest version to make some adjustment and make it more optimized using the self.image trick. Here's what i found out, if you have few small images on the screen like 1024x512 or 512x512 it wont make a difference and at worse it will make your loading time longer because of the white part being shown first before the images are loaded. Using the self.image trick the loading time i got when changing scenes from one level to another is about 3 secs and that includes the white part being shown. When i use self image behavior without timer it only loads about 2 secs and without the white part. so i ended up using the self image behavior.

    I base this on the current project im working right now which has 2-1024x512, 2-1024x256, 1-512,512 & a couple of small images under 128x128. RI is set to ON.

    -drahc
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    firemaplegames said:
    @MagoNicolas: I have an animation controller demo under my profile that you can dig through:
    It does not use the animation behavior or Constrains to set the image.

    http://gamesalad.com/game/3158

    thanks dude! Will see it in a sEc.
    It is with Change Attbiute right?

    If So, I have just make a test, It those solve ram problem, but when the image comes to game, the games Lag a lot :(

    Will download it now.

    Cheers.
  • DizkoDizko Member Posts: 498
    I've worked with game engines for many years now and loading times is always bottlenecked by mostly texture loading. There's not much you can do about this.

    My advice to you guys, would simply be optimizing your images as best as possible, recycle what you can. The smaller the file size, the less you use, the faster it loads. Just be glad we don't have to worry about things like mip-map pyramids and LODs.
  • DizkoDizko Member Posts: 498
    Also, I would suggest that if you insist on using this method, to at least use a very downsampled version of the image you're replacing. That way it at least appears to have the right image on there and then it suddenly becomes crisper. It wouldn't look all that much different than what the CryEngine 3 does, as they load up the lowest level mip-mip texture and swap it out once you're in game, I think Unreal 3 uses a similar technique.
Sign In or Register to comment.