Skip to content

Today I learned / Game development

Game development notes

Small, practical lessons from making and releasing indie games: design, store pages, platform rules, live operations and the business side.

#Game development

How do I import a Steam event announcement in all languages at once?

Pasting a Steam event into the editor one language at a time means four fields times eleven languages. The editor has a CSV import at the top, but the format isn't documented. Export any event from the same editor first, and use that file as your template:

csv
language,body,subtitle,summary,title
english,"[p]Body in BBCode…[/p]",Subtitle,Summary,Out now in Early Access
korean,"…",…,…,…
thai,,,,

What made the import work:

  1. Keep the export's header and row order. An empty row means Steam shows English for that language, so english has to be filled.
  2. The editor calls Korean korean, while store page localization uses koreana.
  3. Use CRLF between rows, plain LF inside a field, and UTF-8 without a BOM. Quote any field that has a comma, a quote or a newline.
  4. Upload the inline images once. Their {STEAM_CLAN_IMAGE}/… URLs are the same in every language.

I keep one markdown file per language and use a small script to build import.csv. The script refuses to build while a placeholder is left in a body. That's how the Glimtide launch post went in, 11 languages in one click.

Event tools: https://partner.steamgames.com/doc/marketing/event_tools

#Game development

Why does my procedural arm IK flip the wrist or jump between frames?

An arm solver that places the elbow and wrist from scratch every frame is correct per frame and still twitches: a wrist twist of +170° and −190° look the same to the solver, so it picks either one and the hand spins half a turn between two frames.

What fixed it for me, in order of impact:

  1. Choose the twist nearest the previous frame, not the "canonical" one.
  2. Cap the change: elbow swivel and wrist twist move at most 25° per frame.
  3. Hold the hand where it was last frame before the solver gives up and sends the arm home.
  4. Give the body collision a small tolerance. With zero, an elbow grazing the belly by 5 mm pushed the whole arm half a metre sideways. 8 mm of skin-on-skin allowance stopped that.
python
def unwrap(angle, prev):
    # pick angle + k*360 closest to prev
    return angle - 360 * round((angle - prev) / 360)

def step(angle, prev, max_step=25.0):
    a = unwrap(angle, prev)
    return prev + max(-max_step, min(max_step, a - prev))

Hit this while generating animation clips in Blender with Python for a game's characters: frames with an arm bone turning faster than 30° per frame dropped from 703 to 383 on one character. Apply each smoothing step only if the arm still stays outside the body, or the smoothing pushes the hand back inside.

How do I make Unity asset GUIDs the same on every machine?

If a .meta never reaches git, or an editor script builds the same material on two machines, Unity gives the asset a random GUID each time and every prefab that pointed at it loses the reference.

Fix: derive the GUID from the asset path. A Unity GUID is 32 hex characters, so an MD5 fits:

python
import hashlib

def stable_guid(path: str) -> str:  # "Assets/Materials/Rock.mat"
    return hashlib.md5(("my-project:" + path).encode()).hexdigest()

The catch I found testing it: a file dropped into Assets with a ready .meta keeps that GUID, but AssetDatabase.CreateAsset always assigns a random one, and rewriting it mid-build destroys the object the builder holds. So a script fixes GUIDs after the build, with Unity closed, only for assets whose .meta is not in HEAD yet, and rewrites the old GUID in all text assets. A pre-commit hook runs it in check mode (asset without .meta, orphan .meta, duplicate or random GUID), and an [InitializeOnLoad] editor class runs git config core.hooksPath .githooks so every machine gets the hook.

Hit this when code-built prefabs opened on another machine with missing models and materials. Docs: Unity asset metadata.

Blender FBX: why are child objects rotated in Unity?

With Apply Transform (bake_space_transform=True) the Blender FBX exporter bakes the Z-up → Y-up conversion only into top-level objects. Anything parented under another object (a pane inside a door) arrives in Unity rotated and in the wrong place.

Fix: keep every object directly under the root, put the intended parent in the name, re-parent in Unity.

python
pane.parent = root
pane.name = "Pane_03__Door_A0"  # parent travels in the name
csharp
// editor script, after unpacking the model prefab instance
foreach (var t in all) {
    int cut = t.name.IndexOf("__");
    if (cut < 0) continue;
    var owner = all.FirstOrDefault(o => o.name == t.name.Substring(cut + 2));
    t.name = t.name.Substring(0, cut);
    if (owner != null) t.SetParent(owner, worldPositionStays: true);
}

I hit this generating vehicle models from Python in Blender. The glass was transparent, so nothing looked wrong; collider coordinates gave it away. The build now fails if a pane lands outside the vehicle.

Docs: Blender FBX export (Apply Transform is marked experimental).

#Game development

How do I test player input in Godot 4 headless, with real input actions?

Input.action_press() lets a headless test play the game through the same actions a player uses. But a press sent at the wrong moment of the frame is never seen by is_action_just_pressed(), and the test fails at random.

The fix: wait for process_frame (it fires right before every _process), press, hold for at least one frame, release.

gdscript
func press(action: String, hold_s: float = 0.0) -> void:
    await get_tree().process_frame   # start of a frame
    Input.action_press(action)       # lands before _process
    await get_tree().process_frame
    if hold_s > 0.0:
        await get_tree().create_timer(hold_s).timeout
    Input.action_release(action)
    await get_tree().process_frame

Run it from a user argument and quit with an exit code CI can read:

