Terrain generator and editor with save options

I want to start work on a terrain generator, and editor that saves the maps as block files and uses a tree structure to access the data, for editing and for streaming.

I know it will need a RGBA splat map controller using vertex color, My attempts at using nodes have been close but not quite good enough,

I will need a method that paints the vertex color rgba using z height, angle and some sort of cell noise based random seed,

Does this sound useful?

what is missing?

I will intially use a kdtree as we don’t have an octree or quadtree in native code yet*

This sounds really interesting to me :slight_smile:

I would use a height map and splat map (image) rather than vertex colour.

the idea is to input a seed and it spits out a whole terrain,
I can’t use a premade height or splat map :slight_smile:

I would be interested in seeing this.

I wonder if we could use the vertex color + some kind of noisy brush with random rotation to procedurally paint a splat maps?

maybe even use a algorythm to do it instead?
(to avoid the flat falloff that vertex color produces?)

it does not matter if in the end it takes 1 hour to finish generating as the data will be stored in block files by the end user, and should startupfairly instantly afterward.

You could try it and see.

I have seen your KDTree_loading.blend file to draw at an black cube at specific vertex points from mesh with the mouse, nice work!

but I think the main problem will be to save it from the bge, or you could try to set it up in bpy for the viewport to use it as addon for modelling/texturepaint/ZBrush or some else fancy stuff I will look forward for this project

If it generates it from a seed it’s hardly an editor.

Heightmaps/splatmaps can be dynamic textures, made during runtime and made physical using a method like this:

A method to avoid the flat falloff from vertex colors is shown in this blend:

I did not know lot of this things but is it possible to get more different layers in heightmaps/splatmaps or separate maps to add more vegetation like grass, trees some other flowers or to “brush-on” some pre-build things(houses, ways, water,…) or to deform the terrain?

The system will spawn a terrain, using a seed, and pickle a list of changes to apply after generation, so you can store a very large world in a small seed, and tweek it where you need to to have cities or roads etc,

so basically - load random terrain - edit stuff, save list of things to apply

edit: is one method

another would be to edit and then store in a tree*
after the intial random generation,

the second way is much comfortable to set objects or to edit the terrain.

I actually already have the random generation working, and can likely impliment it using the new blender player, but until the upbge We won’t have access to instances, making trees and grass much more resource intensive.

oh yeah, you can’t generate unique physics meshes in bge, so it has to wait until
Upbge blender player releases :frowning:

Upbge reinstancePhysicsMesh() has a 3rd option,
if it’s set to true, the objects mesh in question gets a unique physics mesh. (thanks again upbge team!)