Skip to content

spearwolf/kiwotigo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

170 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kiwotigo

creative-coding Go Report Card

kiwotigo is world map generation tool.

the world builder algorithm generates randomly generated 2D maps, on which regions are distributed, with the following characteristics:

  • each region has a base area that has a minimum size (can be configured)
  • each region has at least one or more connections to another nearby region
  • each region is accessible from any region via these connections

A group of regions that are close together form a continent, there may (but need not) be several continents, and a continent can also consist of only one region (like islands).

Although the generation of regions is essentially based on randomness, it can be configured quite extensively.

As output, the world builder provides a json structure, the intermediate continental format. See ICF.md for a full technical specification.

kiwotigo is written in javascript, whereas the core of the world map builder is developed in go and integrated via webassembly.

kiwotigo example

Just try it out for yourself!

Why?

kiwotigo creates worlds, but doesn't tell you what to do with them. that's up to you. you're a indie-gamedev and need a tool to create 2D or maybe 3D maps? or you just want to create a nice graphics demo and need random input? go ahead, let your inspiration run wild - and don't forget to drop me a message (or a PR) if you want to show something off 😉

Getting Started

As a precondition a current nodejs v22.13+ with pnpm v10.9 and a go-lang (1.24+) sdk has to be installed.

Build the kiwotigo library with:

$ pnpm build

Demo Web Server

Start a local http server to explore the interactive demo UI in your browser:

$ pnpm dev

Node.js CLI

Alternatively, you can generate world maps directly from the command line using the kiwotigo-cli.mjs Node.js script. It runs the full pipeline (WASM continent generation, ICF conversion, path smoothing, island detection & connection) and outputs the final ICF as JSON.

Cmmmand Description
node kiwotigo-cli.mjs Generate a world map with default settings, output JSON to stdout
node kiwotigo-cli.mjs --prettyPrint Pretty-print the output
node kiwotigo-cli.mjs -o world.json Write output to a file
node kiwotigo-cli.mjs -c config.json -o world.json Use a config file
node kiwotigo-cli.mjs --gridWidth=10 --gridHeight=10 --prettyPrint Override individual config values (these take precedence over the config file)
node kiwotigo-cli.mjs -c config.json --gridWidth=12 -o world.json Combine a config file with overrides and file output
node kiwotigo-cli.mjs -c world.json -o new-world.json Re-use a previously generated ICF file as config input (extracts the "config" property)
node kiwotigo-cli.mjs --help Show all available options

Progress information is written to stderr, so piping works as expected:

Command Description
node kiwotigo-cli.mjs --gridWidth=8 --gridHeight=8 > world.json Pipe output to a file (progress info goes to stderr)

have fun!

License & Commercial Use

This project is licensed under the GPLv3. See LICENSE for details.

If you want to use kiwotigo in a commercial project (e.g., a closed-source game) and cannot or do not want to comply with the GPLv3 terms, a commercial license is available.

Please contact me for further information regarding proprietary licensing.

Contributions

By contributing to this project, you agree to the terms of our Contributor License Agreement (CLA). This allows the maintainer to include your contributions in both the GPL and commercial versions of the software.

Packages

 
 
 

Contributors