bash
godot --headless --path game -- --test   # OS.get_cmdline_user_args(), then get_tree().quit(0 or 1)

If you read input in _physics_process, await physics_frame instead.

Hit this while building a two-player co-op prototype: one script walks both players through a full scenario in about 80 seconds.

Docs: Input.action_press

#Game development

How do I stop a one-shot input from firing on every fixed-timestep step?

In a fixed-timestep sim a frame can run 0, 1 or 4 physics steps. A "pressed" flag (jump, drop, interact) that you simply overwrite each frame gets lost on a 0-step frame. So you OR it into the pending input instead, and clear it after the first step that reads it. My bug: drop was in the merge but missing from the clear, so one press of X kept dropping everything the player picked up afterwards.

The fix is to keep one list of one-shot fields and derive both the merge and the clear from it, so adding a new action can't break either:

ts
const ONE_SHOTS = ['jump', 'drop', 'interact', 'yank'] as const

// on every input message from a client (can arrive several times per step)
function mergeInput(pending: Input, next: Input): Input {
  const out = { ...next }
  for (const k of ONE_SHOTS) out[k] = pending[k] || next[k]
  return out
}

// at the end of each physics step
function consumeOneShots(i: Input) {
  for (const k of ONE_SHOTS) i[k] = false
}

Held inputs (move axes, "reel while held") stay out of the list and are just overwritten. Add a headless regression test: press once, step for half a second, then check the next pickup stays in hand.

Hit this in a host-authoritative co-op prototype (Rapier, 60 Hz steps, up to 4 per frame).

Background on fixed timesteps: https://gafferongames.com/post/fix_your_timestep/

How do I call Steamworks from a Vue + Electron game and get the overlay?

A Vue game in Electron can't talk to Steam on its own: steamworks.js is a native Node module, and the Steam overlay doesn't appear over Chromium's window by default.

Keep Steam in the main process and give Vue a small API through the preload script:

js
// main.js
const steamworks = require('steamworks.js')
const client = steamworks.init(2757440) // your App ID

ipcMain.handle('steam:unlock', (_e, id) => client.achievement.activate(id))
ipcMain.handle('steam:name', () => client.localplayer.getName())

steamworks.electronEnableSteamOverlay() // last line of main.js
js
// preload.js
contextBridge.exposeInMainWorld('steam', {
  unlock: id => ipcRenderer.invoke('steam:unlock', id),
  name: () => ipcRenderer.invoke('steam:name'),
})

In a Vue component it is then just await window.steam.unlock('FIRST_CARD'). The renderer keeps contextIsolation on, so you don't need the nodeIntegration: true shortcut from the README. When you package, unpack the .node binary from the asar (asarUnpack: ['**/*.node'] in electron-builder), or require fails in the shipped build only.

What I saw: everything worked in dev, the overlay never showed up, and it turned out electronEnableSteamOverlay() was missing. It adds the Chromium flags the overlay needs to hook the window.

Source: steamworks.js, Electron section

Why doesn't SetLive put my Steam build live on the default branch?

"SetLive" in a SteamPipe app_build script only works for beta branches. Steam refuses to set the default branch live automatically: that last step is always a click on the app's Builds page in Steamworks.

json
"AppBuild"
{
  "AppID" "1000"
  "Desc" "CI build"
  "SetLive" "staging"   // a beta branch, never "default"
  "Preview" "0"         // "1" = dry run: logs and manifest only, nothing uploaded
  "Depots" { "1001" "depot_build_1001.vdf" }
}
bash
steamcmd +login <account> +run_app_build ../scripts/app_build.vdf +quit

So my pipeline uploads every build straight to a private staging branch, I play it there, and promoting it to default stays a deliberate manual step. That is a feature, not a gap: CI can never ship to all players by itself. Also note that the account setting builds live on a released app needs Steam Guard via a phone or the mobile app.

Source: Steamworks: Uploading to Steam

How do I build an ECS where mechanics can be swapped while the game runs?

Keep all state in components as plain data and all code in modules that own no state. A snapshot is then just the stores, and swapping a mechanic is just swapping the systems that read them.

ts
world.add(e, 'Napping', {}) // state: plain data, saved in every snapshot

export default defineModule({
  id: 'siesta', version: '1.1.0',
  components: { Napping: { version: 2, migrate: { 1: old => ({ ...old, since: 0 }) } } },
  install(ctx) { /* one-time world changes */ },
  setup(ctx) { ctx.extend(ACTIONS_REGISTRY, 'siesta_nap', nap) }, // runs on every attach: never writes the world
  systems: [{ id: 'wake', every: 10, run(ctx) { /* query, then mutate */ } }],
})

In Glimtide every mechanic, even hunger, is a module installed into the live world between two ticks. The rules that make it work: no state in closures (an upgrade drops it), randomness only from the world's seeded RNG and time only from ticks, or a trial run on a snapshot can't be compared. More in the Glimtide write-up and the ECS FAQ.

Newsletter

Occasional notes on engineering, game tech, and new tools — no spam, unsubscribe anytime.

Ravy

Engineering manager, founder, and software developer building web platforms, game systems, real-time services, and automation tools. 15 years of shipped work — currently at Gaijin.net.

Get in Touch

Building an MVP, shipping a game feature, or automating a team workflow? Open source or paid — let's talk.

Contact Me
© 2020-2026 XPLOIT FZE. All trademarks, names and logos belong to their respective copyright holders.