A state machine is a way to model systems that can only be in one discrete state at a time, and can only move to other states through defined transitions. A traffic light is a simple state machine: it cycles Green → Yellow → Red → Green. It can’t go from Green directly to Red. In our LLM playing Fire Emblem project, we use a deterministic action execution system that acts like a state machine. The LLM sends high-level commands (“Select Eliwood” → “Move to [5,3]” → “Attack Bandit”), and the executor validates preconditions, executes the button sequence, waits for the state transition, and verifies the result. If the action fails (maybe Eliwood was already exhausted), it retries with a different approach and feeds the result back to the LLM. No more blind button mashing—the system now knows what state it’s in and what transitions are valid.
