- Home /
Help with reloading scene for endless runner
I have an endless running game with the traditional set up. Game starts, pans into Player, you press something on the screen to start the game. Now, I'm making the menu and was wondering what the usual practice is for this kind of game when you want to return back to the initial 'Title area' again (Eg. Subway Surfer spray-painting the train). The most intuitive thing seems to be to simply use a single scene for the game and then just restart it.
I was wondering if I could get some thoughts on whether this sounds like the way to go or not.
Thanks
You could reposition everything back into place , but reloading the scene seems like the way in this case.
I typically use a separate scene just for the main menu, primarily to give the chance for low end computers to lower the graphics settings before loading the bulk of the game. But I would assume that a free run game with a single scene would just reset the character and all the variables rather than reloading the game
Adding to what Ben Jarrell wrote (and he deserves credit for his answer, so I hope he posts it as an answer), I do the same for desktop games. But if you're targeting mobile, consider integrating the main menu into the game itself, so there's no main menu and you can start playing right away.
Brandon Sheffield's column in this month's Game Developer (http://gdmag.com/blog/2013/04/simple-beauty.php) makes a good argument for this. Look under the section "Start the game = play the game".
Thanks for the suggestions.
I think a separate scene would definitely make things simpler as it doesn't require any management of objects/variables, etc. Having said that, the game starts in a similar way to Temple Run/Subway Surfer(with the camera always looking at the Player) so masking the scene change could be tricky. $$anonymous$$aybe there's a power cut!? :D
I agree with Ben's idea about giving the user a chance to change the settings before the game begins, that's a definite advantage of having an initial scene.
TonyLi, it is a mobile game so that was my thinking too, get the Player straight into the action.
I'll have a try at both methods and report back.
Thanks again.
Answer by rutter · May 17, 2013 at 01:25 AM
Reloading a scene is probably the least developer work by far, but if your load times are long it's going to degrade the user experience significantly.
Imagine if your game could restart in less than 100ms.
If you're using object pools to manage your map objects, you can simply return all deployed objects to their pools (presumably this gets them out of sight), re-initialize the startup area as needed (move camera, re-spawn a few things, trigger animations and UI), and go from there. Your map generation is hopefully quick and cheap enough that generating a bit of map to start from isn't a problem, or you can rely on a prefab to get that ball rolling.
If you're not using pools, we've probably already thrown performance out of the window. ;)
The above suggestion is going to be much easier to implement if you can separate those parts of your startup routine from Awake() and Start(), such that they can be called from those functions, but are not contained within them.
Reloading the scene seem to work best for this scenario so am accepting Rutter's answer on this occasion.
Thanks for all the suggestions, they were great in helping me weigh up the pros and cons for this situation.
Answer by randomuser · May 16, 2013 at 11:53 PM
It would be easiest to have a separate scene for the main menu. You can use some fancy camera effects to hide the scene transition. This makes programming the game much more sane than moving the scene around to get to different parts. It will involve more loading time, but it will will make your life a lot less buggy.
Your answer
Follow this Question
Related Questions
Application.LoadLevel(Application.loadedLevel); wont work While checkpoints are on 3 Answers
Scene Change OnCollision Not Working 2 Answers
Where do Application.LoadLevel() and Resources.Load() load from? 1 Answer
Delete all GameObjects of last scene after Application.Loadlevel("New Scene") 2 Answers