openskills.info
Open Course

Gameplay Programming

Gameplay programming is the code that turns a game engine into a playable game: character movement, AI decisions, menus reacting to input, and the rules that decide what happens when things collide.

itSoftware engineering

Recommended first:game-engine-fundamentals

Don't Panic — Gameplay Programming

Gameplay programming is the bit that tells an engine what the game means. The engine can draw a heroic sword, load an extremely heroic sword texture, and simulate the sword falling down some stairs. Gameplay code decides whether it hits an enemy, opens a door, or becomes a pickup that immediately causes three more problems.

The useful mental model starts with time. A game loop reads input, changes state, and renders the result. Fixed timestep means the simulation advances in equal-sized steps even when rendering does not. The renderer produces time; the simulation consumes whole steps from an accumulator. That separation keeps physics and rules predictable instead of making them depend on whichever machine had a busy afternoon.

Then comes composition. A character is not obliged to become a gigantic class containing movement, health, sound, collision, and a small cupboard for unrelated features. Components split those responsibilities into pieces attached to an object, node, or entity. The pieces still need a way to cooperate, which is where shared state, direct references, and messages earn their keep—and occasionally conceal the order in which something happened.

Conditional behavior needs a shape too. A finite state machine gives a character one active mode, such as grounded, jumping, or ducking, with defined transitions. It prevents the classic situation where a character is both crouching and standing because several booleans have formed a committee. When NPC decisions need layered alternatives rather than a short list of modes, a behavior tree combines choices, sequences, tasks, and a blackboard of shared facts.

Input and reactions are deliberately indirect. A command lets a physical button become an action such as Jump, so rebinding changes a mapping rather than the gameplay rule. An observer or signal lets UI, sound, and achievements react to an event without the combat code knowing their addresses. Physics then reports contact; gameplay decides whether it is a solid collision or a trigger for a pickup, checkpoint, or zone. This is the point at which a game stops being a collection of systems and starts behaving like somebody planned it.

Read the intro for the complete architecture and engine comparisons. Use the slides to keep the loop, components, state, and event relationships in one view. The cheatsheet is for callback order and quick comparisons. The practice reference supplies pattern skeletons; the exercise makes their timing and trigger behavior visible in a small scene. Field Notes covers the expensive surprises hiding behind otherwise sensible abstractions.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources