# Any good guide for creating/handling Config(.ini) with C++?

**URL:** <https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359>\
**Category:** Programming & Scripting\
**Tags:** ini, unreal-engine, config, CPP\
**Created:** [February 24, 2025, 5:52pm UTC](https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359 "2025-02-24T17:52:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [February 24, 2025, 5:52pm UTC](https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359/1 "2025-02-24T17:52:08Z")

</div>

I am trying to get in to UE Config field, make my own config files, add/edit stuff in default UE Configs like Engine, Game and so on. Aim to get better understanding of how it all working.

But spent entire day already and achieved nothing but frustration, exhaustion and disappointment. Lack of good, comprehensive examples is real, basically nothing in video format(_or youtube search is so crap so I failed to find any related_).

The [main Epic’s guide](https://dev.epicgames.com/documentation/en-us/unreal-engine/configuration-files-in-unreal-engine#syntax) is somehow not working, I can’t understand why, I am following it all and seems like understand it but no success, can’t read, not write to my Config files, SaveConfig does nothing as well.

Here is my most simple stuff:

 ![devenv_oT3M7N7aDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/3/f43f085058a6bff8047ecae64b5f0e087be37ede.png)

![devenv_rI4ttZiyy8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/e/48e1e862ad4422fe60bc7b930c2434f6dad1257e.png)

Isn’t SaveConfig should save all in to DefaultMyConfig.ini or create it if it does not exist? Because it clearly does nothing in my case.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [February 24, 2025, 7:36pm UTC](https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359/2 "2025-02-24T19:36:38Z")

</div>

I just wrote stuff to myGameConfiig.ini, syntax is really simple. Just use printf and write to file.

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [February 25, 2025, 8:28am UTC](https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359/3 "2025-02-25T08:28:05Z")

</div>

Several mistakes in [Epic’s guide](https://dev.epicgames.com/documentation/en-us/unreal-engine/configuration-files-in-unreal-engine#saveconfigurationsettingsincode) I found because of it, this documentation does not work. Here is few now:

 ![opera_tFej0pi8OH](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/e/82eb960239cfe6fb61038f2a563ff126832eab35.png)

In that example such stuff with `A` prefix in class would not compile:

> Error: Class ‘AMyConfigActor’ has an invalid Unreal prefix, expecting ‘UMyConfigActor’

Secondly, no `public:` specifier, so from `*settings->` you won’t be able to even acess your variables like `MyConfigVariable` from documentation.

**So the purpose of this thread of mine remains: how much more there is mistakes that not so visible, but still exists, so people not even able to create their simplest, primitive MyConfig.ini?**

> [@Nawrot](#):
>
> Just use printf and write to file.

No mate I don’t think that’s correct way to do this. There is whole _config-related_ functional toolbox created and available by the engine, to write from config, read, save, load, and other stuff to do it right way.

**EDIT:**  
So far the only positive I am getting is reading existing variables from the Default UE configs, like this works fine:

```auto
FString str1;
GConfig->GetString(TEXT("/Script/UnrealEd.ProjectPackagingSettings"), TEXT("BuildConfiguration"), str1, GGameIni);
GEngine->AddOnScreenDebugMessage(-1, 7, FColor::Magenta, "ini str val1: " + str1);

```

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [February 25, 2025, 10:22am UTC](https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359/4 "2025-02-25T10:22:24Z")

</div>

Okay, important thing I never saw mentioned - you should never test any of your _.ini-related_ stuff by **Playing In Editor** (_Selected Viewport or New Editor Window(PIE)_), it won’t work properly and will fail get current values from your .ini’s. Only run with **Standalone Game**.

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [February 25, 2025, 4:16pm UTC](https://forums.unrealengine.com/t/any-good-guide-for-creating-handling-config-ini-with-c/2355359/5 "2025-02-25T16:16:49Z")

</div>

I found my primary source of struggle: [`SaveConfig()` not working anymore for whatever reason](https://forums.unrealengine.com/t/plugin-no-longer-saves-settings-in-5-5/2139463/4) for several(!) months(?).

Use `TryUpdateDefaultConfigFile();` instead.
