TExcelTAD

Common Mistakes

Most people who set out to make games run into the same handful of traps. None of them are about talent; they are about how the time gets spent. Here are the ten most common, why they happen, and what to do instead.

1. Learning several engines at once

Switching between Unity, Unreal and Godot every few weeks feels like research, but it resets your progress each time. The concepts transfer; the muscle memory and API knowledge don't. Instead: pick one engine with Choosing an Engine and stay until you've shipped two or three small games.

2. Starting with the dream game

An MMO, an open-world RPG, "like Skyrim but…": these are made by hundreds of people over years. A first attempt stalls under its own weight, and the lesson learned is "I'm bad at this" instead of "the scope was wrong". Instead: make the smallest version of one mechanic from your dream game, as its own tiny game. See Scope & Dev Logs.

3. Only studying, never building

Tutorials feel productive because they always work. Real development is mostly the part tutorials skip: things not working and you figuring out why. Instead: after each topic, build something small without the tutorial open. Change a tutorial project until it's yours.

4. Writing an engine before a game

Writing an engine is a fascinating project, and a common way to never make a game. Instead: make games in an existing engine first. Write an engine when engine programming is the goal; Game Engine Architecture in C++ is the course for that.

5. Optimizing without measuring

Programmers are famously bad at guessing where time goes. Hours spent micro-optimizing a function that costs 0.01 ms don't help a frame that's slow because of one expensive search. Instead: profile first, then optimize the biggest cost, then measure again. When something really is slow, the fix is usually a better algorithm, not a faster loop. Counting the work makes that visible:

js · try it yourself
// Find pairs of enemies closer than 2 units: compare everyone with everyone,
// or put them in a grid and only compare enemies in neighbouring cells.
let seed = 7;
const rand = () => (seed = (seed * 16807) % 2147483647) / 2147483647;

function countChecks(n) {
  const enemies = Array.from({ length: n }, () => ({ x: rand() * 100, y: rand() * 100 }));
  const naive = (n * (n - 1)) / 2;

  const cell = 2, grid = new Map();
  for (const e of enemies) {
    const key = `${Math.floor(e.x / cell)},${Math.floor(e.y / cell)}`;
    grid.set(key, (grid.get(key) ?? 0) + 1);
  }
  let gridChecks = 0;
  for (const [key, count] of grid) {
    const [cx, cy] = key.split(",").map(Number);
    for (let dx = -1; dx <= 1; dx++)
      for (let dy = -1; dy <= 1; dy++) gridChecks += count * (grid.get(`${cx + dx},${cy + dy}`) ?? 0);
  }
  console.log(`${String(n).padStart(5)} enemies: naive ${String(naive).padStart(7)} checks, grid ~${String(Math.round(gridChecks / 2)).padStart(5)} checks`);
}
countChecks(100);
countChecks(1000);
countChecks(5000);
  100 enemies: naive    4950 checks, grid ~   73 checks
 1000 enemies: naive  499500 checks, grid ~ 2267 checks
 5000 enemies: naive 12497500 checks, grid ~46377 checks

At 100 enemies the naive version is fine, and optimizing it would be wasted effort. At 5000 it's millions of checks per frame and the grid is hundreds of times less work. Measure, then decide.

6. Skipping the math

You can get surprisingly far by copying vector code, until a camera spins the wrong way or an enemy aims behind itself. Instead: learn vectors, dot and cross products, transforms and coordinate spaces early. It pays off in every engine. → Math for Games

7. "It works in the editor" = done

A game isn't finished when it runs on your machine in the editor. Builds have different settings, missing files, other resolutions, other controllers and other performance. Instead: make a standalone build early and often, and have someone else run it. See Field Notes: Shipping.

8. Over-engineering

A plugin system, an abstract IWeaponFactoryProvider and an event bus for a game with three weapons slows you down today for a flexibility you may never need. Instead: write the simplest code that works, and refactor when a real second or third case appears. Duplication is cheaper to fix than the wrong abstraction.

9. Trusting the client in multiplayer

In online games, anything the player's machine says can be faked: positions, damage, scores, purchases. Instead: make the server authoritative for anything that matters, validate inputs, and design for this from the first prototype. Multiplayer is very hard to retrofit. → Multiplayer Game Networking

10. Committing secrets

Store API keys, Android signing keystores, server passwords and access tokens end up in public repositories more often than you'd think, and bots scan for them constantly. Instead: keep secrets out of the repository (environment variables, CI secret stores, a local file listed in .gitignore), and rotate any secret that ever got committed; deleting it in a later commit doesn't remove it from history.

A short checklist

Before starting a new project, check:

  • Is it small enough to finish in the time I have (and then half of that)?
  • Is it in the engine I'm learning, not a new one?
  • Is the core loop testable with grey boxes in the first week?
  • Is version control set up, with secrets excluded?
  • When will a stranger first play a build?

Test yourself

What does the enemy-pair example show about optimization?

  1. Always use a grid
  2. At small sizes the naive approach is fine; measure, and when it matters an algorithmic change wins
  3. JavaScript is slow
  4. Grids are always slower

You committed an API key and deleted it in the next commit. Is it safe?

  1. Yes, it's deleted
  2. No: it's still in the history, so rotate (replace) the key
  3. Only if the repository is private
  4. Yes, if you force-push

Which approach to architecture does the lesson recommend?

  1. Design every system for maximum flexibility up front
  2. Write the simplest code that works and refactor when real repeated needs appear
  3. Never refactor
  4. Use an event bus for everything