Fast Travel
Fast travel lets the player jump to a place they have already stood at, behind a short fade of the screen. The price is paid when the journey starts and grows with the distance up to a ceiling. It is refused in a fight, during a journey and in a short wait after arriving.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Fast Travel" to my game.
What it should do: Walking the same long road again and again is dull. Fast travel gives the player a way back to places they know, for a price that keeps the world meaningful, and without letting it become an escape button.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> ready
ready: Ready
fading: On the way
cooling: Waiting
blocked: In a fight
ready --> fading: journey starts
fading --> cooling: arrives, wait begins
fading --> ready: arrives, no wait
fading --> blocked: arrives in a fight
cooling --> ready: the wait is over
cooling --> blocked: a fight starts
ready --> blocked: a fight starts
blocked --> ready: the fight ends
blocked --> cooling: fight ends, wait left
```
Use these starting values:
- baseCost: 5 coins
- costPerUnit: 0.2 coins per unit
- maxCost: 40 coins
- fadeTime: 1.2 seconds
- cooldown: 8 seconds
Watch out for these common mistakes:
- Escaping a fight: Tell your AI: refuse fast travel while a fight is going on, and say why on screen.
- Paying twice, or not at all: Tell your AI: charge once when the journey starts, and refuse any press while the fade runs.
- Places the player has not seen: Tell your AI: a place becomes known when the player stands there, and only known places can be travelled to.
- A long step: Tell your AI: when a step finishes the fade, give what is left over of that step to the wait.
- A fight begins during the fade: Tell your AI: remember the fight and let the journey finish. The player arrives, and travel stays blocked until the fight is over.
- A price that grows without end: Tell your AI: round the price up to whole coins and never let it pass a ceiling.
- Travelling to where you are: Tell your AI: ignore it, and charge nothing.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
Walking the same long road again and again is dull. Fast travel gives the player a way back to places they know, for a price that keeps the world meaningful, and without letting it become an escape button.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- Ready → On the way: journey starts
- On the way → Waiting: arrives, wait begins
- On the way → Ready: arrives, no wait
- On the way → In a fight: arrives in a fight
- Waiting → Ready: the wait is over
- Waiting → In a fight: a fight starts
- Ready → In a fight: a fight starts
- In a fight → Ready: the fight ends
- In a fight → Waiting: fight ends, wait left
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| baseCost | 5 coins | What every journey costs, however short, so that a hop across the street is not free. |
| costPerUnit | 0.2 coins per unit | What each unit of distance adds. At 0.2 a trip of 50 units costs 10 more than the base. |
| maxCost | 40 coins | The most a journey can cost. Without it, the far corners of a big map become too dear to ever use. |
| fadeTime | 1.2 seconds | How long the screen fades while the player is carried. Long enough to hide the change of scene, short enough not to feel like a loading screen. |
| cooldown | 8 seconds | The wait after arriving before the next journey. It stops chains of hops from replacing walking. Zero turns it off. |
What usually goes wrong
Escaping a fight
If fast travel works in a fight, it becomes a free way out of every danger and boss.
Fix: Tell your AI: refuse fast travel while a fight is going on, and say why on screen.
Paying twice, or not at all
Charging when the journey ends lets a second press during the fade start another journey, and the player pays twice or lands twice.
Fix: Tell your AI: charge once when the journey starts, and refuse any press while the fade runs.
Places the player has not seen
A map that lists every place lets the player jump to one they have never visited, past its gate or its story.
Fix: Tell your AI: a place becomes known when the player stands there, and only known places can be travelled to.
A long step
A slow frame can be longer than the fade. If the rest of it is thrown away, the wait after arriving starts too long.
Fix: Tell your AI: when a step finishes the fade, give what is left over of that step to the wait.
A fight begins during the fade
The screen is black, an enemy at the arrival place spots the player, and the game has to decide who wins.
Fix: Tell your AI: remember the fight and let the journey finish. The player arrives, and travel stays blocked until the fight is over.
A price that grows without end
A price that follows distance alone makes the far corners of a large map too dear to use at all.
Fix: Tell your AI: round the price up to whole coins and never let it pass a ceiling.
Travelling to where you are
A press on the place the player stands at charges coins and plays the fade for nothing.
Fix: Tell your AI: ignore it, and charge nothing.
How to check it works
- A player who has stood at the mill. They travel there and the fade of 1.2 seconds runs: They are still at the start after 1.19 seconds and at the mill after 1.21.
- A player with 100 coins and a trip that costs 15. The journey starts: They have 85 coins at once.
- Places 50, 120 and about 171 units apart, with the default prices. You ask for the price of each trip: They cost 15, 29 and 40 coins, the last one held at the ceiling.
- A player who has never stood at the harbour. They try to travel there: Nothing happens and no coins are spent.
- A player with 14 coins and a trip that costs 15. They try to travel: The trip is refused and they keep all 14 coins.
- A player in a fight. They try to travel: The trip is refused, and it works again when the fight ends.
- A journey is running and the player knows a second place. They try to travel there too: It is refused and only the first journey was paid.
- A player who has just arrived, with a wait of 8 seconds. They try again after 7.9 seconds and again after 8.1: The first try is refused and the second starts a journey.
- A player who stands at a new place. The game marks it as discovered, twice: The place is in the list once.
- A player at the hearth. They travel to the hearth: Nothing happens and no coins are spent.
Works well with
- Currency Wallet: The price comes out of the wallet when the journey starts. If your game has several kinds of money, decide which one travel uses. Check the wallet first, then start the journey.
- Ability Gates: Otherwise fast travel becomes a way around a gate that is meant to need an ability. Mark a place as known only when the player really stands there, after the gate is open.
- Day-Night Cycle: A long journey can cost game hours. Remember that scheduled events between the two times should still fire. Move the clock for the length of the journey after it ends.
Common questions
how do i add fast travel to my game
Keep a list of places the player has stood at, and let them jump to any of those for a price. Fade the screen, move the player, and give them a short wait before the next jump. Tell your AI to charge once, when the journey starts.
should fast travel cost anything
Usually yes, a little. A base price plus a part that grows with the distance, held at a ceiling, keeps the trip worth thinking about without making far places too dear.
should fast travel work during a fight
No. Otherwise it is a free escape from every danger. Refuse it while a fight is going on and show a short reason, so the player does not think the button is broken.
what do i tell my ai to add fast travel
Paste this: Add fast travel. The player can jump only to places they have stood at. A journey costs 5 coins plus 0.2 per unit of distance, rounded up and never above 40, and is paid once when it starts. The screen fades for 1.2 seconds, then the player is there, with an 8 second wait before the next journey. Refuse it in a fight, during a journey and when the player is short of coins.
Where it comes from
We could not find a reliable origin for this one yet.
What was checked
- 24 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it