
Image showing the Game Manager component, with added manager prefabs, as seen in the Entity Inspector.
Overview
The Game Manager is the root component of every GS_Play project. It controls the game lifecycle from startup through shutdown: spawning and initializing all Manager components in the correct order, providing systemic navigation (New Game, Load Game, Return to Title, Quit), and coordinating standby mode for pausing gameplay during level transitions or other blocking operations.
Every level in your project should contain the same Game Manager prefab. This allows you to start the game from any level — in debug mode it stays in the current level, in release mode it navigates to your title stage.
How It Works
Startup Sequence
When the project starts, the Game Manager executes a three-stage startup:
- Spawn Managers — The Game Manager instantiates every prefab in its Startup Managers list. Each manager component runs its
Activate()and reports back viaOnRegisterManagerInit(). - Startup Managers — Once all managers report initialized, the Game Manager broadcasts
OnStartupManagers(). Managers now connect to each other and report back viaOnRegisterManagerStartup(). - Startup Complete — Once all managers report started up, the Game Manager broadcasts
OnStartupComplete(). The game is fully initialized and ready to run.
At each stage, the Game Manager counts reports and only proceeds when every spawned manager has reported. This guarantees safe cross-referencing between managers in Stage 2.
Systemic Navigation
The Game Manager provides the high-level game flow methods that drive your project:
- NewGame / NewGame(saveName) — Starts a new game, optionally with a named save file.
- ContinueGame — Loads the most recent save and continues.
- LoadGame(saveName) — Loads a specific save file.
- ReturnToTitle — Returns to the title stage, tearing down the current game session.
- SaveAndExitGame / ExitGame — Saves and/or exits the application.
These methods coordinate with the Save Manager and Stage Manager automatically.
Standby Mode
Standby is a global pause mechanism. When the Game Manager enters standby, it broadcasts OnEnterStandby() to all managers, which propagate the signal to their subsystems. This halts timers, physics, gameplay ticks, and other simulation while a blocking operation (like a stage change) completes. Calling ExitStandby reverses the process.
Debug Mode
When Debug Mode is enabled in the Inspector, the Game Manager skips navigating to the title stage and remains in the current level. This allows rapid iteration — you can start the game from any level without going through the full title-to-gameplay flow. If save data and unit management are enabled, it loads default save data but overrides position data with the current level’s default spawn point.
Setup

