Spielerando

Gathering Nodes

A gathering node is a tree, rock or herb patch with a few pickings in it. The player holds a button to take one, may need a better tool, and sometimes gets a lucky extra. A node picked clean stays empty for a while and then comes back full.

Also called: Resource nodes, Harvest points, Pickable spots, Respawning resources.

A lanky fox with a hooked pole lifts a glowing fruit from a round tree as a ring of light around it nearly closes, while a bare tree beside it shows one tiny new shoot.
Emberlantern Orchard, an invented foraging 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 "Gathering Nodes" to my game.

What it should do: Nodes put the materials of the world in places the player can find, learn and come back to. They turn walking around into a small hunt, and the limit on pickings and the wait for the node to return keep the world from running dry or being drained in a minute.

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

```mermaid
stateDiagram-v2
  [*] --> full
  full: Full
  worn: Partly picked
  depleted: Used up
  full --> worn: first picking taken
  worn --> full: all grown back
  worn --> depleted: last picking taken
  depleted --> full: node comes back
```

Use these starting values:
- maxCharges: 3 pickings
- gatherTime: 2 s
- regrowTime: 20 s
- respawnTime: 60 s
- bonusChance: 0.15 chance
- requiredTier: 1 level

Watch out for these common mistakes:
- Two players take the last picking: Tell your AI: let one place own the node. Handle the players one after the other and let each one's finish take the picking before the next one is checked.
- Letting go keeps the progress: Tell your AI: reset the progress to zero as soon as the player stops holding, steps away or switches tool.
- The node comes back and is picked on the same tick: Tell your AI: a node that was empty when the tick began cannot be picked on that tick. The hold counts from the next one.
- A long frame gives a whole node at once: Tell your AI: take at most one picking per tick, and keep the time that ran past for the next tick.
- The lucky roll is spent on nothing: Tell your AI: draw one random number for each picking, at the moment it is taken, and hand it in as a value.
- Regrowth restarts with every picking: Tell your AI: start the regrow timer only when none is running. Later pickings leave it alone.
- The wrong tool wastes the player's time: Tell your AI: check the tool as soon as the button goes down and refuse at once with a clear sign, so the player knows what is missing.

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

Nodes put the materials of the world in places the player can find, learn and come back to. They turn walking around into a small hunt, and the limit on pickings and the wait for the node to return keep the world from running dry or being drained in a minute.

How it runs, as a diagram

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

first picking takenall grown backlast picking takennode comes backFullPartly pickedUsed up
How it runs, as a diagram
  • Full → Partly picked: first picking taken
  • Partly picked → Full: all grown back
  • Partly picked → Used up: last picking taken
  • Used up → Full: node comes back

Good starting values

ValueStart withWhat it changes
maxCharges3 pickingsHow many pickings a full node holds. At least two, so that a node is always seen to run down before it goes empty. More pickings make the spot worth a longer visit.
gatherTime2 sHow long the player holds the button for one picking. Long enough to feel like work and to give the animation time, short enough not to bore. Rare nodes can take longer.
regrowTime20 sHow long one picking takes to grow back in a node that is not empty. It lets a patient player pick the same spot again without waiting for the whole node to return.
respawnTime60 sHow long an empty node stays empty before it comes back full. A minute is a good start: long enough to make the player move on, short enough to be worth returning to.
bonusChance0.15 chanceThe chance that a picking gives one extra item, from 0 to 1. A small surprise keeps routine work interesting. It costs the node nothing.
requiredTier1 levelThe tool level needed here. Zero means bare hands. A higher level gives a reason to improve tools and lets the world hold nodes the player cannot use yet.

What usually goes wrong

Two players take the last picking

Two players hold the button on the same node and both finish on the same tick. If each looks at the node separately, both get the last picking.

Fix: Tell your AI: let one place own the node. Handle the players one after the other and let each one's finish take the picking before the next one is checked.

Letting go keeps the progress

The progress stays when the player lets go. Tapping the button over and over then takes pickings in tiny pieces, and the hold time means nothing.

Fix: Tell your AI: reset the progress to zero as soon as the player stops holding, steps away or switches tool.

The node comes back and is picked on the same tick

An empty node returns on the tick the player is holding the button. If the picking can start at once, the player gets a picking from a node they could not see yet.

Fix: Tell your AI: a node that was empty when the tick began cannot be picked on that tick. The hold counts from the next one.

A long frame gives a whole node at once

One very long tick, for example after the game was stuck, adds up to more time than three pickings. If every full gather time in it counts, the node is emptied in a blink.

Fix: Tell your AI: take at most one picking per tick, and keep the time that ran past for the next tick.

The lucky roll is spent on nothing

The game draws a random number every tick. Then the bonus depends on the frame rate and on how often the player is checked, and a replay cannot reproduce it.

Fix: Tell your AI: draw one random number for each picking, at the moment it is taken, and hand it in as a value.

Regrowth restarts with every picking

Each picking sets the regrow timer back to full. A player who keeps picking never sees a picking grow back, and the node only ever runs down.

Fix: Tell your AI: start the regrow timer only when none is running. Later pickings leave it alone.

The wrong tool wastes the player's time

The player holds the button for two seconds with a tool that is too weak, and only then finds out nothing happens.

Fix: Tell your AI: check the tool as soon as the button goes down and refuse at once with a clear sign, so the player knows what is missing.

How to check it works

Works well with

Common questions

how do i add resource nodes to my game

Paste this: Add gathering nodes. Each node has 3 pickings. The player holds a button for 2 seconds to take one, and letting go starts the hold over. An empty node comes back full after 60 seconds, and a partly picked node grows one picking back every 20 seconds. Some nodes need a tool of a certain level.

how long should a node stay empty

Long enough that the player moves on and finds another one, and short enough that coming back is worth it. Start with about a minute for common things, and make rare things wait longer.

should the player be able to hold the button for several pickings in a row

Yes, it is kind: after a picking the hold carries on with the next one until the node is empty or the player lets go. Just make sure each picking still takes its full gather time.

why can two players both get the last item

Each one checks the node on their own and sees one picking left. Let one place own the node and handle the players one after the other, so the second one sees an empty node.

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