You push a release on Friday afternoon. By Saturday morning, someone on Discord has found an exploit in Ranked mode, or a boss drop rate is ten times too generous and wrecking the in-game economy.

If those numbers are hardcoded, you're stuck building a hotfix, uploading a new binary, and waiting on platform review while players abuse it.

A single JSON file hosted over HTTPS fixes this. You can drive live balance tweaks, weekend events, and mode kill switches using Godot 4's built-in HTTPRequest and around 75 lines of GDScript. No third-party SDK to import or maintain. And if the player has no connection or your server goes down, the game falls back to the last good copy saved on disk without stalling startup.

1. The JSON Config & Schema

Keep your live settings in a flat, predictable JSON file:

{ "motd": "Double XP this weekend!", "double_xp": true, "modes": { "ranked": true }, "spawn_rate": 1.0 } 

The biggest mistake with remote JSON in a live game is pushing a typo. Change "spawn_rate": 1.0 to "spawn_rate": "1.5" (a string instead of a float) or accidentally delete a key, and you can break active clients. Guarding the endpoint with a JSON Schema stops bad pushes before they reach players:

{ "type": "object", "required": ["double_xp", "modes", "spawn_rate"], "properties": { "motd": { "type": "string", "maxLength": 200 }, "double_xp": { "type": "boolean" }, "modes": { "type": "object", "additionalProperties": { "type": "boolean" } }, "spawn_rate": { "type": "number", "minimum": 0.1, "maximum": 5 } } } 

If you host this on hotcfg, you attach the schema directly to the bin so invalid pushes get rejected at the door:

hotcfg bins create game-config --schema schema.json --public hotcfg push game-config.json --bin game-config --env production 

2. The Godot 4 Autoload (remote_config.gd)

Save this as remote_config.gd and register it under Project → Project Settings → Globals → Autoload as RemoteConfig.

It loads whatever config is cached in user:// right away on boot, then checks for updates in the background with a 2-second timeout. It also sends the saved ETag so unchanged configs return a bodyless 304 Not Modified, and it rejects mistyped keys before touching your live dictionary:

extends Node signal updated const URL := "https://api.hotcfg.run/v1/acme/game-config" const CACHE_PATH := "user://hotcfg.json" const DEFAULTS := {"motd": "", "double_xp": false, "modes": {"ranked": true}, "spawn_rate": 1.0} var config: Dictionary = DEFAULTS.duplicate(true) var _etag := "" var _http := HTTPRequest.new() func _ready() -> void: _load_cache() _http.timeout = 2.0 # seconds; then the cached or default config stays add_child(_http) _http.request_completed.connect(_on_request_completed) refresh.call_deferred() # start after boot, not during it func refresh() -> void: var headers := PackedStringArray() if _etag != "": headers.append("If-None-Match: " + _etag) _http.request(URL, headers) func get_value(key: String, fallback = null): return config.get(key, DEFAULTS.get(key, fallback)) func _on_request_completed(result: int, code: int, headers: PackedStringArray, body: PackedByteArray) -> void: if result != HTTPRequest.RESULT_SUCCESS or code != 200: return # offline, timed out, 304 or an error: keep what we have if not _apply(_parse(body.get_string_from_utf8())): return # malformed or unexpected: keep what we have _etag = _header(headers, "etag") var file := FileAccess.open(CACHE_PATH, FileAccess.WRITE) if file: file.store_string(JSON.stringify({"etag": _etag, "config": config})) updated.emit() # Copies known keys over the defaults. A key with the wrong type rejects the # whole update, so the game never runs on half of a bad config. func _apply(data) -> bool: if not data is Dictionary: return false var next: Dictionary = DEFAULTS.duplicate(true) for key in DEFAULTS: if data.has(key): if typeof(data[key]) != typeof(DEFAULTS[key]): return false next[key] = data[key] config = next return true # JSON.parse_string() logs an engine error on bad input; a bad body is an # expected case here, so check the return code instead. func _parse(text: String): var json := JSON.new() if json.parse(text) != OK: return null return json.data func _load_cache() -> void: if not FileAccess.file_exists(CACHE_PATH): return var saved = _parse(FileAccess.get_file_as_string(CACHE_PATH)) if saved is Dictionary and _apply(saved.get("config")): _etag = saved.get("etag", "") func _header(headers: PackedStringArray, name: String) -> String: for h in headers: var i: int = h.find(":") if i > 0 and h.substr(0, i).strip_edges().to_lower() == name: return h.substr(i + 1).strip_edges() return "" 

3. Reading Values & Reacting to Updates

In your main menu or gameplay scripts, apply whatever values you have immediately in _ready() and listen to the updated signal for when the network response lands:

func _ready() -> void: RemoteConfig.updated.connect(_apply) _apply() func _apply() -> void: $Motd.text = RemoteConfig.get_value("motd", "") $RankedButton.disabled = not RemoteConfig.get_value("modes", {}).get("ranked", true) 

Call RemoteConfig.refresh() whenever the player returns to the main menu. Long sessions pick up live changes without interrupting active gameplay.

Godot Gotchas & Tips

  • Numbers are always float: Godot parses every JSON number as a float. Cast with int() where you need an integer, and write numeric defaults as floats (1.0, not 1) so the typeof() check in _apply() matches.
  • Client-side defense: The JSON Schema stops bad config at push time. _apply() is your backup on the player's device in case a local cache file gets corrupted on disk.
  • Typed GDScript classes: If you prefer typed properties over dictionary lookups, hotcfg types --bin acme/game-config --lang gdscript -o game_config.gd generates a GameConfig class directly from your schema (GameConfig.from_dict(RemoteConfig.config)), with numbers already cast.
  • HTML5 / Web exports: Public bins send CORS headers out of the box, so HTTPRequest works in browser builds too.
  • Scheduled events: You can test a weekend event in staging and schedule it to promote and revert on its own when the event ends: hotcfg promote game-config --from staging --to production --at 2026-11-21T18:00:00Z --revert-at 2026-11-24T06:00:00Z

Note: I built hotcfg (free tier available for public configs), which powers the schema validation and edge caching in the examples above, though the GDScript autoload works with any HTTPS JSON endpoint. If you want to break a running game's config, test schema rejections, or simulate network cutouts in your browser, there's an interactive playground here.