DEV Community

Ed Orellana
Ed Orellana

Posted on Originally published at flockbay.com

Can AI Solve Godot's Stairs Problem?

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.

Source: https://flockbay.com/blog/claude-opus-5-5-builds-a-godot-character-controller-for-stairs-and-slopes/ · Updated 2026-10-11

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.

In the video

  • 0:00 How games handle stairs, good and bad
  • 0:28 Godot's starter script, stuck at a kerb
  • 0:46 The job: no invisible ramps
  • 0:57 How a step move works
  • 1:32 Thirteen minutes later
  • 2:19 Under the hood: capsule, cylinder, box
  • 3:15 Trying to break it
  • 3:32 The look: a stone yard
  • 3:53 Two bug reports
  • 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:

Tool Calls
Bash 13
Edit 8
flockbay_run_headless 8
flockbay_game_input 5
flockbay_play 4
flockbay_game_set 3
flockbay_game_get 2
Read 2
flockbay_guide 1
flockbay_last_run 1
flockbay_script_errors 1
flockbay_stop 1
Write 1

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:

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)
Enter fullscreen mode Exit fullscreen mode

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

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

sed -i 's/const WALK_SECONDS := 5.0/const WALK_SECONDS := 6.5/' tests/walk_course.gd
Enter fullscreen mode Exit fullscreen mode

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.

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")
Enter fullscreen mode Exit fullscreen mode

Download Flockbay free: Built in Flockbay, a free AI game maker built on Godot. https://flockbay.com/free-ai-game-maker/

Related: The doors episode: another first-person mechanic in Godot, The save and load episode, How to make games in Claude Code

I make Flockbay, a free AI game maker built on Godot. The original is on flockbay.com.

Top comments (0)