/Kukkura

Procedural Generator. Based on L-Systems (with Context Free Grammar rules).

Primary LanguageJavaMIT LicenseMIT

Kukkura · GitHub license CircleCI

This is a Procedural Generator based on Context-Free Grammars and L-Systems.

For more information on the project, and stuff like how to use it and tutorials, visit the project Wiki.

The gist of it:

  • You specify (1) some rules and (2) some symbols as input (in a bunch of JSON files).
  • The rules describe how you want to manipulate/transform the symbols.
  • The key here is that every symbol has some meta-data associated with it (e.g.: a size field, a position field, whether this symbol supports randomization, etc...).
  • Then, according to your rules, your symbols, the meta-data of each symbol, and some number of iterations, the system generates a final set of symbols.

You can then express extremely complex and recursive structures by just using rules and symbols.

You can then interpret/serialize this output yourself for your target platform/program/thingy.
The program already supports Minecraft-compatible output (i.e.: Minecraft users don't need to serialize the data, it's handled for them in one of the output files). No support for other platforms/programs/games/etc (yet!), but the output is comprehensible enough that it is not too hard for someone to do so.

Examples

Coming Soon...

Getting Started

Prerequisites

The following are needed:

  • Maven to build the executable jar (how to install Maven here).
  • Java SE Runtime Environment >1.8 to run (how to install the JRE here).

Installing

  • git clone the repo.
  • cd into the repo.
  • mvn clean install to create an executable jar.

The executable is generated inside the /target folder.

Usage

This is a very rough overview of how to use this program. You can find actual detailed explanations, tutorials, examples, and other cool stuff on the project Wiki.

But anyway. You execute the program as follows:

java -jar Kukkura.jar

Roughly, what you do is the following:

  • Devise context-free rules in one (or several) JSON files.
  • Run the program through the terminal.
  • If you're a Minecraft user, you can load the generated output.mcfunction file directly into your game and enjoy your creation without any need for serialization (the reason is that I did this initially with Minecraft in mind, then changed mid-way when I realized it could be used for pretty much any platform, provided one would do the necessary serialization). See how here.
  • If you use this program to create content for another platform, you have to serialize the output.json file.

Contributing

Any contribution or help is welcome ! Please don't hesitate to generate issues/PRs if you think a feature should be added, some code could be cleaned up, some typos caught your eye, you want to add examples/tutorials, or anything else really !

A CONTRIBUTING.MD guide is coming soon, to help with that process.

License

This project is licensed under the MIT License - see the LICENSE file for details.