Whats the deferent between gamestate and game instance

whats the deferent between gamestate and gameinstance
what we should use for multiplayer UI (UMG)
cuz i see some use the gamestate and some use gameinstance

GameState is replicated extension of GameMode, since GameMode it self is not replicated and exists only on servers memory for security reasons. So GameState let clients access some game data which you would normally place in GameMode, primerly scores and match time, stuff that you usually see on scoreboard. This is only info that client will have and GameMode should have info which only server should know. You can ignore GameState if you creating single player only game.

GameInstance is a class that which state persists switching of levels, game mode switches etc. where classes like GameMode or PlayerController are being reset and any data stored in them is deleted and put to defaults again. Any data that you want to keep beyond levels and matches, for example “what player did in specific moment so you can have consequence on other level” should be placed here. This class is mainly helpful for single player games… but it can find uses in multi player too ;] I not sure if that class is replicated

For UI of multiplayer game you should use GameState and PlayerState ofcorse

nice explanation it help if u have any link to document or video to have more understanding itll be helpfull

in documentaion it’s called “Framework” https://docs.unrealengine.com/latest/INT/Gameplay/Framework/index.html

" I not sure if that class is replicated"

does it exists on server side and client side both?

I did a quick test and it looks like both client and server each have their own separate GameInstance.

This is actually logical, since the GameInstance is your personal user storage. So it keeps your data (e.g. game settings) even when you change from one multiplayer server to an other.

then how can you access a specific game instance of a player controller through a game mode

Its little old post, still I’m adding more details incase in future if someone comes here.

Game state is like a object state that exists on server and replicated (all) clients.
game instance (GI), in analogy you can consider it as running exe process. Which exists on both client and server but they are independent and there is no logical relation between server GI and client GI.

For example when you start Fortnight game, that is nothing but Game instance, which is used to switch between widgets, querying master server and Join game session (match), switching between game modes (quad PvP, duo PvP or PvE). In all the cases you have only one game instance exists. It Gets destroyed when you close the game exe.

But GameState will be recreated for each game mode (session/match). When you play quad PvP you get one game mode, after that match finishes, if you join another PvP, you will get new GS.

Hope this helps. Sorry for typos.

So if you have an open world with ‘automatic’ saving at trigger points (obtain new item, reach new level, etc), and multiple save slots the game has to choose between to load/save to… would you have a separate game instance that’s loaded when the player picks a specific game slot to continue playing (that then determines which set of savegame variables to update in the savegame blueprint)? Or would you use gamestates/gamemodes to do this instead? The more I research game instances/modes/states the more confused I get over which one to use for the above!