GameInstance in multiplayer

From my understanding the Game Instance is an object that is created at the start of each ue4 game executable regardless of whether it is a client or server. The Game Instance exists for the life of the executable. ( (Blueprint Game Framework Basics | Live Training | Unreal Engine - YouTube)

The Game Instance on each executable is not replicated but one will exist on clients and servers.(

If you join a multiplayer game, each client will have its own game instance since a separate game instance exists for each executable and it is not replicated.

With that if you call Get Game Instance on a client then you will get that client’s game instance.

1 Like

I just want to make sure if I understand it correctly.

So when I start the game a game instance is created.
If I join in a multiplayer game, each client will have its own game instance?
And the getGameInstance node will get the client’s game Instance when its called ?

You are mostly correct, OP.

Game instance created when game starts and lasts until that game executable closes, persisting across level changes and joining sessions etc.

Game instance is only aware of its own executable. Does not have any connection between server and clients.

When I need to persist something from one level to another for example when a client joins a server’s level then I put it in game instance to save it for after the level switch. Then after Game state starts on the newly joined or opened level I have it grab anything it needs to inform all clients about from the Game Instance and can tell the server via playercontroller RPC to set those vars or multicast a function to everyone about it.

1 Like

So does that mean when a server launches a dedicated server , that the dedicated server itself would have a game instance?.. that only it has access to?

that you could essentially call on the game mode of your server map using authority to pull say server player saves from and load them from player input of say a name for player save slot

I searched for a proper answer to this eaxct question too - but couldn’t find anything, so after 9000 browser tabs I’ll asume that’s the case, until proven otherwise.

The GameInstance is alive as long as the application is alive, pretty much as its name suggests, it’s an instance of the game. With that said, when a dedicated server is launched, a GameInstance will be created in response (on server). The GameInstance on server has no clue about the GameInstance that exists on clients, which gets instantiated the moment you launch the game, and is destroyed once you exit and close the game instance.

Quick recap: Every server instance has his own GameInstance, and every client instance has his own too.

There’s a high possibility that searchers for this thread might want to check how they can persist data between travels.


Great resource, thank you for creating this!