Skip to content

Can AI Solve Godot's Stairs Problem?

2 min readBuild log ·

Can an AI model build a first-person character controller that walks stairs and slopes the way a shipped game does? Claude Opus 5.5 in Claude Code got a small Godot test course, twelve lanes of slopes, steps, two flights of stairs, a kerb, a low ceiling, bumps and a drop, and the character script Godot starts you with, which stops dead at a 20 centimetre kerb. One rule made it hard: no invisible ramps over the stairs.

AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.

Intel or AMD Chromebook, with Linux turned on.

Download for macOSDownload for WindowsDownload for Linux

The test

First, how shipped games handle it: a horse up a mountain in Skyrim, a soldier stuck at a staircase in Battlefield 4, a flight of stairs in Half-Life 2, and the ramp a Counter-Strike mapper lays over the steps. Then the result is held to ten things a shipped first-person game does, we look at how it is built (a capsule, a cylinder that got thrown into the air, and a box that never turns), it dresses the blockout as a stone yard, and what the playtest finds goes back as bug reports.

The prompt

The exact prompt it got:

This is a small first-person Godot game that already runs: a test course for a character controller, and a player who walks it. The course is twelve lanes side by side, each holding one thing a player meets in a level: slopes, steps, two flights of stairs, a kerb, a low ceiling, bumps, a drop. It is built from code when the game starts (course/course.gd, from the numbers in course/course.json). The player (player/player.gd, in scenes/course.tscn) is Godot's own CharacterBody3D template with mouse look added, and on this course it shows: it stops dead at a kerb, it can't walk up the stairs, and from the top of them it walks off into the air and falls the whole flight. Read the course and the player first, and walk the course. Then make the player move over slopes and stairs the way the player of a good shipped first-person game does, so that someone playing never has to think about the ground. He walks up and down stairs and over steps up to 35 centimetres high without stopping, and anything taller is a wall. Slopes up to 45 degrees are ground, walked at an even pace up and down, and anything steeper can't be climbed. The view glides over steps instead of jolting. Keep the walking speed and the jump as they are, keep the controls, and keep the course exactly as it is: don't move, resize or smooth anything on it, and don't add helpers to it such as invisible ramps. The work is in the player. Keep the player's node at Course/Player with its camera under it, because our playtest drives the game through them. Run and test the game only through Flockbay's tools: flockbay_play, flockbay_run_headless, flockbay_script_errors, flockbay_game_input, flockbay_game_get, flockbay_game_set, flockbay_game_screenshot, flockbay_last_run and flockbay_stop. Don't start Godot from your own shell, and if one of those tools can't do something you need, say exactly what was missing in your handover. Test your own work, fix what you find, and hand it over when you think it's done.

What was judged

The scorecard, row by row, pass by pass, against the starting game.

How it feels in the footage: the same drives filmed in first person and from beside the player, held against released games doing the same thing.

How it is built: the step-up, the step-down and the camera, read in its own code. This is the essay.

What it took: passes, minutes, calls, Plays, and the estimated API bill.

More on this: Can AI Build a 500-Enemy Horde in Godot?

In the video

  1. 0:00 How games handle stairs, good and bad
  2. 0:28 Godot's starter script, stuck at a kerb
  3. 0:46 The job: no invisible ramps
  4. 0:57 How a step move works
  5. 1:32 Thirteen minutes later
  6. 2:19 Under the hood: capsule, cylinder, box
  7. 3:15 Trying to break it
  8. 3:32 The look: a stone yard
  9. 3:53 Two bug reports
  10. 4:24 The bill and the lesson

It ran in Claude Code, on Flockbay’s MCP server

Claude Opus 5.5 ran in Claude Code for 13 minutes on the prompt above, with Flockbay’s tools connected over MCP: 26 calls to Flockbay’s tools and 24 to Claude Code’s own. Every call, from the run’s transcript:

ToolCalls
Bash13
Edit8
flockbay_run_headless8
flockbay_game_input5
flockbay_play4
flockbay_game_set3
flockbay_game_get2
Read2
flockbay_guide1
flockbay_last_run1
flockbay_script_errors1
flockbay_stop1
Write1

Godot’s output caught the first bug

The first check that failed was flockbay_run_headless on res://tests/walk_course.tscn. The lines it returned that name the problem:

Output
Ran res://tests/walk_course.tscn headless: it quit by itself with exit code 1 after 60.00 s of game time (frame 3600 of 7200).
[10] slope20  FAIL reached end, never airborne, kept pace, back at ground | end z -24.29 y 0.00  max y 2.00  air 0  pace 4.69..5.00 m/s  body dy/tick 0.030  eye dy/tick 0.030  drift 0.000
[21] RESULT FAIL (1 lanes)

