gitwtfhub

wtf is medieval-settlement-threejs?

seloslav/medieval-settlement-threejs — explained in plain English

Analysis updated 2026-05-18

44TypeScriptAudience · developerComplexity · 4/5Setup · moderate

TL;DR

A real-time Three.js sandbox game where you build roads and buildings to grow a medieval settlement, with an authoritative SpacetimeDB economy running the simulation.

Mindmap

mindmap
  root((settlement game))
    What it does
      Procedural terrain
      Road building
      Village economy
    Tech stack
      TypeScript
      Three.js
      Rust
      SpacetimeDB
    Use cases
      Sandbox city building
      Economy simulation study
      Road network rendering
    Setting
      Medieval Croatia
      Folk art menus

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Play a browser-based medieval settlement builder with procedurally generated terrain.

REASON 2

Study how road networks, bridges, and terrain projection are implemented in Three.js.

REASON 3

Learn how a SpacetimeDB Rust module can drive an authoritative multiplayer-style game economy.

REASON 4

Use the project's design docs as a template for keeping AI-generated game art visually consistent.

What's in the stack?

TypeScriptThree.jsRustSpacetimeDBWebGPU

How it stacks up

seloslav/medieval-settlement-threejs0xbennie/binance-smart-money-trackeraeneasr/dockerstats
Stars444444
LanguageTypeScriptTypeScriptTypeScript
Last pushed2021-04-07
MaintenanceDormant
Setup difficultymoderatemoderatehard
Complexity4/53/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

Requires running both the SpacetimeDB Rust module and the Three.js client to see the full simulation.

License terms are not stated in the README.

Wtf does this do

medieval-settlement-threejs is a real-time 3D sandbox game built with Three.js, where players grow a medieval village on a procedurally generated landscape of hills, forests, and rivers. When starting a new game, you choose the map size, terrain shape, water layout, forest density, and a world seed before the landscape is generated. The core activity is drawing dirt road networks across the terrain, which automatically follow the ground's slope, snap to existing roads, and build wooden bridges with graded ramps whenever a road needs to cross a river. Along those roads, players place production buildings such as mills, quarries, wells, and woodcutter's lodges, which harvest timber, stone, water, and food from the surrounding land. Homes are placed along road frontage as well, and settlers move in over time as long as delivery crews, shown as wooden carts traveling the roads, keep them supplied with firewood, water, and food. Players assign workers from a shared labor pool to keep this supply chain running, and can plant backyard gardens for extra food and village income. The setting is a highland region of Croatia around the 1500s to 1600s, with regional building materials, market goods, and forest species reflecting that time and place, though the README notes this is a starting point rather than a fixed requirement. The visual style for menus uses a folk-art look with flat colors and bold outlines, while 3D buildings follow a shared design language documented in the project so that new buildings or textures, including ones generated by an AI assistant, stay visually consistent with the rest of the game. Under the hood, a SpacetimeDB server module written in Rust runs the authoritative economy simulation, tracking resources, population, construction, and road logistics, while the Three.js client renders the shared game state in real time. The game includes a HUD showing resources, population, and housing, a cheat mode for topping up resources during testing or screenshot builds, and detailed construction logistics where buildings are built in stages as workers deliver materials. The full README is longer than what was shown.

Yoink these prompts

Prompt 1
Explain how medieval-settlement-threejs generates bridges automatically when a road crosses a river.
Prompt 2
How does this project use SpacetimeDB to run the settlement's economy simulation?
Prompt 3
Walk me through the road-drawing and terrain-projection system in this codebase.
Prompt 4
What design document should I follow if I want to add a new building type consistent with this project's art style?

Frequently asked questions

wtf is medieval-settlement-threejs?

A real-time Three.js sandbox game where you build roads and buildings to grow a medieval settlement, with an authoritative SpacetimeDB economy running the simulation.

What language is medieval-settlement-threejs written in?

Mainly TypeScript. The stack also includes TypeScript, Three.js, Rust.

What license does medieval-settlement-threejs use?

License terms are not stated in the README.

How hard is medieval-settlement-threejs to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is medieval-settlement-threejs for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.