Where should i put mission info etc?

So i have a game with 100 levels. After every level i show a widget, lives left etc. I also need to load a new level and spawn new enemies every time. Where should i store all this mission data? In gamemode? in playercontroller?

When I encounter that question, I start with the premise that “I might make this game work in a network someday” so I try to build my projects using a philosophy that would make that later step as easy as possible (which I think also reasonably translates to using the Gameplay Framework the way it was intended. Here is my current thought process based on what I have learned so far:

Two useful references:

  1. Tom Looman Gameplay Framework Overview

  2. Cedric Neukirchen Network Compendium

The pages I focus on are pages 8 & 9 of Cedrics document which shows “if” I converted my game to work on a network, what components of the gameplay framework would be available to who on the network. As you can see on those pages, certain content exists only on the server, or exists on the server and is shared with one client player or is visible to all client players. A GameState is a good place to put information that all players need to know where a PlayerController is a good place to put something that only a single player needs to know about themself.

The other nuance is about the persistence of information between levels. Each map has its own GameMode. So if your 100 levels are all in one map (ie they are technically sub-levels of one persistent level within a single map then your GameMode (which owns the Character, PlayerController and GameState classes) will be consistent throughout your game.

If, however, you are using multiple maps then you should consider storing your data in GameInstance which persists throughout the game even if multiple maps are used.

Very helpfull information and links. Thank you.