This is a repository of experimental projects to procedurally generate terrain.
This is the most involved one, featuring voronoi and hexagonal heightmaps, wind and precipitation, river flux generation, and biomes based on the Holdridge model.
A sprite-based erosion mechanism based heavily on a C++ example series and modified heavily. Not fast enough (and may still have bugs).
An initial project working with Voronoi grids and trying to build a definition file for TypeScript.
Uses the Javascript-Voronoi library and Phaser 3 polygons:
- A handwritten Typescript definition file, the hardest part: see it here
- Turns out it's super important to
setOrigin(0,0)
when you're drawing polygons
This project has a number of things built-in:
- eslint: a mix of recommended and reasonable rules, autofix is on by default in vscode via settings
- typescript: 3.8.3+
- editorconfig because vscode will autofix to standard stuff if you have the extension
- wallaby (Ctrl+R, R) for realtime test runner
- jest for tests
- phaser as the base engine
There are only two top-level commands at the moment:
npm test
- (only/terrain
tests are active right now for wallaby)npm run lint
The commands are the same in each project folder:
cd voronoi-example
npm install
npm run start