Evolving Villages
Ok, so if we’re building up villages on flat ground now (particularly egyptian ones, can we evolve them?)
Probably not.
We could simulate population, place houses, develop rules for population sizes at which you need an X class of building (e.g. a church / a market / government buildings) but that gets awful close to
Ok, let’s restrict it to just simulating an egyptian village, maybe we lay it out randomly and not worry too much. Apply some symmetry, some general rules for layout, it’ll be OK.
Thought: Could we use BSP here? layout some “rooms” which are actually the big buildings, then the walkways between the big ones are streets, and then layout houses off of the streets? Doubtful we could get good verticality.
It’d be nice to have a river running through…
Research
- https://is.mendelu.cz/eknihovna/opory/zobraz_cast.pl?cast=71671
- Castra - Wikipedia
- History of urban planning - Wikipedia
- Urban planning in China - Wikipedia
- Ancient Chinese urban planning - Wikipedia
- File:Elburg after cadastral plan 1830.jpg - Wikipedia
Thoughts
- Roman fortresses are small and probably a tractable thing to implement, however incredibly dull (completely flat terrain, mostly single story buildings, etc.)
- The city layout is awesome and impressive, but it is large. Especially things like Elburg, this would be great to implement but is far, far too large for the preferred game size. Let’s start by implementing a simple city block, that’s a reachable target. Maybe we can squash some city blocks together? It would be overly regular, but … maybe this isn’t so bad.
- Historical urban planning is not a popular topic.
City Block Layout Test
- Buildings should be placed around the edges
- A courtyard should be built (space permitting)
- (if there is a courtyard) One of the buildings should be replaced with a gateway
- does placement matter? Should we be concerned with placing the entrance on a less-busy street?
- Buildings need a walkway runing from outside wall to courtyard
- Place corner buildings first? Those might be tricky otherwise.
- BSP? BSP per-edge could work.
See /js/cityblock.js for the source.
Well heck, that worked pretty OK! Let’s add a some entrances and a courtyard where we can place various … stuff.
See /js/cityblock2.js for the source.
Courtyard Layout Test
but what about that empty space? could have a garden thing. or a small green space with trees. maybe walkways. maze?
See /js/courtyard1.js, /js/courtyard2.js, /js/courtyard3.js, /js/courtyard4.js, /js/courtyard5.js, /js/courtyard6.js for sources.
Those look… alright? the asymmetry of the penultimate one really bothers me. It’s a nice overall design and I like the transition from grid on 90° to on 45° offset. That’s kinda cool. The last one is probably the most plausible.
Should add other features that are more interesting than just an orchard. And orchards are just especially boring even if with fun patterns.
- raised flowerbeds (offering some cover)
- park benches (flavor)
- ponds (irregular shapes?)
- ponds (regular shapes, raised border?)
- empty areas?
- tiny soccer pitch
Interiors
Nice houses around the edge but no interiors developed yet. As always, would be nice if the houses were themeable somehow. Most house design seems to revolve around a “backbone” and then rooms of various sizes sprouting from there.
I’ve done some reading in the past here to develop accurate interiors but that is a complex and ongoing area of research. And this is a game, one that’s rendered in relatively low detail, and usually without models if it is coming from the remapper project. We can get away with really incredibly basic interiors.
We could use more or less the same building blocks that are in use with the prefabs. Or at least use them for reference sizes.
- Should try to have more variables for better variety, otherwise they’ll be incredibly boring.
- Consider punching doorways in multiple buildings?
See /js/apartment.js for the source.
Fortresses / Battlements
Would be nice to build fortresses. The ones in AC:O are really quite nice. Notable features:
- boundary wall
- stuff inside?
- sometimes boundary wall is wide enough to walk around
- if border wall connects to buildings then the top level should be used, put some tables or stuff on top
- gates?
- what shape, regular, not?
- Can this be evolved? from a tiny temporary foritifaction to something larger?
- Time setting? Are they historical camps? European? Middle eastern? HESCOs everywhere?
Research
- Base Camp Facilites Standards for Contingency Operations
- “Initial” (0-6 months) -> “Temporary” (6-24) -> “Semi Permanent” (2-25 years)
- Categorisations: Main Base (500 people), FOB (company, 80-150), Outposts
- Army Logistician (Building a FOB From the Ground Up)
- STANDARD FORWARD OPERATING BASE DESIGNS INCORPORATING DoD AND ARMY EXPLOSIVES SAFETY REQUIREMENTS
- SUSTAINABLE DESIGN OF FORWARD OPERATING BASES
- Mathematical Model of Sub-System Interactions for Forward Operating Bases
- http://adminpubs.tradoc.army.mil/pamphlets/TP525-7-7.pdf
- http://www.pnnl.gov/main/publications/external/technical_reports/PNNL-23133.pdf
Testing
Ok, enough reading, can we build a simple outpost. Just as proof o concept. Bare minimum would be:
- tents
- watch tower
- barrier wall.
Rivers
Well at least we can simulate a river, right?
Research
- doi:10.1016/j.geomorph.2012.09.006
- Procedure for rivers and lakes (and snow) — Entropic Particles
- BBC - Standard Grade Bitesize Geography - Processes forming river landscapes : Revision
- BBC - Standard Grade Bitesize Geography - Processes forming river landscapes : Revision, Page 2
- BBC - Standard Grade Bitesize Geography - Processes forming river landscapes : Revision, Page 3
- Why Do Rivers Have Deltas? - YouTube
- Why Do Rivers Curve? - YouTube
Hahahah no.
Well let’s settle for something that looks enough like a river that no one bats an eye.
- Good method for adding rivers to a heightmap? : proceduralgeneration
- Realistic drainage in heightmaps. : proceduralgeneration
- Procedural Rivers And Hills Using Worley Noise : proceduralgeneration
- hydraulic erosion algorithm on heightfields : proceduralgeneration
- Voronoi Rivers - An Update : proceduralgeneration
- IshOfTheWoods comments on [Monthly Challenge #17 - April, 2017] - Procedural Town/City
- I took a swing at erosion and it’s fighting back. : proceduralgeneration
- Is water simulation "procedurally generated content"? : proceduralgeneration
- Water erosion on heightmap terrain
- Time lapse of a river changing course : gifs
Erosion
Did not even attempt.
Random Walks
The random walk approach seemed easy enough to implement and doesn’t look horrible?
The algorithm was supposed to avoid overlapping with itself but that apparently seriously decreases the amount of random walks we discover. So we limited serious overlaps and it works well enough.
I applied some (poorly implemented) dilation to the resulting river which turned out pretty well. The results look pretty decent, they’ll probably even look OK inside a redeclipse map as well.
I originally coded it with the intention of having no overlaps since those seemed implausible but it seems to have created a nice delta effect when occuring near the goal.
TODO
This implementation sucks for a whole host of reasons:
- No branching
- No heightmap included so doesn’t make any sense
- Curves are horrifically un-smooth in places
- No width change that would come with heavy flow
But is such a thing necessary for the scale of RE maps? No possibility to see such global changes as erosion or rivers delta unless the entire map is set atop a river delta. Maybe this belongs in a different project.