# Game State, Game Instance & Game Mode. Which one to use for what?

**URL:** <https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 7, 2017, 6:17am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795 "2017-07-07T06:17:03Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![c0ldpr0xy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c0ldpr0xy](https://forums.unrealengine.com/u/c0ldpr0xy)\
**Post date:** [July 7, 2017, 6:17am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/1 "2017-07-07T06:17:03Z")

</div>

I’m making a simple co-op multiplayer game. You complete a level by defeating X amount of enemies and then you move on to next level (stream or not).

Where would be best to store the variable that determines if you won that level? So far, I’m using level blueprint to store “global” or level-specific variables but it seems like they’re best stored elsewhere. Game Mode seems to be server-only? So a client can’t access Game Mode vars? I don’t get it.

---

<div class="post-metadata">

**Author:** ![Ninjin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ninjin](https://forums.unrealengine.com/u/Ninjin)\
**Post date:** [July 7, 2017, 6:49am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/2 "2017-07-07T06:49:36Z")

</div>

Hey, did you check out [eXi’s Network Compendium](http://cedric-neukirchen.net/2017/02/14/multiplayer-network-compendium/)? It’s huge, but important that you understand the whole framework and not only your 3 mentioned classes. I hope it helps you as much as it helped me! \<3

---

<div class="post-metadata">

**Author:** ![AmphDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AmphDev](https://forums.unrealengine.com/u/AmphDev)\
**Post date:** [July 7, 2017, 6:50am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/3 "2017-07-07T06:50:03Z")

</div>

Hey!  
Super simple, just seems hard to understand 😉

Let me explain:

GameMode: you have right, exist only on server. It is a secured actor which are hackproof because exist only on server, so clients cant modify it for example. But im sure many cause are there, why it is only on server 🙂

No matter, exist only on server. Gamemode is the actor who owns and controll all of your rules which your game need.  
For example imagine a shooter game with Team DeathMatch Mode!

Gamemode will check scores, time and will decide when match is over and which team is winner!  
Clear and simple right? But…

GameState: gamestate is a simplified actor which will replicate to every client. So Server will have one GameState and every Client will have a copy of that!!!  
Because of replication you can use unreal engines networking in gamestate, replicate variables, call multicast rpcs and so on.

Why Gamestate is important?

Go back our TDM example. You have two team which have team scores. when team 1 achieving score GameMode should decide and add one point to team 1.  
So basically scoring as i said below controlled on server by Gamemode.  
But you want show that score on Client Uis right? For that you need GameState because GameState can replicate variable, so team scores should be stored in gamestate but only Gamemode can change it 🙂  
Again clear right? For security reason we do not allow players to modify team scores, when someone dies we notify Gamemode this player died, Gamemode will decide we need add point for team or not, Gamemode modify point in Gamestate, Gamestate replicate score variable, Client Uis will refresh with new score 🙂

Gamemode and gamestate arent persistent actors, that means when you change level new gamemode and new gamestate will be spawned.  
So if you load a brand new level gamemode, gamestates will be destroyed (client gamestates too) and when new map loaded new gm gs will be spawned.

GameInstance:

Gameinstance actually is your game itself. Gameistance is persistent actor which will created when you first start the game and will be there as long your game runs.  
No matter if you changing levels or players disconnecting from servers or go back to main menu, gameinstance will be there if game running.

Gameinstance is used for many cause like login and account check or giving informations about last played match or something.

Go back to our tdm example.

You want show some statistics for players after match ended, but you want to show that when new map is loading in background for example.  
For this you can use gameinstance.

After match ended you send your statistics via gamestate and store in gameinstance, start load new level and you can use data from gameinstance, because gameinstance will be not destroyed 🙂

This GameInstance example isnt the best, but i hope you understand the point.

---

<div class="post-metadata">

**Author:** ![c0ldpr0xy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c0ldpr0xy](https://forums.unrealengine.com/u/c0ldpr0xy)\
**Post date:** [July 7, 2017, 8:45pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/4 "2017-07-07T20:45:06Z")

</div>

Yo, that PDF is a gift from the heavens. Thanks.

---

<div class="post-metadata">

**Author:** ![c0ldpr0xy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c0ldpr0xy](https://forums.unrealengine.com/u/c0ldpr0xy)\
**Post date:** [July 7, 2017, 8:45pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/5 "2017-07-07T20:45:31Z")

</div>

Thanks for the explanation, bookmarked.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cfba1e64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cfba1e64](https://forums.unrealengine.com/u/anonymous_user_cfba1e64)\
**Post date:** [September 23, 2017, 11:16am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/6 "2017-09-23T11:16:05Z")

</div>

i love u, thats exactly what i need

---

<div class="post-metadata">

**Author:** ![joeGraf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@joeGraf](https://forums.unrealengine.com/u/joeGraf)\
**Post date:** [June 20, 2018, 8:41pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/7 "2018-06-20T20:41:17Z")

</div>

GameInstances are UObjects and not Actors.

---

<div class="post-metadata">

**Author:** ![GradessGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gradessgames/32/879067_2.png) [@GradessGames](https://forums.unrealengine.com/u/GradessGames)\
**Post date:** [March 21, 2019, 12:14pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/8 "2019-03-21T12:14:19Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Mbdot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mbdot](https://forums.unrealengine.com/u/Mbdot)\
**Post date:** [May 2, 2021, 6:02am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/9 "2021-05-02T06:02:25Z")

</div>

Thanks for the very easy to understand explanation!

---

<div class="post-metadata">

**Author:** ![AleMarcati](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alemarcati/32/1139690_2.png) [@AleMarcati](https://forums.unrealengine.com/u/AleMarcati)\
**Post date:** [September 23, 2021, 7:41pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/10 "2021-09-23T19:41:23Z")

</div>

So, for a single player game I only really need one of those, right?  
I’m a beginner making a single player game and for now was only using the GameInstance to store player scores and all the rest. Is it ok for a single player game or will I be running into problems down the line that I am not aware of right now?

---

<div class="post-metadata">

**Author:** ![Shehanmark](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shehanmark](https://forums.unrealengine.com/u/Shehanmark)\
**Post date:** [July 28, 2022, 12:10am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/11 "2022-07-28T00:10:43Z")

</div>

Hey,

Im also in need to understand these concepts. But that PDF link does not work anymore. Could you please share that if you have it with you ?

---

<div class="post-metadata">

**Author:** ![Divishka1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/divishka1/32/468627_2.png) [@Divishka1](https://forums.unrealengine.com/u/Divishka1)\
**Post date:** [August 11, 2022, 9:01am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/12 "2022-08-11T09:01:35Z")

</div>

For solo game you may like this [Romero Blueprints++: Table of Contents BP](https://romeroblueprints.blogspot.com/p/table-of-contents.html) more

---

<div class="post-metadata">

**Author:** ![KermanFooFoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KermanFooFoo](https://forums.unrealengine.com/u/KermanFooFoo)\
**Post date:** [July 12, 2023, 9:26pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/13 "2023-07-12T21:26:02Z")

</div>

This link seems to have died; would it be possible for you to update it?

---

<div class="post-metadata">

**Author:** ![MonsOlympus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/monsolympus/32/619062_2.png) [@MonsOlympus](https://forums.unrealengine.com/u/MonsOlympus)\
**Post date:** [July 13, 2023, 8:02pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/14 "2023-07-13T20:02:16Z")

</div>

> **[Multiplayer Network Compendium | An Unreal Engine Blog by Cedric Neukirchen](https://cedric-neukirchen.net/docs/category/multiplayer-network-compendium/)**
>
> This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.

---

<div class="post-metadata">

**Author:** ![WolfTechRob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wolftechrob/32/1032282_2.png) [@WolfTechRob](https://forums.unrealengine.com/u/WolfTechRob)\
**Post date:** [February 10, 2024, 11:45am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/15 "2024-02-10T11:45:15Z")

</div>

Technically for single player games, you could put most of your logic, event graph stuff, into your character. I e made lots of side solo projects and work on a multiplayer game, and the only time that game mode, game state, or game instance have been mentioned are for the multiplayer game.  
Things to note though:  
Controller is used to input  
HUD is used to manage UI (add to viewport, updates, etc)  
But these don’t need to be used in single player games, but can help in single player games to keep things organized.  
The amount of nodes (logic) that I have placed inside of the character event graphs can cause unreal to get laggy when you open it to make changes, so at least try splitting that stress into the Controller and the HUD.

---

<div class="post-metadata">

**Author:** ![ApnaFurniture](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ApnaFurniture](https://forums.unrealengine.com/u/ApnaFurniture)\
**Post date:** [November 4, 2024, 3:30pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/16 "2024-11-04T15:30:49Z")

</div>

Yes puzzle game

---

<div class="post-metadata">

**Author:** ![PhoneKhan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PhoneKhan](https://forums.unrealengine.com/u/PhoneKhan)\
**Post date:** [December 17, 2024, 8:35am UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/17 "2024-12-17T08:35:52Z")

</div>

Everyone loves playing the game but not everyone can afford to buy a membership to use all the cool features. It can be very frustrating because they miss out on the best parts of the game just because they can’t pay for it. Wait! Let me spill the beans. Check out the **[new version](https://tocalifesworld.com/)** for an exciting experience!

---

<div class="post-metadata">

**Author:** ![Wanvora\_Wealth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wanvora\_Wealth](https://forums.unrealengine.com/u/Wanvora_Wealth)\
**Post date:** [October 29, 2026, 6:30pm UTC](https://forums.unrealengine.com/t/game-state-game-instance-game-mode-which-one-to-use-for-what/399795/21 "2026-10-29T18:30:20Z")

</div>

intresting information
