API For Plants And Biomes (Question)

  • 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

  • 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).

  • 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

  • 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

  • I believe the world will be water based, and the biomes will be islands. So to travel to a new biome you'll need a boat.


    Terrain generation won't be noise maps or heightmaps, as those are static terrains. RW is a procedurally generated world, so world generation will be a seeded sine wave with Perlin noise and weathering algorithms.

  • 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):

  • 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

  • I mean, heightmaps and noise need to be generated and in themselves aren't algorithms, they are the results of an algorithm.

    Yes, they also need an algorithm, in most cases its Perlin or Simplex noises with some modifications. On the other hand stochatic texturing can use real world images data (like in example above), which can make fast and realistic terrain.


    You also mentioned sine wave with Perlin noise, is this some kind of Perlin noise modification, or it is more complicated? Are there any good articles about it?

  • From what I've done to date (which is somewhat limited. . . because, hey, we only get one life and there is SOOO much to do out there, including paying the mortgage)


    I created this island with a base sine wave and then added Perlin noise ( no weathering algorithms yet, hence so pointy ^^ )


    basicwater2-1280x600.png



    The textures are then added on using a SplatMap (IIRC there are only 3 textures in this one - stone, sand and grass). Trees and grass are added by looking at the vertex normal and height values in the heightmap.


    I tend not to work on articles as I'm more a visual/practice learner as masses of text make my eyes roll back and my mouth drool. Udemy is a great learning resource which I would recommend for just about anything :thumbup:

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!