I’m currently brainstorming some ideas for a terrain generation setup for a tactical Real Time Strategy game.
Here’s a illustration of what I’m working with:
This generates a data array which I then use a flood fill to mark out separate areas. I can then use real time texture painting to paint on to a game map using texture masking and nodes. (Thanks to agoose77, 2d23d and cuervo1003 for the code they wrote for real time texture painting)
In future each area will use a different routine for filling, like forest, cropland, lake, urban etc… This should create a map with a feel similar to real rural areas:
Though I will use an algorithm to break them up slightly like you can see with the forest areas above, where they overlap some areas and leave others empty.
Right now I can get some data from analyzing the basic array for use in game:
> The different colored polygonal areas show the different regions.
> The GREY lines are roads. These are removed during the flood fill and stored separately. I can get info about these, for example which direction the road is running by analyzing the surrounding pixels.
> The GREEN CIRCULAR areas are cross roads. These are logical places to put enemy encampments or other strategic objectives. They are generated by analyzing where three or more different regions meet.
> The RED CIRCULAR areas are map entry points. This is where the player owned units would start out, and where any reinforcements for either side would spawn. These won’t generate close to the strategic objectives to limit the chance of battle breaking out as soon as the game loads.
>If a map is generated with no entry areas or no objective areas it is discarded and generated again.
My problems are:
EDIT: Solved, see second post.
Does anyone know what the other types of noise methods do? What does noise.cell give me? It appears to just be pixelated random noise. How about the methods that return a vector? Why would I need a vector (especially as it seems to be 2d as one axis always returns 0.0 when i did it)?