@xenocide/world-generator
v0.0.4
Published
_"Dear World, You are the best for Us!"_ - Artifexian TypeScript world generator for 4X like games in 3D space
Downloads
21
Readme
xenocide-world-generator
"Dear World, You are the best for Us!" - Artifexian
TypeScript world generator for 4X like games in 3D space
In heavy development mess xD
For CodeSandbox example, use tag
prealpha_0.0.2-rc.1
, package.json example:"dependencies": { "xenocide-world-generator": "https://github.com/duchu-net/xenocide-world-generator#prealpha_0.0.2-rc.1", }
For now generator is developed as part of a private project (galaxy simulator with nx),
so currently without plans to release as a separate bundle (but can be used as git submodule).
Example
- Generator - React client, check on YouTube
- Name generating - Markov Chains
- Population and Resources Market simulation - node.js subproject
Code
const { Galaxy } = require('xenocide-world-generator');
// Random shape
// const galaxy = new Galaxy()
// Grid shape with [size, spacing]
const galaxy = new Galaxy({ classification: 'grid', buildData: { gridOptions: [100, 30] } });
// Spiral shape
// const galaxy = new Galaxy({ classification: 'spiral' })
console.log('*** Galaxy generated:', galaxy.name, galaxy.id);
for (let system of galaxy.generateSystems()) {
// await system.build()
console.log('** System generated:', system.name, system.id);
for (let star of system.generateStars()) {
console.log('* Star generated:', star.designation, star.id);
}
for (let planet of system.generatePlanets()) {
console.log('* Planet generated:', planet.designation, planet.id);
}
}
console.log(galaxy.statistics);
Inspired by
- [mainly] Procedural Planet Generation by Andy Gainey
- Star-Citizen-WebGL-Map by Lianna Eeftinck
- Artifexian (YouTube) by Edgar Grunewald
- Procedural Generation For Dummies by Martin Evans
- X game series by Egosoft
Other links
- 4X games (Wikipedia)
- Stellar classification (Wikipedia)
- Holdridge life zones (Wikipedia)
- Planet IX
- Prosperous Universe
- Astro Empires
// todo // own tsconfig not from nx