Posts by paulevs

    For those who wondering how stochatic texturing works - algorithm works with triangular grid where each point is a texture/heightmap sample. Points are selected randomly (for repeating textures) or randomly in bounds (if texture has edges), random seed based on point position (simplest solution is a hash function). Blending between points is always inside one of triangles and uses modified baricentric coordinates interpolation (in my implementation modification is noise multiplication that makes sample blending more natural). For textures this can be done in shaders, for heightmaps - on CPU with some small amount of cache for calculated samples.

    Triangular Illustration is from this post

    Terrain generation won't be noise maps or heightmaps, as those are static terrains

    Actually both algorithms can be procedural 3D/2D infinity noises based on world seed value, so they are not static. There are verya large variety of different approaches:

    1. If noise values are from 3D noise with height gradient then terrain can form different cliffs and arches (games like Minecraft use this one);

    2. If noise values are 2D you will get an infinity heightmap for your terrain (looks like current Java version use some kind of this variant);

    3. Combination of 3D and 2D - complex approach when some parts of the terrain defined by 2D noise and some - by 3D (like mountains and valleys).


    If islands in the game world will be large than each island probably will have more than one biome, so height values between different biomes will be blended together for smooth transitions (Java version already doing this). I think that islands can probably have at least 2 biomes - the main biome and island shore, bigger islands can probably have more biomes scattered on the land.


    There are some more interesting approaches in terrain generation, for example there is a method that can be used to generate infinity heightmap from fixed patterns. This method called stochatic texturing and it was created for textures to make them more realistic, but it also works with heightmaps. Here is the blogpost about texture algorithm


    This algorithm can be easily adopted for heightmaps and generate infinity terrain based only on one image. It can be enhanced with adding more images and random rotation and mirroring to samples. Here is my test implementation (without rotation and mirroring, but with noise blending between samples):

    Actually, there are some more related questions - will terrain be controlled by biomes or biomes will be scattered across separately generated terrain? Will it be possible for biome to affect terrain generation? What algorithm is used for terrain generation - noise maps, heightmaps or something different? Sorry for so many questions

    Quote

    arent plants objects?

    As I know - no, as they have a separate database and their own complex behaviour (like half-destruction or wind movement)


    Quote

    Unfortunately I can't share much information about adding custom objects, items or plants at this stage :( But this is on our to-do list ;)

    When it comes to modifications of the world generation, we could basically add specific events for that, but modifying the world generation through the API isn't straightforward, so we would need some feedback about what sort of information you want to change exactly. We could add an event which is called everytime a new chunk is generated (you could then provide your custom terrain data and plant information, for example).

    Thank you for info! In my mind biome can have some sort of inner structure (I mean in code) that can determine plants, objects, animals, structures and terrain inside it (or terrain can be separate and biomes will be selected based on it, some games uses this approach as more "realistic". Actually, biomes that control height inside them are more simple from code side). Perhaps the plugin could initialize its biomes on the world init, and the world generator would determine how they should be generated based on biomes values or pure random numbers

    Hi to everyone! I have a small question about new API - will it be possible to create custom plants and biomes in new API (Unity version)? As I know in the current API you can create only objects, but not plants (you can make some kind of "fake plants" with all logic but not actual plants) and custom biomes are impossible to create. In my opinion this can be a great possibility to expand the game world. If I'm wrong please correct me, thanks in advance for your answer