AnotherCraft / ac-worldgen

AnotherCraft worldgen system
Other
31 stars 3 forks source link
ac-worldgen anothercraft woglac

AC Worldgen

AnotherCraft project procedural voxel world generation system. The system is completely standalone and can be used for world generation in any voxel-based game. This is not a hard coded one-trick pony earth-like gen, this is a framework that allows you to easily generate and tweak any voxel terrain you desire!

!! This repository is only for the worldgen system itself. World rendering/visualisation is up to you to implement.

AC Worldgen Youtube Playlist

System premise & features

Procgen features

System structure

Documentation & resources

Contact/social

WOGLAC example code

See the examples folder.

Float z = worldPos()::z();
Float terrainZ = 195;

// That #342 is a function-local seed.
// The seeds are entered manually like this so that even when moving the function around, it still produces the same results. 
export Block resultBlock = z < terrainZ ? (rand2D(#342) < 0.5 ? block.core.dirt : block.core.grass) : block.air;

Building

The build command might look something like this:

git clone --recurse-submodules https://github.com/AnotherCraft/ac-worldgen
cd ac-worldgen
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cd ../../

Third-party resources

License

AC Worldgen is licensed under LGPL, which means you can incorporate it even into your commercial voxel projects free-of-charge. The system runs as a standalone application, so your code can stay closed source. You however have to make available any changes you've done to the AC Worldgen system itself. It would also be very nice of you to mention us in your credits.