All work
13 / 18Mobile web game· Go · PostGIS · incubating

TerraRun

Run a loop, own the land inside it.

A running game about land. Run a closed loop and the ground inside it becomes your territory, until somebody else laces up and takes it back.

  • Close a loop, own the land
  • Take it back by re-running
  • Live over WebSockets
  • Speed checks against cars
Read the sourcegithub.com/prabhavalabs/terrarun
TerraRun title and sign-in card over a dimmed map of Colombo
The TerraRun sign-in card over a map on a phone

Coverage to capture

85%

of the rival’s route, re-run

Claiming ground

  1. Run a loop with GPS on
  2. Finish within 50 m of the start
  3. The polygon inside is yours

Capped at 45 km/h

50 m
How close start and finish must be
85%
Route coverage needed to capture
25%
Maximum overlap with existing turf
45 km/h
Speed cap, so cars do not win

The itch

Running apps are excellent at telling you what you did: pace, distance, a medal for beating yourself. What they never give you is a reason to go out on the day you do not feel like it.

TerraRun borrows one from childhood games. Land. Run a loop and the area inside it is yours on a shared map. If someone wants it, they have to go and run it.

Turning a jog into a polygon

The rules had to be strict enough to be fair and loose enough to survive GPS.

  • A run counts as a loop if it ends within 50 metres of where it began.
  • The trace is simplified, then turned into a polygon and checked for area and overlap.
  • A territory can be anything from 500 square metres to 50 square kilometres.
  • A new claim may overlap existing turf by at most 25%, so you cannot simply draw a bigger circle around someone.

Taking territory

To capture someone’s land you re-run their route with at least 85% coverage. “Did you run the same route?” is a fuzzier question than it sounds, so similarity is measured geometrically, as the distance between your trace and a buffer zone around theirs.

A speed cap of 45 km/h keeps cars off the leaderboard.

Under the map

The map updates live over WebSocket. An in-memory spatial index answers “what is in this viewport?” quickly, while PostGIS remains the source of truth for the geometry.

What I do not know yet

Every game-balance number above is an environment variable, on purpose. I will not know the right values until real runners start arguing about them.

Where it stands

An early prototype: a Go backend and a React frontend that start with one command. There is no public server yet, and snapping traces to real roads is still on the list.