Download

UE4 - Best way to keep game menu settings between levels: game mode, ginstance, player?

Hi, im currently working on my main menu… already have a couple of Marketplace products (even do they only have 1 level), and tutorials, but i´m confused about the best approach to comunicating these settings between levels.

Some guys store each setting inside gamemode variables (wich may vary between levels), other inside main character (wich is not always in possesion), other in ginstances, wich is the only one i know it stays the whole game, but not many use it for settings, not sure why…. since each level has to adjust to those previous values, how they restore those options? does each level has to find each setting, like the size of the screen for example…, if i execute a comand in 1 level, is this comand going to auto replicate in every level? each level BP should find those variables at event begin play to apply them at every level? tutorials usually explain how to edit settings at current level, but not how to keep them between levels…. wich is very diferent to simply using ginstances for ítems, life, etc.

Please share your ideas of the best approach to menú settings (graphics, volumen, screen size, bindings) between levels.

If it were me - and others are free to correct me - I’d keep them in the GameInstance. This is the first thing that starts with the engine and that last thing that ends when the engine shuts down, so these variables are always available.

For saving the variables persistently outside of game sessions, I’m using the ‘Custom Config Var’ functions in Rama’s Victory Plugin. These get and set variables in Game.ini.