go_gens

module
v0.0.0-...-467835c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2023 License: Apache-2.0

README

Go Generators

This repository contains various small attempts at procedural generation, simulation, and other things that might be useful for some people.

PLEASE NOTE: These packages are under constant development for maybe a month or two until I've figured out a consistent style etc.

DO NOT USE YET!

Simulation and procedural generation (WIP)

gamecs: Simulation with agents

This is a very basic simulation with agents using state machines and behavior trees.

genbiome: Biome helper functions

This package provides functions for looking up the biome (e.g. forest, grassland, etc.) for the given precipitation and average temperature.

gencellular: Simple cellular automata in Golang

This package currently only implements Conway's Game of Life.

gendemographics: Medieval demographics generator

This package is based on Medieval Demographics Made Easy by S. John Ross and generates demographics based on settlement density, population, etc. The code is currently very messy and needs to be cleaned up.

gendungeon: Dungeon generator

This package is a modified fork of https://github.com/brad811/go-dungeon/, which is an implementation of http://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes/.

genfloortxt: Simple 2D text floorplan renderer

This package provides a little demo on how to 'render' walls as unicode characters, imitating the cp437 symbol set.

genheightmap: Heightmap generator helper functions

This package provides some helper functions for generating heightmaps like slopes, cones, peakify, relax, etc.

genlsystem: L-system generator

This package implements a 2d and 3d L-system generator with turtle graphics. This code is heavily based on:

genmap2d: Simple 2D map generator in Golang (WIP)

This package provides functionality to generate 2D maps using procedural methods. It has a rudimentary settlement placement logic and probably needs lots work.

genmap2derosion: Heightmap generation and erosion

This package is based on the fantastic work of Nick McDonald! See: https://github.com/weigert/SimpleHydrology

genmapvoronoi: Voronoi map generator

This is based on https://mewo2.com/notes/terrain/ and partially a port of https://github.com/mewo2/terrain/ to Go.

genmapvoxel: Voxel map generator

This package implements a simple voxel based terrain generator. Like... really simple. Don't get excited.

genmarchingcubes: Marching cubes (WIP)

This package is an implementation of the marching cubes algorithm, which takes a voxel field and generates a surface mesh. Right now it is an almost straight fork of https://github.com/soypat/sdf/blob/main/render/marchingcubes.go and https://github.com/fogleman/mc/blob/master/mc.go but will be heavily modified in future versions. (It might already be, depending how lazy I am updating the READMEs)

genmarchingsquares: Marching squares (WIP)

This package provides a simple implementation of the marching squares algorithm for illustrative purposes for now.

genpotion: Potion generator / Alchemy

This package implements a simple alchemy system similar to the potion crafting systems found in the Elder Scrolls games.

genworldvoronoi: Graph based planetary map generator

It simulates (somewhat) global winds and attempts to calculate precipitation and temperature for more intricate simulations in the future. It features SVG, PNG, and Wavefront OBJ output. This is based on https://www.redblobgames.com/x/1843-planet-generation/ and a port of https://github.com/redblobgames/1843-planet-generation to Go.

genvillage: Village economy generator

This package attempts to generate a stable, self sustaining economy given some initial buildings that serve as seed. The user can define building types that consume and produce resources, which the simulation will use to add new buildings until the sum of produced resources outweighs the sum of consumed resources. Please note that the output of this process is only meant to be used as input for a more sophisticated generator, only ensuring that besides required import of unavailable resources, the village/settlement can be in theory self-sustaining.

Don't get your expectations up, it's really basic. :P

simmotive: Sims motive

This package is a crude port of https://github.com/alexcu/motive-simulator which is adapted from Don Hopkins' article The Soul of The Sims which shows an prototype of the 'soul' of what became The Sims 1, written January 23, 1997.

simnpcs: NPCs with daily routines

This is an early experiment in simulating NPCs with daily routines. Sadly it is quite messy and doesn't follow best practices. It also has plenty of leftover code that I don't want to delete. I might clean it up in the future.

simvillage: Village simulation

This package is a port of the wonderful village simulator by Kontari. See: https://github.com/Kontari/Village/ Since I ported it straight from Python to Go, it is quite chaotic and probably would benefit from a refactor.

simvillage_simple: Village simulation (simple)

A very basic village simulator which has settlers settle, procreate, live, love, and perish :) It is a very dumbed down version of kontari's village simulator, written from scratch.

simvillage_tiles: Village simulation on a tile based map (WIP)

