Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Changing levels speed and responsiveness
  • Hi Lavon and Happy 2015!!
    I have 2 levels and buttons to change levels on mouseDown event. The two levels have a couple of spine animations and not really much more.
    When I hit the button to change level from 0 to 1, the game goes white (while it loads I guess) and then...85% of the time loads the same level and 15% works and loads next level. I'm using the "Change to:next level" and "Force unload". If I uncheck "force unload" nothing happens, and if i do double clicks instead of single, I get it working right most of the time.
    What can be wrong?
  • 5 Comments sorted by
  • I've recorded my phone to show you what happens when I hit the button with the change level behaviour:
  • @kikubu happy new year to you as well! Yes, changing levels w/ "Force unload" clears the entire current level from memory and loads the new level into memory which does take a bit of time. So the best way to handle this is to use a common stage background color between all your levels or add a custom level switching screen to your custom code base layer which I could help you to write. This screen would always remain in memory and show some custom loading message or something and then hide itself once the new level has completed loading. In the new version of GBs v0.9.8 we added the ability for a level to know which resources it is dependent on so that it doesn't fire a loading event until all those resources are available which is a more accurate level load complete.

    The only other alternative would be to build everything within one level and use different scene layers that can be moved off stage until you want to show it.

    Changing level without forcing unload checks the next level for common objects with the same name and does not unload them but only loads in new objects from the next level being loaded. This is not fully functional currently because when GBs exports all objects it groups them with the same name so when you try to change levels without forcing unload nothing happens because it sees the same object names in the new level file. We are trying to plan out how we will handle this feature so that we don't break existing games.
  • OK, I see how the transition between satages can be minimized but how do I fix the  responsivenes issue, when I use the "change levek" action on a mouse down event, it works 2 or so times out of 10.

    Now I'm not very sure on how to aproach the changing levels problem. The best way would be just to show a "loading" screen. I'm very interested on this subject.
  • @kikubu let me write a loading screen for you to display an image between level switching which you can include in your project. It will be very easy to just drop the file in your custom code base folder. 

    The responsiveness issue should not be there. Can you send a link to your project zipped up so we can debug what the issue is? Or maybe first record a screen video of it happening. Also if there is any error messages in the console when it slows down send those over as well.
  • Thank you very much for the loading screen, it really is very needed. How will I customize the loading screen? As for the responsiveness, it works quite well right now, so it was my fault probably. Next time I'll check better and avoid rushing in panic to write on the forums

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion