SamuZai
dannsworldgenerator
dannsworldgenerator

patreon


Cave Update Alpha 1 Preview JAR (1.0.1.0_A_1)

For two weeks now I've been working on the cave update. To bring the highest quality caves new functionalities had to be added to the core engine.

Modular Prop Generator

In the release versions of the plugin the only props that were generated are the long vanilla-like caves and the trees. The code generating them is composed of monolithic functions that receive many variables and output the generated prop. This worked for a small number of props, but I quickly realized that a better modular solution is possible and could speed up the development time and/or increase the complexity of the props.

The modular system works as follows. A prop is made up of parts. As each part generates it calls other parts that are branching off of it. So for example in a basic tree you have the main branch, that would start children branches, and leaves at certain points. Another example is a cave system populated by a village: the main cavern generates and then starts the village room and props generator at different parts of it depending on the allocation algorithm.

The system allows for reuse of generic part generators in combination with custom parts for each prop. For example the branch generator can be used for trees but also for the long vanilla-like caverns (it actually is the same algorithm).

Terrain Pattern Scanner

To place props on walls and cavern ceilings I added another part to the core. This new part allows each prop to define the pattern it needs in order to spawn in a location. You can think of a pattern as a regex statement, it works in a similar way.

This also allows for each prop to report the exact blocks it needs to scan, which improved performance in my tests by about 50% in prop heavy forest areas like the forest.

The Alpha 1 JAR

+ lava caves from levels 0 to 30
+ new pattern matching system
+ modular system for some props (no visual difference)


More Creators