Easy way to save settings/config and to reset it

Hello everybody!

I am wondering if anyone knows a good way of saving, loading, and defaulting the configuration of a game.

Perhaps you know Rama’s VictoryPlugin or his wiki tutorial, and maybe you know the wiki page Save Graphics Settings with Blueprints. But none of these is really as simple as it could be.

Look at my try to change a keyboard input setting. I just created a C++ empty project with no starter content and edited the level blueprint of the default map. EventF is the subject (there is an ActionMapping so that key F triggers this event), the event ChangeMapping (also an ActionMapping, triggered by C) assigns EventF to another key (here: Q), and event Reset shall reset all:

There are two problems:

  1. The behaviour of the game is very different depending the mode it is running. When you just play it (Selected Viewport, PIE, …), you do not even need “Save Key Mappings”. Unfortunately, the mapping is changed directly in the project settings in any case. When packaging the game, however, you need “Save Key Mappings”.
  2. Resetting to default does not work. But it’s far away from possible: Let’s assume we packaged to Development. In WindowsNoEditor/GameName you can find a directory “Saved”. If you delete it, you can start the game and get the default settings.
    Furthermore, there seems to be a difference between packaging Development and Shipping. In the later package there is no such directory “Saved”!

Well, guys … has anyone any idea? I am not interested in handling 20 different options tortuously in a save game slot, when I am so close to the solution. And, of course, it would be very pleasant to have the same behaviour of saving/loading/defaulting no matter of the way you start, preview, or package your game.

Many thanks for any hint!

Hello there :slight_smile:

We’ve been developing a project where we encountered similar problems.

We were forced to build our system to take this into account.

We have one system that has several rules inside of him to handle every cases properly. It’s not different options but it’s certainly going into that direction.
If you don’t, you even end up with Inputs being deleted from your project while playing in Editor and trying to rebind. Especially if you start adding features that automatically unbind an input which was using a hotkey that the player just assigned to another input.

We stored base mappings (action + inputs) in a structure stored in our SaveGame_Settings (wrote them by hand in the structure).
We stored player mappings in the SaveGame_Settings (by default they are = base mappings and whenever the player modify inputs we store it there).

When we run the game, we check if player mapping is missing an entry, if it is, we are generating it from the base mappings.

It makes sure we never end up with a missing input from our Project Settings.

It’s not convenient but it’s ‘okay-ish’.

If you want more details, quote me with my name (it will generate a notification for me).

Hi Yun-Kun,

I could not completly understand how your system works.

You mean you could not find a way (e. g. a setting in UE editor) so that different ways of building handle key mapping equal?

And did I understood correct – you saved all config settings of your game more or less manually to a SaveGame?

So alltogether: Yes, some more details would be great. I especially still would like to know if there is an easy way.

We didn’t find a way around building our system so that it takes into account the different setup you can be playing in (Editor, Standalone, Shipping).

We have a structure composed of a name and an action (or axis) and we have two arrays of this in our SaveGame. One filled with the base inputs of the projects, the other filled with the inputs customized by the player.

Ok, thanks for all. I am going to do it similiar.

But just for the record: Shame on you, Epic! That aspect of UE is an impudence!