Currently, this only provides a very basic tile based renderer with some basic collision detection, etc. In future, it will be a village simulation on a tile based map. (Uses https://ebiten.org/)

Utility

utils

This package contains a number of useful and commonly used functions and structures.

vectors

Various vector math functions.

vmesh

A voronoi mesh generation helper library. This is still very much bound to the genmapvoronoi package, so not very helpful for generic use. Sorry about that.

Directories

Path Synopsis
Package gameconstants provides various interesting constants for games.
Package gameconstants provides various interesting constants for games.
cmd
cmd
Package gamesheet provides a minimal character sheet for agents, or players.
Package gamesheet provides a minimal character sheet for agents, or players.
cmd
Package gencellular implements cellular automata (for now Conway's Game of Life).
Package gencellular implements cellular automata (for now Conway's Game of Life).
cmd
Package gendemographics is based on Medieval Demographics Made Easy by S. John Ross.
Package gendemographics is based on Medieval Demographics Made Easy by S. John Ross.
cmd
Package gendungeon implements a simple dungeon generator forked from https://github.com/brad811/go-dungeon which is in turn based on http://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes/
Package gendungeon implements a simple dungeon generator forked from https://github.com/brad811/go-dungeon which is in turn based on http://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes/
cmd
Package genfloortxt renders a primitive floor plan read from an ASCII file to the console.
Package genfloortxt renders a primitive floor plan read from an ASCII file to the console.
cmd
Package genflora will at some point provide procedurally generated plants for specific biomes and climates.
Package genflora will at some point provide procedurally generated plants for specific biomes and climates.
cmd
cmd
Package genmap2d implements...
Package genmap2d implements...
cmd
Package genmap2derosion is based on "Simple Hydrology" See: https://nickmcd.me/2020/04/15/procedural-hydrology/
Package genmap2derosion is based on "Simple Hydrology" See: https://nickmcd.me/2020/04/15/procedural-hydrology/
cmd
Package genmapvoronoi is based on https://mewo2.com/notes/terrain/.
Package genmapvoronoi is based on https://mewo2.com/notes/terrain/.
cmd
cmd
Package genmarchingcubes implements the marching cubes algorithm.
Package genmarchingcubes implements the marching cubes algorithm.
cmd
Package genmarchingsquares implements the marching squares algorithm.
Package genmarchingsquares implements the marching squares algorithm.
cmd
Package genpotion implements a simple alchemy generator.
Package genpotion implements a simple alchemy generator.
cmd
cmd
Package genvillage provides a very simple generator which attempts to generate a self-sustaining settlement economy given a number of buildings that consume and/or produce a number of resources.
Package genvillage provides a very simple generator which attempts to generate a self-sustaining settlement economy given a number of buildings that consume and/or produce a number of resources.
cmd
Package simmarket implements a simple market simulation.
Package simmarket implements a simple market simulation.
cmd
Package simmemory provides a sample implementation of toughts/emotions and their storage in short, long, and core memory, based on the Dwarf Fortress wiki: http://dwarffortresswiki.org/index.php/DF2014:Memory_(thought)
Package simmemory provides a sample implementation of toughts/emotions and their storage in short, long, and core memory, based on the Dwarf Fortress wiki: http://dwarffortresswiki.org/index.php/DF2014:Memory_(thought)
cmd
Package simmotive is a crude port of https://github.com/alexcu/motive-simulator which is adapted from Don Hopkins' article The Soul of The Sims which shows an prototype of the 'soul' of what became The Sims 1, written January 23, 1997.
Package simmotive is a crude port of https://github.com/alexcu/motive-simulator which is adapted from Don Hopkins' article The Soul of The Sims which shows an prototype of the 'soul' of what became The Sims 1, written January 23, 1997.
cmd
cmd
Package simvillage is a port of the wonderful village simulator by Kontari.
Package simvillage is a port of the wonderful village simulator by Kontari.
cmd
cmd
Package simvillage_tiles is a tile based village simulation based on: https://ebiten.org/examples/tiles.html https://ebiten.org/examples/animation.html
Package simvillage_tiles is a tile based village simulation based on: https://ebiten.org/examples/tiles.html https://ebiten.org/examples/animation.html
cmd
Package simwar provides a simple war simulation based on Lanchester's Laws.
Package simwar provides a simple war simulation based on Lanchester's Laws.
Package utils provides some commonly used functionality.
Package utils provides some commonly used functionality.
Package vectors implements various vector thingies.
Package vectors implements various vector thingies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL