Resource HarvestingResource

Player or AI units collect raw resources from the world that fuel construction, production, or advancement.

A resource node depletes as it is mined: each strike chips an ore chunk into the stockpile and shrinks the rock through stages until it is spent and respawns.

How resource harvesting works in Godot

Area2Dnode

A resource node (mineral patch, tree) with a finite amount. Collectors overlap it and draw down its reserve until it depletes and frees.

var amount := 1500
func extract(n) -> int:
    var taken = min(n, amount)
    amount -= taken
    if amount <= 0: queue_free()
    return taken

NavigationAgent2Dnode

Drives the collector's round trip: path to the node, harvest, path back to the depot. The shuttling loop is the economy's heartbeat.

agent.target_position = patch.global_position
# on arrival: harvest, then
agent.target_position = depot.global_position

Timernode

Gates harvest rate — a worker fills its load over a few ticks rather than instantly, which is what makes worker count matter.

$HarvestTime.wait_time = 2.0
$HarvestTime.timeout.connect(func(): carrying = patch.extract(10))

In short: Resource nodes with depletion state; collector units with pathfinding; global resource counters per faction

Retro games that use resource harvesting

20 catalogued game(s) use this mechanic, spanning 1987–1999.

Related resource mechanics

▶ Explore Resource Harvesting interactively — see every game + the Godot system