Image showing the Game Manager wrapper entity set as Editor-Only inside Prefab Edit Mode.
- Create an entity and attach the GS_GameManagerComponent (or your extended version).
- Turn the entity into a prefab.
- Enter prefab edit mode. Set the wrapper entity (the parent of your Game Manager entity) to Editor Only. Save the prefab.
- Create Manager prefabs for the systems you need (Save, Stage, Options, or custom managers).
- Add each Manager
.spawnableto the Game Manager’s Startup Managers list in the Entity Inspector. - Push your overrides into the prefab to propagate across all levels.
Place your Game Manager prefab at the top of every level in the Entity Outliner.
The premade manager prefabs for each GS_Play gem are located in that gem’s
Assets/Prefabsdirectory.
Inspector Properties
| Property | Type | Description |
|---|---|---|
| Project Prefix | AZStd::string | Sets the project prefix for generated files (e.g. save files). Example: "GS" produces GS_SaveGame.json. |
| Startup Managers | AZStd::vector<SpawnableAssetRef> | The list of Manager prefab spawnables to instantiate on game start. Order does not matter — the two-stage init handles dependencies. |
| Debug Mode | bool | When enabled, the Game Manager stays in the current level instead of navigating to the title stage. Useful for rapid iteration. |
API Reference
Request Bus: GameManagerIncomingEventBus
Commands you send to the Game Manager. This is a singleton bus (Single address, Single handler).
| Method | Parameters | Returns | Description |
|---|---|---|---|
IsInDebug | — | bool | Returns whether debug mode is active. |
IsStarted | — | bool | Returns whether the startup sequence has completed. |
GetProjectPrefix | — | AZStd::string | Returns the configured project prefix string. |
EnterStandby | — | void | Broadcasts standby to all managers, pausing gameplay. |
ExitStandby | — | void | Broadcasts standby exit, resuming gameplay. |
NewGame | — | void | Starts a new game with default save name. |
NewGame | const AZStd::string& saveName | void | Starts a new game with a specified save file name. |
ContinueGame | — | void | Loads the most recent save file and continues. |
LoadGame | const AZStd::string& saveName | void | Loads a specific save file by name. |
ReturnToTitle | — | void | Returns to the title stage, tearing down the current session. |
SaveAndExitGame | — | void | Saves the current game state and exits the application. |
ExitGame | — | void | Exits the application without saving. |
Notification Bus: GameManagerOutgoingEventBus
Events broadcast by the Game Manager that other systems listen to. This is a multiple handler bus — any number of components can subscribe.
| Event | Description |
|---|---|
OnSetupManagers | Fired when all managers have reported initialized. Managers should now connect to each other. |
OnStartupComplete | Fired when the full startup sequence is complete. Safe to begin gameplay. |
OnShutdownManagers | Fired when the game is shutting down. Managers should clean up. |
OnBeginGame | Fired when a new game or loaded game begins. |
OnEnterStandby | Fired when entering standby mode. Pause your systems. |
OnExitStandby | Fired when exiting standby mode. Resume your systems. |
ScriptCanvas Reflection
These methods are available as ScriptCanvas nodes for visual scripting:
| Node | Description |
|---|---|
TriggerNewGame | Starts a new game with default save. |
TriggerNewGameWithName(saveName) | Starts a new game with a named save. |
TriggerContinueGame | Continues from the most recent save. |
TriggerLoadGame(saveName) | Loads a specific save file. |
TriggerReturnToTitle | Returns to the title stage. |
TriggerSaveAndExitGame | Saves and exits. |
TriggerExitGame | Exits without saving. |
Local / Virtual Methods
Methods available when extending the Game Manager. Override these to customize behavior.
| Method | Description |
|---|---|
InitializeManagers() | Spawns the Startup Managers list. Override to add custom spawn logic. |
ProcessFallbackSpawn() | Handles fallback when a manager fails to spawn. |
StartupManagers() | Broadcasts OnStartupManagers. Override to inject logic between init and startup. |
CompleteStartup() | Final processing after startup. Broadcasts OnStartupComplete. |
BeginGame() | Called when transitioning into active gameplay. |
Usage Examples
Starting a New Game from C++
#include <GS_Core/GS_CoreBus.h>
// Start a new game with a named save file
GS_Core::GameManagerIncomingEventBus::Broadcast(
&GS_Core::GameManagerIncomingEventBus::Events::NewGame,
AZStd::string("MySaveFile")
);
Listening for Startup Complete
#include <GS_Core/GS_CoreBus.h>
class MyComponent
: public AZ::Component
, protected GS_Core::GameManagerOutgoingEventBus::Handler
{
protected:
void Activate() override
{
GS_Core::GameManagerOutgoingEventBus::Handler::BusConnect();
}
void Deactivate() override
{
GS_Core::GameManagerOutgoingEventBus::Handler::BusDisconnect();
}
// Called once the game is fully initialized
void OnStartupComplete() override
{
// Safe to access all managers and begin gameplay logic
}
// Called when entering standby (e.g. during level transitions)
void OnEnterStandby() override
{
// Pause your gameplay systems
}
void OnExitStandby() override
{
// Resume your gameplay systems
}
};
Extending the Game Manager
You can extend the Game Manager to add custom startup logic, additional lifecycle events, or project-specific behavior.
Header (.h)
#pragma once
#include <GS_Core/GS_CoreBus.h>
#include <Source/Managers/GS_GameManagerComponent.h>
namespace MyProject
{
class MyGameManager : public GS_Core::GS_GameManagerComponent
{
public:
AZ_COMPONENT_DECL(MyGameManager);
static void Reflect(AZ::ReflectContext* context);
protected:
void InitializeManagers() override;
void StartupManagers() override;
void CompleteStartup() override;
void BeginGame() override;
};
}
Implementation (.cpp)
#include "MyGameManager.h"
#include <AzCore/Serialization/SerializeContext.h>
namespace MyProject
{
AZ_COMPONENT_IMPL(MyGameManager, "MyGameManager", "{YOUR-UUID-HERE}");
void MyGameManager::Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<MyGameManager, GS_Core::GS_GameManagerComponent>()
->Version(0);
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
{
editContext->Class<MyGameManager>("My Game Manager", "Custom game manager for MyProject")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Category, "MyProject")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game"));
}
}
}
void MyGameManager::InitializeManagers()
{
// Call base to spawn the standard manager list
GS_GameManagerComponent::InitializeManagers();
// Add custom initialization logic here
}
void MyGameManager::StartupManagers()
{
// Call base to handle standard startup
GS_GameManagerComponent::StartupManagers();
}
void MyGameManager::CompleteStartup()
{
// Call base to broadcast OnStartupComplete
GS_GameManagerComponent::CompleteStartup();
// Your post-startup logic here (e.g. connect to analytics, initialize online services)
}
void MyGameManager::BeginGame()
{
GS_GameManagerComponent::BeginGame();
// Custom game start logic
}
}
Module Registration
Register your custom Game Manager in your project’s module:
m_descriptors.insert(m_descriptors.end(), {
MyProject::MyGameManager::CreateDescriptor(),
});
See Also
- Manager Base Class — The base class pattern for all managers
- Save Manager — Persistence management
- Stage Manager — Level loading and navigation
- Templates — Starter files for custom Game Managers
- Demos: Managers