The next edit went to res://tests/walk_course.gd

The next edit Claude Code made after that check, through Bash:

Terminal
sed -i 's/const WALK_SECONDS := 5.0/const WALK_SECONDS := 6.5/' tests/walk_course.gd

res://tests/walk_course.gd as it was handed over

Lines 1 to 31 of 112, from the game folder at the end of the build.

GDScript
extends Node
## Walks the player straight down every lane of the course, holding forward
## the way a player does, and checks what happens against what each lane is
## for. Prints one line per lane and quits 0 when every lane passes.

const COURSE := preload("res://scenes/course.tscn")
const WALK_SECONDS := 6.5

## What each lane should do: "through" walks it end to end without stopping,
## "blocked" stops at the obstacle at ground level, "drop" falls off its end.
const EXPECT := {
	"flat": "through", "slope20": "through", "slope40": "through",
	"slope55": "blocked", "steps": "through", "ledge55": "blocked",
	"stairs18": "through", "stairs30": "through", "kerb45": "through",
	"ceiling": "blocked", "bumps": "through", "drop": "drop",
}

var course: Node3D
var player: CharacterBody3D
var camera: Camera3D
var lanes: Array = []
var lane_index := -1
var tick := 0
var rows: Array = []
var failures := 0


func _ready() -> void:
	course = COURSE.instantiate()
	add_child(course)
	player = course.get_node("Player")

The results, measured

Godot's starter scriptClaude Opus 5.5, as it ended
Walking pace and jump on the flat5.00 m/s, 107 cm5.00 m/s, 107 cm
The 40° slope, up and down2.93 m/s up, 5.03 down3.82 up, 3.83 down
Standing on a slopeno driftno drift
The 55° slope, walking and jumping at itnot climbednot climbed
Steps of 10, 20 and 30 cm, forwards10 cm onlyall three, at pace
The same steps backwards and sideways10 cm onlyall three, both ways
A 20 cm kerb met at 45°not climbedon and off at full pace
The 55 cm ledgea walla wall
Two flights of stairs, up and downneither climbed5.00 m/s on both, both ways
Walking off the top of a flight56 cm above the steps, 39 ticks in the airstays on them, no tick off the floor
The view on 18 cm risersnot climbed7.7 cm a tick at most
A 30 cm step under a low ceilingnot climbednot climbed, and holds still
Bars and cobblesnever under 90% of pacenever under 100%
The fall off a 1.2 m ledge0.52 s0.45 s (free fall 0.49)
Jumping up a flight: longest hang in the air3 ticks1 tick (17 on the first pass)
Jumping at the 1.2 m ledge from belownever on topnever on top (on top after the first fix)
Rows of the scorecard8 of 1616 of 16, after each of four passes
Time and estimated bill at API prices37.5 minutes, $16.15

Costs are estimates at public API prices, read on the day. The run went through a subscription.

From the filmed games

The test course once it was dressed, in first person at the foot of a flight of sandstone steps between dark timber posts, with a steeper timber flight to the right, a low wall, cypresses and hazy hills in low sun.
The test course once it was dressed, in first person at the foot of a flight of sandstone steps between dark timber posts, with a steeper timber flight to the right, a low wall, cypresses and hazy hills in low sun.
The starting game in first person, stopped against the first riser of the same flight as a plain blue blockout, with a red block and lighter blue steps to its left.
The starting game in first person, stopped against the first riser of the same flight as a plain blue blockout, with a red block and lighter blue steps to its left.
Claude Opus 5.5's first pass seen from the side on the blockout: a white box, the player's collision shape drawn in, starting up a flight of blue steps, with a dotted line behind it where the camera went.
Claude Opus 5.5's first pass seen from the side on the blockout: a white box, the player's collision shape drawn in, starting up a flight of blue steps, with a dotted line behind it where the camera went.
The dressed course from the start line: a grass bank, a faceted rock slope, sandstone steps, the stone and timber flights of stairs, and the lane label 55 cm ledge painted on the paving.
The dressed course from the start line: a grass bank, a faceted rock slope, sandstone steps, the stone and timber flights of stairs, and the lane label 55 cm ledge painted on the paving.

Built in Flockbay, a free AI game maker built on Godot.

Download Flockbay free

AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.

Intel or AMD Chromebook, with Linux turned on.

Download for macOSDownload for WindowsDownload for Linux

Flockbay

The free AI game maker for Windows, macOS and Linux.