No announcement yet.

Game Instance and Game Save and Game State

  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    ah ok than you very much exi, this is so clear now

    Leave a comment:

  • replied
    Not completely correct.

    A GameSave Class can be used to define Variables that you want to save with the function (There are tutorial about how do to this).
    So this is correct.

    BUT, GameState and GameInstance are 2 completely different things that don't really share something.


    The GameInstance Class will be created when the Game starts and will be deleted when it closes. It will SURVIVE level swaps, so you
    can use it to save overall things, like a PlayerName, to keep that between Levels. You can also use it to have a State of the COMPLETE
    game. Like "IsInMainMenu" or "IsInPlayMap" or "TrysToHostGame" etc.

    While it makes sense to save some stuff in the GameInstance to keep it between level changes, it's not really recommended to do that with
    all kinds of stuff that you want to save. It makes more sense to use the GameSave Class to actually save parts of the game before switch the Level.


    The GameState Class is unique for each Level. So if you change the Level, the GameState will be destroyed and a new one will be created for the
    new loaded level. So you CAN'T save stuff in it for LevelChanges.

    The GameState Class is meant to keep the State of the current Game. Or better, of the current Level.
    Keep in mind that the Engine is highly affected by UnrealTournament. You will find that a lot of classes make total sense for Games like that, but
    are useless for your own Game.

    But in general, you would have states in that Class that manage how far the current round is. "Are we still playing?", "Did someone win the round?",
    "What Players are connected?" (PlayerArray for example) or "Do we need to restart the round?" and all of that stuff.

    Leave a comment:

  • replied
    Anything you want to keep between launches of the game will have to be specifically kept in the save file.

    Leave a comment:

  • started a topic Game Instance and Game Save and Game State

    Game Instance and Game Save and Game State

    I have a "little" problem when it comes to these 3 bleuprints that i hope someone gives me some clarification for.
    The game save bp creates an external file that keeps all the data of the game to load them when needed
    The game instance and state let us transfer the variables between levels
    so do i need to save the game instance and state in the game save slot or does they do the sale thing all?