[h1]Hello Riftbreakers![/h1] After two weeks break, it is time to return to the second Riftbreaker World Expansion: Into The Dark. We have already told you about some of the new game mechanics, buildings, and creatures you can expect to find in this biome. Today we would like to focus on a completely different aspect of the Caverns biome - the map tiles design. In this article, you will learn about all the new features we prepared to make this biome look and feel much different from what you’re used to. Read on! Let’s start with the basics. [url=https://steamcommunity.com/games/780310/announcements/detail/5262975441860531779]As we explained before, maps in The Riftbreaker are generated procedurally by stitching together predesigned elements that we call tiles.[/url] The designer gives tiles a general structure through the use of movement-blocking props. These are usually boulders - they dictate where you can or cannot go and what kind of space will be available for you to build your base. Designers also place spots designated for resources, enemy spawns, bioanomalies, and prefabs containing various props. These rules remain the same in the case of the Caverns biome. [img]https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMWRkNzQyZDQ5ZDI3YmM0OWM1ZDhlNmY4NjllNDE4OGFjYjdjNjIyNyZjdD1n/2D2fyDJuPiDTuzNkC6/giphy.gif[/img] [b][i]Map tiles from this biome seem claustrophobic, but it all changes when you turn the destructible rocks off![/i][/b] The first difference is that almost all tiles are covered to the brim with our new ‘destructible rocks volume.’ It is a game logic structure that tells The Riftbreaker which areas of the map are allowed to be covered with [url=https://steamcommunity.com/games/780310/announcements/detail/3639506225028403516]destructible rocks, which we discussed in one of our previous articles.[/url] We do not place them manually - instead, the engine spawns them automatically. We can also determine how much of the tile we want to fill with rocks. If we create a tile focused on exploration, we will choose a more open layout that will not produce as many rocks as in the case of a tile we want you to dig through. [img]https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExN2UzNDhkMmI3MjI4ODdhMTI4NWQzOTNkOTkzMmIyNGJmN2NjOTlkNyZjdD1n/iT3k9eRCg20f3dM2I1/giphy.gif[/img] [b][i]This biome allows us for more verticality in our map construction.[/i][/b] While most of the map is covered with destructible rocks volume, it does not mean that boulders are the only thing you can find in the Galatean underground. Our map generation system can make maps more attractive by cutting out caves and clearings within the rock structure. We have developed rules that control the extent to which destructible rocks will fill the level. Based on a specialized algorithm, some areas of the level will be left blank to accommodate various points of interest placed by the designers. If we simply filled the entire level with rocks, it could cause technical issues, for example, creatures spawning within walls. Besides, it would feel monotonous, which is the last thing we want. [img]https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjc1ZGIwNjlhNzE1NzJhODMyZWM4YzRhZmEyMWJmNzhlNGRkOWVmZSZjdD1n/rb2EP1DIBScE9brrR4/giphy.gif[/img] [b][i]Most of the caves and clearings you can see here were created automatically using our systems.[/i][/b] However, if all caves you stumble upon were filled with objects of interest, you would very quickly notice a pattern there. To avoid that, we developed a unique feature to add even more variety to the biome. The map generator can now use masks to change the map layout. There are two varieties of these masks - one is used to remove parts of the destructible rock formations. The other one ‘cuts out’ holes in the ceiling of the caves for the light to shine through. Let’s take a look at each type and see how they work. [img]https://i.imgur.com/M0ok65N.png[/img] [b][i]Masks used to generate caves are rally simple. You will be easily able to make your own for modding purposes.[/i][/b] These masks tell the game where it can spawn our rock formations. The key is simple - white means the space should be left empty, and black means it’s fair game. The mask is a 128x128, black and white png file, with each pixel corresponding to one grid on a standard, square map tile. During the map generation process, one of these masks is taken randomly and virtually laid on top of the tile. Then, parts of rock formations are removed wherever the white pixels from the mask have landed. Rotations of the tile and mask are randomized, resulting in many possible combinations. [img]https://i.imgur.com/7Jyhy3q.png[/img] [b][i]The masks responsible for light spots are more nuanced. The delicate glow around the holes is necessary to create on illusion of light scattering.[/i][/b] The other type of mask is more complicated. These textures shape the sunspots allowing sunlight to pierce through the ceiling. The white pixels determine not only the shape of the skylight but also allow us to create an approximation of the light’s behavior. The intensity of the white pixels on the mask determines how much light passes through the mask, trying to emulate the light scattering. Sunspots are an important gameplay feature in the Caverns biome. While generating power from solar panels is not the first choice here, you will have the option to place a couple of panels here and there if you like to! [img]https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMTUzMGVmYTAxMjk3NDcwN2JiMzdhNDEwOTIzYjllMzI3MzMzNTQzYyZjdD1n/hV9JB72IdB3P50wlr2/giphy.gif[/img] [b][i]An example of a couple of light masks in action.[/i][/b] Designing an exciting map tile in such a claustrophobic environment is no mean feat. Plants, mushrooms, and other props are rare and need to fit their surroundings - you don’t expect to find a forest in the middle of a cavern system. Verticality plays a much greater role in creating the atmosphere of this biome. First of all, thanks to the camera object culling system that we implemented, we can now build much taller structures without worrying about obstructing the view. Stone arches, stalactites and other formations make an appearance, giving you the feeling of actually being underground. [img]https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNTE2ZDY2OTJmNmEzN2ZiNTYxMzE5M2IzODUwMGY3NTYzYWExMDNhYiZjdD1n/i0IifIpU3B0wLfQ55w/giphy.gif[/img] [b][i]Everything that is situated below the ground level of the map is bound by an artificial box that prevents you from seeing artifacts.[/i][/b] While exploring the caves, you will often find that they open up into larger, naturally formed caverns. Such spots were featured previously on other biomes, but not to this extent. We build a ‘box underneath each tile where we want to show the lower levels of the cave. It ensures you won’t be able to see the skybox bleeding through the ground at any angle and gives us a rock-solid foundation to set up exciting sceneries that give you a real sense of depth when looking into them. Things get even better when the generator puts a skylight directly above such a spot, as lighting and shadows can completely change the presentation of the scene. [img]https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNDM0YmJkYWYwZWRkNjNjNTRmMGM2MjMzN2MxNWE5ZmEzYjM5YzQ0NyZjdD1n/UY1HhUq7QZbZJz2tzp/giphy.gif[/img] [b][i]Tiles vary in how much of their area can actually be traversed.[/i][/b] As you can see, we had to solve several issues and develop several new features to bring The Riftbreaker’s gameplay underground. We are happy with the results and think that you will find the Caverns biome to be a completely unique experience. We also hope that the new features will be useful to you from a modding perspective. Remember that this world expansion's functional content and Survival Mode biome will be available to everyone as a free update so you can use it all in your creations. [url=https://steamcommunity.com/games/780310/announcements/detail/3692427324337280429]Speaking of modding, we await your submissions in the modding contest! We have some gaming PCs and GPUs looking for a new home.[/url] Don’t keep them waiting too long! As always, we are waiting for your feedback and questions! Catch us here, on social media or www.discord.gg/exorstudios. We’re also waiting for your suggestions at https://riftbreaker.featureupvote.com/. EXOR Studios