
Joise is a 2D, 3D, 4D and 6D modular noise library written in Java.
Joise is derived from Joshua Tippetts' Accidental Noise Library written in C++.
groupId=com.sudoplay.joise
artifactId=joise
version=1.1.0-RC3
Joise was created to facilitate the creation of complex noise functions from chained modules, and represent the chained modules in a flat format convenient for text serialization.
Joise was originally created to power the procedural world-building algorithms behind the PC game, Lodestar: Stygian Skies.
Documentation: * README.md this file * LICENSE the license (link)
The repo contains the following packages:
* com.sudoplay.joise - classes to work with module maps
* com.sudoplay.joise.generator - classes to generate pseudo-random numbers
* com.sudoplay.joise.mapping - classes to assist in mapping noise to arrays
* com.sudoplay.joise.module - all the noise function modules
* com.sudoplay.joise.noise - the core noise functions
* com.sudoplay.joise.util - common utility classes
The following packages are provided separately to reduce dependencies: * JoisePlugin-TMLConverter converts module chains to and from TML using Juple. * JoisePlugin-JSONConverter converts module chains to and from JSON using Gson.
calculate() in ModuleAutoCorrect class (replace with calculateAll() method) (#16)ModuleAutoCorrect class: calculate2D(), calculate3D(), calculate4D(), calculate6D() (#16)calculateAll() method in ModuleAutoCorrect class to replace deprecated calculate() method (#16)ModuleFractal class (#17)Module base class into ModuleFractal class since the field and related methods are only ever used for deCarpentierSwiss type fractal noise (#18)Module base class that read a property from a ModulePropertyMap and return a default value if the property map doesn't contain the provided key; useful for reading new properties from older maps that may not contain the new properties (#18)Module base class into the ModulePropertyMap class; refactored modules accordingly (#18)SeedableModule to SeededModule (#18)Module#setSeed(String seedName, long seed) to replace similar method in Joise classModuleChainBuilder class to build module chains from ModuleMap; replaces similar functionality in Joise classJoise classAssert utility classcom.sudoplay.util to com.sudoplay.joise.utilModule class; separated into two constants, one in ModuleCombiner and ModuleFractalModuleBasisFunction class; fixes #20View changelog for all versions
Most modules accept one or more sources. Sources can either be a module or a double value.
ModuleBasisFunction basis = new ModuleBasisFunction();
basis.setType(BasisType.SIMPLEX);
basis.setSeed(42);
ModuleAutoCorrect correct = new ModuleAutoCorrect();
correct.setSource(basis);
correct.calculate();
ModuleScaleDomain scaleDomain = new ModuleScaleDomain();
scaleDomain.setSource(correct);
scaleDomain.setScaleX(4.0);
scaleDomain.setScaleY(4.0);
A module chain can be sampled in either two, three, four or six dimensions. Four and six dimensional noise is used for creating seamless two and three dimensional noise, respectively.
lastModuleInChain.get(x, y);
lastModuleInChain.get(x, y, z);
lastModuleInChain.get(x, y, z, w);
lastModuleInChain.get(x, y, z, w, u, v);
Module chains can be converted to and from a ModuleMap. This is convenient for serializing module chains because converting a chain to a ModuleMap will flatten the module chain tree.
// convert to a ModuleMap
ModuleMap moduleMap = lastModuleInChain.getModuleMap();
// convert from a ModuleMap
Module module = new ModuleChainBuilder().build(moduleMap);
// sample the resulting chain
module.get(x, y, z);
Seeds can be named. This is convenient if you want to load a module chain from an external format, and set seeds programatically.
ModuleBasisFunction basis = new ModuleBasisFunction();
basis.setSeedName("worldseed");
ModuleMap moduleMap = basis.getModuleMap();
// ... save the module map to some external format ...
// ... load the module map back in later ...
Module module = new ModuleChainBuilder().build(loadedModuleMap);
module.setSeed("worldseed", 42);
Copyright (C) 2016 Jason Taylor. Released as open-source under Apache License, Version 2.0.
$ claude mcp add Joise \
-- python -m otcore.mcp_server <graph>