Tuesday, 28 July 2026devblog

A goalkeeper with a brain

Tore out the old keeper and started building a real one. He cuts the shooting angle, rushes central shots and stays home for wide ones, driven by geometry rather than a line.

Day 39KEEPERBRAIN

Goalkeepers in most indie football games just teleport along their line. Tonight I tore out the old one and started building one that thinks.

  • A new C++ goalkeeper brain. The decision-making runs on a lightweight timer, not every frame.
  • He cuts the shooting angle: rushes off his line for central shots, stays home and central for wide ones.
  • Positioning is driven by real geometry, ball distance plus how central the attacker is, with a "relaxed" and a "danger" state.
Why won't you walk

The keeper computed the perfect position and refused to move. Fully possessed, walking mode, plenty of speed, input firing, velocity stuck at zero. It turns out movement input fired from a C++ timer just gets eaten on these AI pawns. Driving it from the pawn's Blueprint tick, exactly how the outfielders move, fixed it instantly. Hours of "why won't you walk," one-line answer.

Also killed tonight: a stale hardcoded pitch number that was creating an invisible wall stopping defenders from chasing to the byline. Another argument for one source of truth.

Next: diving saves with a "can he actually reach it?" catch-versus-parry system.

Shipped: C++ goalkeeper brain · angle-cutting positioning · stale pitch constant removed