Archive 17/01/2023.

Managing Game State

carlomaker

This is a simple game state manager inspired from a good article about managing game states , i tried to adapt it in Urho3d
using events rather than loops update on virtual methods that kill performance.

GameStateHandler is a states manager ;
IGameState state base class ,
GameIntroSample splash screen
GameMainMenuSample ,a class for general purposes

vivienneanthony

[quote=“carlomaker”]This is a simple game state manager inspired from a good article about managing game states , i tried to adapt it in Urho3d
using events rather than loops update on virtual methods that kill performance.

GameStateHandler is a states manager ;
IGameState state base class ,
GameIntroSample splash screen
GameMainMenuSample ,a class for general purposes

Hey. I need to update my state manager so I can do stuff load splash and preloading screens.

I’m looking at your code and trying to figure it out.

From what I can see each main area of a game would go in a subclass in the igamestate. In my code, that’s probably Login, CreateAccount, CreatePlayer, MainScreen, PreloadGameMode(I want to add), GameMode.

The Class Wiki I’m assume would be my App class to ExistenceClient.

Main Git and specific Source
github.com/vivienneanthony/Urho … -Existence
github.com/vivienneanthony/Urho … stenceApps

I will be doing a lot of cleanup. It is missing error and dialog prompts, worst case checks like missing files, and some other things.

Vivienne

vivienneanthony

I’m not sure what the use of the Urho3D::SharedPtr<Urho3D::Node> mainNode; would be.

thebluefish

That just creates a root node “Main” under the scene. If you don’t want to use this, you can safely remove its use. It will not affect the functionality of the state manager.

vivienneanthony

I got the code in and placed it on Github. I just can’t figure out how to change the state.

github.com/vivienneanthony/Urho … stenceApps

vivienneanthony

[quote=“carlomaker”]This is a simple game state manager inspired from a good article about managing game states , i tried to adapt it in Urho3d
using events rather than loops update on virtual methods that kill performance.

GameStateHandler is a states manager ;
IGameState state base class ,
GameIntroSample splash screen
GameMainMenuSample ,a class for general purposes

How is the event change triggered??