Spielerando

Tech Tree

A tech tree is a set of projects the player researches over time. Each has a price, an amount of work and other projects that must be finished first. One runs at a time while the rest wait in a queue. The price is paid at the start, and cancelling gives back only part of it.

Also called: Research tree, Technology tree, Research queue, Unlock tree.

On a floating island, a tree-shaped network of glass tubes and bridges links glowing finished workshops, while small mole engineers build a half-finished dome and two dimmed platforms wait behind it.
Pipkettle Isles, an invented island-building game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Tech Tree" to my game.

What it should do: A tech tree gives the player a long goal to plan toward. Choosing what to research next, and waiting for it, makes each unlock feel earned and shapes how the player plays in between.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> idle
  idle: Nothing queued
  researching: Researching
  stalled: Waiting for money
  idle --> researching: queues, can pay
  idle --> stalled: queues, cannot pay
  stalled --> researching: income covers the price
  stalled --> idle: queue cancelled
  researching --> idle: last one ends or goes
  researching --> stalled: ends, next unaffordable
```

Use these starting values:
- researchRate: 1 work/s
- cancelRefund: 0.5 x
- queueLimit: 4 projects
- startingBank: 25 money

Watch out for these common mistakes:
- Paying at the wrong moment: Tell your AI: take the price when the project starts, and let it wait without a price while it is in the queue.
- A cancelled project that others wait on: Tell your AI: when a project goes, take out every queued project that needs it, and every project that needs those.
- Time lost between two projects: Tell your AI: carry the rest of the time over to the next project in the same tick.
- Cancel and restart for money: Tell your AI: refund only a share of the price, less for work already done, and lose the work, so a restart always costs something.
- Waiting for money with nothing to say: Tell your AI: keep that state apart from idle, show that research is waiting for money, and start the project the moment income covers it.
- Tree with a loop or a missing project: Tell your AI: check the whole tree once, when the game loads, and list every loop and every missing project.

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

A tech tree gives the player a long goal to plan toward. Choosing what to research next, and waiting for it, makes each unlock feel earned and shapes how the player plays in between.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

queues, can payqueues, cannot payincome covers the pricequeue cancelledlast one ends or goesends, next unaffordableNothing queuedResearchingWaiting for money
How it runs, as a diagram
  • Nothing queued → Researching: queues, can pay
  • Nothing queued → Waiting for money: queues, cannot pay
  • Waiting for money → Researching: income covers the price
  • Waiting for money → Nothing queued: queue cancelled
  • Researching → Nothing queued: last one ends or goes
  • Researching → Waiting for money: ends, next unaffordable

Good starting values

ValueStart withWhat it changes
researchRate1 work/sHow much work gets done each second. It sets how long the projects take, and is never zero, or research would stand still for ever.
cancelRefund0.5 xThe share of the price handed back for the unfinished part of a cancelled project. The work already done is lost, so changing your mind always costs something.
queueLimit4 projectsHow many projects may wait behind the running one. A short queue keeps the player choosing, a long one lets them plan an evening ahead.
startingBank25 moneyWhat the player has when the game begins. Enough for the first project or two, so research can start at once.

What usually goes wrong

Paying at the wrong moment

If the price is taken when a project is queued, a long queue locks up the player's money for ages, and cancelling it needs a refund. If it is never taken, the player queues things they cannot afford.

Fix: Tell your AI: take the price when the project starts, and let it wait without a price while it is in the queue.

A cancelled project that others wait on

If a project is taken out of the queue but those that need it stay, a project is left waiting for something that will never finish, and the queue is stuck for ever.

Fix: Tell your AI: when a project goes, take out every queued project that needs it, and every project that needs those.

Time lost between two projects

A long tick or a slow frame can run past the end of a project. If the rest of the time is dropped, many short projects take much longer than they should.

Fix: Tell your AI: carry the rest of the time over to the next project in the same tick.

Cancel and restart for money

If a cancel gives back the full price and keeps the work done, the player can cancel and restart for free, or refund and be paid for the pause.

Fix: Tell your AI: refund only a share of the price, less for work already done, and lose the work, so a restart always costs something.

Waiting for money with nothing to say

A queue whose first project cannot be paid just sits there, and the player does not know why nothing is happening.

Fix: Tell your AI: keep that state apart from idle, show that research is waiting for money, and start the project the moment income covers it.

Tree with a loop or a missing project

A project that needs itself, directly or through others, can never be started. One that needs something that does not exist is the same.

Fix: Tell your AI: check the whole tree once, when the game loads, and list every loop and every missing project.

How to check it works

Works well with

Variations: Skill Tree.

Common questions

what do i tell my ai to add a tech tree

Paste this: Add a tech tree: projects with a price, an amount of work and a list of projects that must be finished first. Run one at a time, queue the rest in order behind the ones they need, pay the price when a project starts, carry spare time over to the next project, and take out dependants when a project is cancelled.

what is the difference between a tech tree and a skill tree

A skill tree is spent at once with points and belongs to the character. A tech tree takes time and money, runs a project at a time, and usually belongs to a group, a town or the whole world.

should the player pay for research when it is queued or when it starts

When it starts. A queue then costs nothing until its turn, and cancelling a waiting project needs no refund. The price is the player's decision at that moment.

should a tech tree allow more than one project at once

It can. Give each running project its own place and share the research rate between them. One at a time is easier to read, and makes the order of choices matter more.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

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