threejs-worldgen
    Preparing search index...

    Function planCities

    • The settlements to build for a population: one CitySite per settlement, largest first (farmsteads last). Where settlements go and how many people they hold comes from the population model (generatePopulation); this maps them onto size classes. With the population's road network (generateNetworks), each farmstead also gets the nearest road for its driveway. Deterministic from the population.

      Parameters

      Returns CitySite[]

      const [site] = planCities(generatePopulation(world, { radius: 10_000 }))
      const city = await City.create({ world, camera, scene, center: [site.x, site.z], size: site.size, radius: site.radius, seed: site.seed })