4
\$\begingroup\$

Question

What is the standard or basic game screen/scene life cycle used in most games?

What is Screen/Scene?

The term screen or scene refers to the current displayed entity holder where game entities or objects are placed. I personally call it scene because the term screen for me is the hardware screen, but I have read that others call it screen as denoted by Screen Manager classes (I call it Scene Manager).

Understanding Scene Management and Game Scene Life Cycle

Here is my current understanding of a simple scene management and game scene life cycle:

Assuming, we have 4 screens/scenes in a basic game:

  1. Splash Scene - used to display the company logo, the game logo and loading of most of the game resources used by the menu scene and loading scene.
  2. Menu Scene - used to display menus and buttons, referred to as the "main menu" and the gateway to other scenes especially the game scene (sometimes there are settings scene, help scene and about scene).
  3. Loading Scene - used to display a progress bar or anything related that indicates the loading and unloading of the game scene.
  4. Game Scene - used to display the game logic and implementation of the game itself.

start application ---(load splash scene contents)---> splash scene ---(load menu scene and loading scene contents and unload splash scene contents)---> menu scene ("start game" pressed) ---> loading scene ---(load game scene contents)---> game scene ("return to main menu" pressed) ---> loading scene ---(unload game scene contents)---> menu scene

  1. Start Application
  2. Load Splash Scene Contents
  3. Show Splash Scene
  4. Load Menu Scene and Loading Scene Contents
  5. Hide Splash Scene
  6. Show Menu Scene
  7. Unload Splash Scene Contents
  8. "Start Game" Button Pressed
  9. Hide Menu Scene
  10. Show Loading Scene
  11. Load Game Scene Contents
  12. Hide Loading Scene
  13. Show Game Scene
  14. THE GAME IMPLEMENTATION
  15. "Return to Main Menu" Button Pressed
  16. Hide Game Scene
  17. Show Loading Scene
  18. Unload Game Scene Contents
  19. Hide Loading Scene
  20. Show Menu Scene

Is this the right way to do it in most cases? I know that the screen/scene life cycle varies depending on the game you are creating. I just want to know if this is the right way to do it or am I doing things the wrong way?

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

The nomenclature here is definitely odd.

I at first thought you were talking about something lower level (like the scenegraph or screen manager for organizing logic flow and/or rendering). I then realized you are talking about what I would refer to as game state.

Scenes are a popular term for it now with Unity, so I could see why you would call it that, although you could have the entire lifecycle of your game in one scene. This can be helpful to remove or reduce loading times.

So terminology aside. This is really all up to personal preference and the scenario you wish to achieve. I would definitely consider what you described as a very classic game state model.

You can obviously feel free to break this mold and try to eliminate loading screens or hard transitions between the game world and the user interface.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks. Yeah, it is a classic game state model I would say. :) Calling it game state I think is more suited, but whatever. Haha. It really is personal preference. I asked this question because I am undecided if I will create an abstract class that will define all methods needed fro the SceneManager class. :) \$\endgroup\$
    – arvicxyz
    Oct 10, 2015 at 4:39
  • 1
    \$\begingroup\$ Yup, a rose by any other name and all that... I often call it a game state as I normally use a state design pattern when implementing the control flow. \$\endgroup\$ Oct 10, 2015 at 4:54
0
\$\begingroup\$

Mostly right, but you're missing the in-game overlay menu, which has most of the main menu functionality, such as changing sound, controls, and graphics. The existence of that menu means the "return to Main Menu" becomes "Quit to Main Menu".

"Hide" - "unload" - "delete" order can also be simplified by simply telling a scene to hide itself now, and start to asynchronously unload its contents and delete itself - that's one command instead of 3.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .