playMaker

Author Topic: How to Reload same Scene in the Background? (Seamless scene changes)  (Read 2020 times)

Kathar

  • Playmaker Newbie
  • *
  • Posts: 48
Hi! So maybe a bit of an odd one. Basically when my player dies, I want to instantly start reloading the current level in the background, so once the death sequence is all played out (a few second process), then I can instantly 'restart' the level seamlessly without any visible loading screens (or at least reduce the loading time as much as possible).

I'm using Load Scene Async, and this all works fine if I try and load a different scene (I.e. current scene is Scene 1, and I load Scene 2) but if I try and load the same scene, the Action just fails, prompting the Scene Not Found Event (but is definitely in the Build Settings list). I can only guess that as the scene is already loaded/active, the Action doesn't think it needs to load it again in the background or something. So I'm not sure how to get around this.

Trouble is, I cant just load the level non-asynchronously, as I need to make sure the death sequence is finished before I allow it to swap to the reloaded scene. I could of course wait until the death sequence is all played out and then just load the level normally, but I want to avoid loading time/screens as much as I can.

Probably missing something obvious, so any help really appreciated! Thank you!

GonerGames

  • Junior Playmaker
  • **
  • Posts: 53
Re: How to Reload same Scene in the Background? (Seamless scene changes)
« Reply #1 on: June 17, 2018, 08:38:15 PM »
You could make your death a different scene and then have your main game start loading in the background and switch back. If it is only a summary screen the transition time would be seamless.
Main scene -> player dies -> switch to death scene (summary screen) -> load main async in background -> load  back to main game.

If you knew the average loading time you could purposely slow down your summary screen info. IE text that appears line by line, fly's in from the side. Things like that. This way the gamer doesn't really realize how much time has passed. 

Just a suggestion to get the ideas going.

Kathar

  • Playmaker Newbie
  • *
  • Posts: 48
Re: How to Reload same Scene in the Background? (Seamless scene changes)
« Reply #2 on: June 21, 2018, 06:37:01 PM »
Thanks a lot for your help Goner :) Trouble is my death sequence is essentially a ragdoll-sequence of the player character dying, and then I essentially do a slow camera transition/fade of a black circle shrinking in (ala Looney Tunes!). The idea was that the black circle would shrink in fully, to black, then grow back out again to reveal a completely restarted level.

Not had any further luck with it so far though, so may have to just change the sequence and do something more akin to what you suggested - thanks for your help! :)

GonerGames

  • Junior Playmaker
  • **
  • Posts: 53
Re: How to Reload same Scene in the Background? (Seamless scene changes)
« Reply #3 on: June 21, 2018, 10:42:27 PM »
Sounds like and awesome death scene :)

I'm not sure how your player/game is setup, but you could do a reset of your variables and then once the screen goes black do a set position back to the beginning. This could be called through a Broadcast All "Reset" Event tied to the FSMs that need to be set back to zero/default values.

Another option, you can duplicate your playing scene so once you are done in playing_scene1 you can async load playing_scene2 during the death animation and load into playing_scene2. Then you can just keep switching back and forth between the two.

Food for thought.


Kathar

  • Playmaker Newbie
  • *
  • Posts: 48
Re: How to Reload same Scene in the Background? (Seamless scene changes)
« Reply #4 on: June 24, 2018, 05:32:15 PM »
Really smart ideas! Thanks Goner! Both could work really well... I'll have a play with these, cheers! :)