iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use Godot’s ConfigFile to store player preferences in user://settings.cfg, then load them at startup and apply them through the relevant runtime APIs. Saving a value and applying it are separate steps: ConfigFile stores data, but does not change audio, window, or input behavior by itself.
How ConfigFile persistence works
ConfigFile stores Variant values in section-and-key pairs in an INI-style file. A path under user:// is suitable for player-specific runtime data. The file is not a built-in settings schema; you choose the section names, keys, and value formats. See the Godot 4.5 ConfigFile reference.
Loading, applying, and saving are distinct operations:
load()reads the file into a ConfigFile and returns an error code.get_value(section, key, default)reads a value and uses the supplied default if that key is absent.set_value()changes the in-memory ConfigFile; it does not write the change to disk.save()writes the ConfigFile and also returns an error code.
Godot’s reference explicitly notes that mutating a ConfigFile only changes what is loaded in memory. A successful save is required for the change to survive a restart. Godot’s ConfigFile documentation
#1 Best Overall
- Personalize 5 customizable lighting zones with over 16.8M colors to match your setup or game and synchronize backlit lighting effects with other Logitech G devices using Logitech G Hub
- G213 Prodigy is a full-sized keyboard designed for gaming and productivity, with a slim body built for gamers of all levels and durable construction to repel liquids, crumbs, and dirt for easy cleanup
- Each key is tuned to enhance the tactile experience, delivering ultra-quick, responsive feedback while the anti-ghosting gaming matrix is tuned for optimal gaming performance, keeping you in control
- G213 gaming keyboard features dedicated media controls that can play, pause, and mute music and videos instantly; easily adjust the volume or skip to the next song with the touch of a button
- Customize lighting, game mode, and macro programming with Logitech G HUB software and stay comfortable during long gaming sessions thanks to an integrated palm rest and adjustable keyboard feet
Set up a settings owner
Put settings logic in a node with a clear lifetime, such as an autoload singleton when settings must be available across scenes. The owner can hold the file path, default values, loaded preferences, and functions for applying and saving them. For a smaller game, a scene-owned node can serve the same role if it remains alive wherever settings are used.
A possible file layout is:
master_volume = 0.8
[display]
fullscreen = false
[input]
# Store a deliberately designed representation for each action.
These section and key names are examples, not Godot requirements. Section and property names cannot contain spaces, and saving a ConfigFile discards comments in the file. Avoid relying on hand-written comments as persistent user data. Godot 4.5 ConfigFile reference
Rank #2
- Tri-mode Connection Keyboard: AULA F75 Pro wireless mechanical keyboards work with Bluetooth 5.0, 2.4GHz wireless and USB wired connection, can connect up to five devices at the same time, and easily switch by shortcut keys or side button. F75 Pro computer keyboard is suitable for PC, laptops, tablets, mobile phones, PS, XBOX etc, to meet all the needs of users. In addition, the rechargeable keyboard is equipped with a 4000mAh large-capacity battery, which has long-lasting battery life
- Hot-swap Custom Keyboard: This custom mechanical keyboard with hot-swappable base supports 3-pin or 5-pin switches replacement. Even keyboard beginners can easily DIY there own keyboards without soldering issue. F75 Pro gaming keyboards equipped with pre-lubricated stabilizers and LEOBOG reaper switches, bring smooth typing feeling and pleasant creamy mechanical sound, provide fast response for exciting game
- Advanced Structure and PCB Single Key Slotting: This thocky heavy mechanical keyboard features a advanced structure, extended integrated silicone pad, and PCB single key slotting, better optimizes resilience and stability, making the hand feel softer and more elastic. Five layers of filling silencer fills the gap between the PCB, the positioning plate and the shaft,effectively counteracting the cavity noise sound of the shaft hitting the positioning plate, and providing a solid feel
- 16.8 Million RGB Backlit: F75 Pro light up led keyboard features 16.8 million RGB lighting color. With 16 pre-set lighting effects to add a great atmosphere to the game. And supports 10 cool music rhythm lighting effects with driver. Lighting brightness and speed can be adjusted by the knob or the FN + key combination. You can select the single color effect as wish. And you can turn off the backlight if you do not need it
- Professional Gaming Keyboard: No matter the outlook, the construction, or the function, F75 Pro mechanical keyboard is definitely a professional gaming keyboard. This 81-key 75% layout compact keyboard can save more desktop space while retaining the necessary arrow keys for gaming. Additionally, with the multi-function knob, you can easily control the backlight and Media. Keys macro programmable, you can customize the function of single key or key combination function through F75 driver to increase the probability of winning the game and improve the work efficiency. N key rollover, and supports WIN key lock to prevent accidental touches in intense games
Load preferences with safe defaults
At startup, create the ConfigFile, attempt to load it, and use defaults when the file is missing, unreadable, or lacks an individual key. For ordinary preferences, a failed load should not stop the game from launching.
Free tools Windows power users keep installed
One-click scans. No signup required.
const SETTINGS_PATH := "user://settings.cfg"
var master_volume := 0.8
var fullscreen := false
var config := ConfigFile.new()
func load_settings() -> void:
config = ConfigFile.new()
var err := config.load(SETTINGS_PATH)
if err != OK:
# Missing or unreadable settings: retain defaults.
return
master_volume = config.get_value("audio", "master_volume", 0.8)
fullscreen = config.get_value("display", "fullscreen", false)
The example loads once into a long-lived in-memory ConfigFile so later writes can preserve the other settings already loaded. If the load fails, this instance remains a fresh ConfigFile and the preference variables keep their defaults. Check the exact signatures and error behavior against the Godot 4 minor version your project uses; the linked persistence reference is for Godot 4.5.
Rank #3
- Ip32 water resistant – Prevents accidental damage from liquid spills
- 10-zone RGB illumination – Gorgeous color schemes and reactive effects
- Whisper quiet gaming switches – Nearly silent use for 20 million low friction keypresses
- Premium magnetic wrist rest – Provides full palm support and comfort
- Dedicated multimedia controls – Adjust volume and settings on the fly
Apply loaded preferences at runtime
After loading, apply each preference to the relevant system. ConfigFile does not automatically connect a stored value to a slider, audio bus, window, or InputMap. The correct runtime API depends on the setting and the project’s implementation.
Volume
Choose and document one stored representation, such as a linear slider value or a decibel value, and use it consistently in the UI, saved file, and runtime application. Then apply that value to the game’s chosen audio bus through Godot’s audio runtime API. The sources linked here do not establish the exact AudioServer calls, bus indexing, or conversion for a particular project, so verify those details against the AudioServer documentation for your selected Godot version before adding volume application code.
Rank #4
- 【Ergonomic Design, Enhanced Typing Experience】Improve your typing experience with our computer keyboard featuring an ergonomic 7-degree input angle and a scientifically designed stepped key layout. The integrated wrist rests maintain a natural hand position, reducing hand fatigue. Constructed with durable ABS plastic keycaps and a robust metal base, this keyboard offers superior tactile feedback and long-lasting durability.
- 【15-Zone Rainbow Backlit Keyboard】Customize your PC gaming keyboard with 7 illumination modes and 4 brightness levels. Even in low light, easily identify keys for enhanced typing accuracy and efficiency. Choose from 15 RGB color modes to set the perfect ambiance for your typing adventure. After 30 minutes of inactivity, the keyboard will turn off the backlight and enter sleep mode. Press any key or "Fn+PgDn" to wake up the buttons and backlight.
- 【Whisper Quiet Design】Experience near-silent operation with our whisper-quiet gaming switch, ideal for office environments and gaming setups. The classic volcano switch structure ensures durability and an impressive lifespan of 50 million keystrokes.
- 【IP32 Spill Resistance】Our quiet gaming keyboard is IP32 spill-resistant, featuring 4 drainage holes in the wrist rest to prevent accidents and keep your game uninterrupted. Cleaning is made easy with the removable key cover.
- 【25 Anti-Ghost Keys & 12 Multimedia Keys】Enjoy swift and precise responses during games with the RGB gaming keyboard's anti-ghost keys, allowing 25 keys to function simultaneously. Control play, pause, and skip functions directly with the 12 multimedia keys for a seamless gaming experience. (Please note: Multimedia keys are not compatible with Mac)
Fullscreen
Store the player’s choice, then map it to a window mode and apply it with DisplayServer.window_set_mode(). For example, Godot’s 4.2 ProjectSettings reference demonstrates setting DisplayServer.WINDOW_MODE_WINDOWED at runtime. The broader Project Settings guide explains that some settings are read at startup and that live changes should use the corresponding runtime class or method. See the Godot 4.2 ProjectSettings reference and the stable Project Settings guide.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →For a boolean preference, define explicitly which mode true and false mean in your game. Consider a safe windowed fallback if a requested mode is unavailable on a target platform; verify behavior on the platforms you support rather than assuming every environment handles the request identically.
Best Value
- 【65% Compact Design】GEODMAER Wired gaming keyboard compact mini design, save space on the desktop, novel black & silver gray keycap color matching, separate arrow keys, No numpad, both gaming and office, easy to carry size can be easily put into the backpack
- 【Wired Connection】Gaming Keybaord connects via a detachable Type-C cable to provide a stable, constant connection and ultra-low input latency, and the keyboard's 26 keys no-conflict, with FN+Win lockable win keys to prevent accidental touches
- 【Strong Working Life】Wired gaming keyboard has more than 10,000,000+ keystrokes lifespan, each key over UV to prevent fading, has 11 media buttons, 65% small size but fully functional, free up desktop space and increase efficiency
- 【LED Backlit Keyboard】GEODMAER Wired Gaming Keyboard using the new two-color injection molding key caps, characters transparent luminous, in the dark can also clearly see each key, through the light key can be OF/OFF Backlit, FN + light key can switch backlit mode, always bright / breathing mode, FN + ↑ / ↓ adjust the brightness increase / decrease, FN + ← / → adjust the breathing frequency slow / fast
- 【Ergonomics & Mechanical Feel Keyboard】The ergonomically designed keycap height maintains the comfort for long time use, protects the wrist, and the mechanical feeling brought by the imitation mechanical technology when using it, an excellent mechanical feeling that can be enjoyed without the high price, and also a quiet membrane gaming keyboard
Keybinds
Do not assume every InputEvent can be saved as a simple scalar. Decide how each action and event will be represented, how the representation will be restored, what happens when a saved action or event is missing or unsupported, and how the player returns to default bindings. The Godot input-handling tutorials index points to the relevant documentation area, but it does not define a serialization format. Check the InputMap and InputEvent references for your target Godot minor version before implementing concrete serialization and deserialization calls.
Save when a preference changes
When a control changes, update the in-memory preference, apply it immediately, and persist it. For a small settings file, saving after each user change is straightforward and limits the amount of unsaved state. Alternatively, a settings menu can defer writes and save a batch when it closes; that design requires handling cases where the game exits before the batch is saved.
func save_settings() -> Error:
config.set_value("audio", "master_volume", master_volume)
config.set_value("display", "fullscreen", fullscreen)
return config.save(SETTINGS_PATH)
Call this after updating the appropriate value and applying it. Do not report that preferences were saved if save() returns an error. The official reference documents that set_value() changes the in-memory object and that save() performs the write. Godot 4.5 ConfigFile reference
Reset preferences and handle write failures
A reset action should restore your chosen defaults, apply those defaults to the running game, and persist them so they remain in effect after restart. Keep the default values in one place to avoid having startup, reset, and UI code drift apart.
func reset_settings() -> void:
master_volume = 0.8
fullscreen = false
apply_audio_settings()
apply_display_settings()
var err := save_settings()
if err != OK:
push_error("Could not save settings: %s" % error_string(err))
apply_audio_settings() and apply_display_settings() here stand for functions implemented with the APIs and choices appropriate to your project; they are not ConfigFile methods. In a user-facing game, show an accurate message or log a clear error when a write fails, rather than displaying a success confirmation. A failure to save should not undo the currently applied preference, but it means the change may not survive a restart.
Quick Recap
Check the settings workflow
- Start with no settings file and confirm the game launches with defaults.
- Change a preference, exit normally, and restart to confirm the stored value is loaded and applied.
- Remove one key while retaining the file and confirm that only the missing key falls back to its default.
- Test reset behavior and confirm that the reset values persist across a restart.
- Exercise an unreadable or invalid settings file and confirm the game keeps safe defaults instead of treating preferences as critical data.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

