Spielerando

Crop Farming

Crop farming lets the player plant a seed, water it and harvest it later. The crop grows only while the soil is wet, ripens after a set time, rots if left too long, and wilts if it stays dry. Time away is worked out fairly, so a long break gives the same result as playing through it.

Also called: Farming, Planting and harvesting, Garden plots, Crop growing.

A small mole farmer in a wide hat waters a row of sprouts from a long-spouted can, with the same crop beside it as a seedling, a half-grown plant and a ripe plant with big orange fruit.
Pocketfurrow Acres, an invented cozy farm 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 "Crop Farming" to my game.

What it should do: Farming gives the player a slow, caring loop with a reward at the end. Planting is a small bet on the future, watering is the attention it asks for, and harvest day is the payoff that brings the player back.

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

```mermaid
stateDiagram-v2
  [*] --> empty
  empty: Bare soil
  growing: Growing
  ripe: Ready to pick
  wilted: Wilted
  empty --> growing: plants a seed
  growing --> ripe: grown enough
  growing --> wilted: dry for too long
  ripe --> empty: harvested
  ripe --> wilted: left for too long
  wilted --> empty: cleared away
```

Use these starting values:
- growTime: 120 s
- wetTime: 90 s
- witherAfter: 60 s
- rotAfter: 180 s
- harvestAmount: 3 items

Watch out for these common mistakes:
- The player was away for hours: Tell your AI: when time has passed, split it. The first part is wet time, as long as the soil stayed wet, and the rest is dry time. Only the wet part grows the crop.
- The crop ripens and rots in one long step: Tell your AI: when the crop ripens inside a step, count the rest of the step as ripe time, and check for rot right away.
- Watering before planting is wasted: Tell your AI: the wetness belongs to the soil, not to the crop. Let it run down on an empty plot, and keep it when a seed goes in or a crop is picked.
- Planting on a busy plot eats the seed: Tell your AI: only plant in an empty plot, and only take the seed when the game reports that something was planted.
- Picking too early destroys the crop: Tell your AI: harvest does nothing unless the crop is ripe. Show the player that the crop is not ready yet.
- One late watering is not forgiven: Tell your AI: any wet time starts the dry count over from zero.
- A seed that is planted in a long step ripens at once: Tell your AI: time that passes during the planting step does not count. The crop starts to grow on the next step.
- Growth keeps running on dry soil: Tell your AI: add to the growth only the wet part of each step.

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

Farming gives the player a slow, caring loop with a reward at the end. Planting is a small bet on the future, watering is the attention it asks for, and harvest day is the payoff that brings the player back.

How it runs, as a diagram

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

plants a seedgrown enoughdry for too longharvestedleft for too longcleared awayBare soilGrowingReady to pickWilted
How it runs, as a diagram
  • Bare soil → Growing: plants a seed
  • Growing → Ready to pick: grown enough
  • Growing → Wilted: dry for too long
  • Ready to pick → Bare soil: harvested
  • Ready to pick → Wilted: left for too long
  • Wilted → Bare soil: cleared away

Good starting values

ValueStart withWhat it changes
growTime120 sHow many seconds of wet soil a crop needs to ripen. Two minutes suits a quick first crop; longer crops should pay more.
wetTime90 sHow long one watering keeps the soil wet. Shorter than the grow time, so the player has to come back and water more than once.
witherAfter60 sHow long a growing crop may stay dry before it wilts. A forgiving window, so one missed watering is not the end. One watering starts the count over.
rotAfter180 sHow long a ripe crop may wait before it rots. Long enough that the player is not punished for a short break, short enough that the harvest matters.
harvestAmount3 itemsWhat one harvest gives. More than one, so that planting pays back more than the seed that went into it.

What usually goes wrong

The player was away for hours

The game was closed, and on return it gives the crop no growth at all, or the whole time as growth although the soil dried out after a minute.

Fix: Tell your AI: when time has passed, split it. The first part is wet time, as long as the soil stayed wet, and the rest is dry time. Only the wet part grows the crop.

The crop ripens and rots in one long step

A long step covers both the end of growing and a long wait afterwards. If the game only checks 'is it ripe now', a crop that rotted long ago is shown as fresh.

Fix: Tell your AI: when the crop ripens inside a step, count the rest of the step as ripe time, and check for rot right away.

Watering before planting is wasted

The player waters bare soil and then plants. If the game forgets the wet soil, the player has to water a second time, and it feels like a bug.

Fix: Tell your AI: the wetness belongs to the soil, not to the crop. Let it run down on an empty plot, and keep it when a seed goes in or a crop is picked.

Planting on a busy plot eats the seed

The player presses plant on a plot that already has a crop. The game takes a seed out of the bag but plants nothing, or it replaces the crop that was growing.

Fix: Tell your AI: only plant in an empty plot, and only take the seed when the game reports that something was planted.

Picking too early destroys the crop

The harvest button works on any crop. A player who presses it on an unripe plant loses the plant and gets nothing.

Fix: Tell your AI: harvest does nothing unless the crop is ripe. Show the player that the crop is not ready yet.

One late watering is not forgiven

The dry time keeps counting up even after the player waters, so a crop that was dry for 50 seconds, then watered, wilts 10 seconds into its next dry spell.

Fix: Tell your AI: any wet time starts the dry count over from zero.

A seed that is planted in a long step ripens at once

The player plants as the game catches up on a long stretch of time. If that time counts for the new seed, it is ripe in the same moment it was planted.

Fix: Tell your AI: time that passes during the planting step does not count. The crop starts to grow on the next step.

Growth keeps running on dry soil

The game adds time to the growth every tick, wet or not. Watering then does nothing, and the crop ripens even when it is ignored.

Fix: Tell your AI: add to the growth only the wet part of each step.

How to check it works

Works well with

Common questions

how do i add farming to my game

Paste this: Add farming. A plot can be empty, growing, ripe or wilted. A seed goes only into an empty plot. A crop grows only while the soil is wet, and watering keeps it wet for 90 seconds. After 120 seconds of growth it is ripe, and picking it gives 3 items. Dry for 60 seconds wilts it, and waiting 180 seconds when ripe rots it.

how do i grow crops while the player is away

Save the time when the player leaves. On return, take the time that has passed and give it to the plot as one long step. The plot works out how much of it was wet and how much was dry, so you never need to run every second.

should crops die if you forget them

A gentle version works best: a crop that stays dry for a minute wilts, but one that waits ripe for a few minutes only rots. A hard penalty on a short break makes a calm game feel stressful.

why does my crop ripen even when i never water it

The growth is added every tick, wet or not. Add only the part of each step in which the soil is wet.

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