1. The Riftbreaker
  2. News

The Riftbreaker News

Optimizations: The Fight for Performance in Multiplayer... and Beyond!

Hello Riftbreakers!


We have often emphasized that adding a multiplayer module to The Riftbreaker is a very difficult task. The game and its engine have been designed as single-player from the ground up. For the past couple of years, we have been redesigning most game systems and refactoring the game’s code to make online coop possible. Introducing such major changes to The Schmetterling Engine does not come easy. Not only do we have to solve brand-new issues, but we also need to manage the game’s performance. We can’t allow anything we add to negatively impact how the game runs on your end. On the contrary, we want to use this opportunity to improve our performance. Today, we would like to show you what improvements and optimizations we found while working on the co-op mode.

Allowing players to build gigantic bases and fight against a sea of creatures both come at a large performance cost. That cost increases even more in multiplayer - which you can see even on the gif above.

Modifying The Riftbreaker to support the multiplayer game mode introduces many performance overheads. We have used quite aggressive optimizations when the game supported only a single player. For example, we packed or entirely deleted some effects that were taking place beyond the visible playing area. For multiplayer purposes, that is no longer possible. The server needs to calculate everything happening around all players in the world at all times to relay the complete gameplay information to all players. Because of this, many of the engine’s components take significantly longer to compute. It is unfortunate, but sometimes there is no way to avoid this additional cost. However, it’s still not hopeless, and there are other areas where we can look for improvements.

Our goal is to allow you to do all the fun things you could do in singleplayer, but together with friends, and at a good performance level.

We decided to make up the losses in performance by doing a massive optimization pass across all the game’s systems. We set an ambitious goal for ourselves - we wanted the performance in multiplayer to match that of singleplayer. This way, we could guarantee a smooth online play experience while significantly improving the game’s performance when running solo. We created a set of new benchmarks with massive bases and enormous attack waves. Then, we got to work.

[h3]BENCHMARK ENDGAME IDLE[/h3] During this test, the mech stands in the center of an enourmous base for a couple of minutes. During that time, we check the behavior of the game at times of relative peace. We run all benchmarks at minimum graphics settings, so that the GPU is never a performance bottleneck.

Our first assumption was that our players enjoy building large, complex bases with thousands of buildings. We can infer that when a couple of players meet up to play together, they will build even more monstrous fortresses. We have to be ready for that. A map filled with various buildings, factories, towers, and a massive power grid is a great benchmarking scenario for us since it significantly strains all the game systems. Therefore, we created a huge end-game scenario base and started running tests to see what we could optimize.

This graph shows the changes in performance over the course of our work on the multiplayer mode. Sometimes it gets better, sometimes it gets worse - we always keep tabs on our performance markers.

Game logic simulation is running at a constant rate of 30 updates per second so, our target was to reduce the calculation time for all gameplay systems to 33 milliseconds in total. One thing to note here is that game logic simulation is running independently from rendering. For example, a beefy GPU can render the game at fluid 120FPS while the CPU might be struggling to achieve 30 game updates per second. In case the CPU can’t keep up with game logic simulation the game slows down. Another example - if the CPU can simulate only 10 logic updates per second, then a second of in-game time will take 3 seconds in real-time - the game will run three times slower than it normally should. The Riftbreaker has been out for several years now. By this point, we know very well how the game systems relate to one another. We also have a couple more years of experience and knowledge under our belt. That made us confident we could reach our performance target.

Lately, our optimization efforts have resulted in a nice performance improvement - the game runs much better in heavy load scenatios.

As we mentioned in our previous ‘Co-Op When’ articles, separating our game features' logic and visual parts was one of the biggest hurdles. To summarize, we started moving the virtual representation of many effects and events to the clients so that the server doesn’t have to perform irrelevant operations. That gives the server more time to work on the game logic. When we reworked our systems to work this way in multiplayer, we quickly realized that it could also benefit singleplayer. The new versions of our systems could now operate on smaller data sets and stopped colliding with each other so much. Thanks to this, many more operations in the game can now be carried out simultaneously, parallel to each other. When we saw the first results, we started working on removing as many dependencies between our game systems as possible. When game systems can operate independently, we can better saturate the CPU cores and achieve significant performance gains compared to the old architecture.

[h3]BENCHMARK ENDGAME ULTRA WAVE[/h3]
It is rare for a base in The Riftbreaker to stand idle for a long time. The game is really put to the test when a large number of enemies attack you. To test this scenario, we created another benchmark called ‘Endgame Ultra Wave.’ In this scenario, we launch the final attack wave from the Brutal difficulty at a large base. To spice things up even further, we added a couple of thousands of extra enemy units into the mix, spawning at various points during the test. The base is constructed in such a way that it is guaranteed that the creatures will reach the player’s structures and destroy at least some of them. This allows us to test the game’s performance in hardcore combat scenarios. In addition, we created a separate version of this benchmark for each biome, as those significantly affect the game's performance.

In case of the jungle biome, we use the same base as during the 'idle' benchmark, but this time the base is being attacked by a horde of angry mobs. Each biome has a separate test scenario.

The Swamp base atttack scenario features tons of pipes and dozens of Canceroths.

We chose such a high-stress scenario because it is much easier to optimize, contrary to what you might initially think. When we work on performance, we make extensive use of different profiler tools. A profiler is a piece of software that you can attach to the game process and record the activity of the individual systems of the game. Thanks to the profiler, you can clearly see how long the calculations for each system take and which CPU core they utilize. The profiler will also mark those frames where logic calculations took over 33 milliseconds to complete. We can analyze those frames and choose targets for optimizations. After we’re done, we run the process again and again. The tools that we use are:



Tracy: for a general overview of how long system simulation takes, and how various processes are scheduled on CPU cores. This piece of software has been developed by a good friend of ours. You can download it right here: https://github.com/wolfpld/tracy

When we have an overall idea of what takes long to compute, we switch to one of the following depending on the platform:

Visual Studio Diagnostic Tools (PC - shown on the screenshot), Sony Razor CPU profiler (PS5), Microsoft PIX profiler (Xbox Series) - this is where most of the work is done.

Since the Fungal Swamp biome is brand-new, it came with a whole host of performance issues. Luckily, the new benchmarks allowed us to catch them early.

We targeted the most performance-hungry systems and adapted them to become more multiplayer-friendly. The nature of multiplayer gameplay and the need for perfect synchronization of client and server states forced us to detect changes in entities much more efficiently. A combat scenario, where tons of buildings get destroyed, and hundreds of creatures perish, is a perfect scenario to make such optimizations because those changes happen all the time. For example, the ResourceGraph system produced a performance spike for several seconds whenever a factory was destroyed. We have made great improvements in that regard since then. Our systems work with smaller data sets now, they are much faster and free up the resources for other systems that might require computational power. The benefit of that can be seen both in single and multiplayer game modes.

This is what the performance graph should NOT look like. During our tests it turned out that complex pipe systems produced gigantic lag spikes under high stress scenarios. When you're fighting for milliseconds, a six second stall is not what you want to see.

It is also important to note that we prepared a separate benchmarking scenario for each biome in the game. This matters for us since various biomes require players to utilize different building techniques and advanced technologies that might not be viable on other maps. Each of those tech chains might come with its own individual issues. Here’s a fresh example of such an issue. We have recently constructed benchmarks for two Fungal Swamp biome scenarios: a forest map with relatively low liquid density and a swamp map with liquids making up most of the play area. Naturally, the swamp map requires the player to use pipes and buildings associated with liquids extensively. The benchmark for that map ran terribly slow, with the game logic update reaching up to 250 milliseconds instead of the budgeted 33. We were surprised to find out that the main culprit was the PipeSystem, which took 180 milliseconds for each update. Additionally, if any pipes got destroyed, the game hung for between one and seven seconds. It became clear that our pipe code is inefficient, and we should look for optimizations there.

We have already started working on improving the PipeSystem. The performance in this specific scenario is still far from the 33 millisecond target, but it's just the beginning of optimization.

[h3]CONCLUSION[/h3]
Years of working on the multiplayer mode for The Riftbreaker have been a tremendous challenge. We have learned and improved a lot in this time. We strongly believe that the effort we put into this will benefit both the players who like to play solo and those eager to get their hands on the multiplayer version. We’re doing our best to allow you that - we will start a closed beta test as soon as we are ready to take your feedback. We still have a couple of gameplay aspects to figure out, but rest assured - we’re getting there. Join us on www.twitch.tv/exorstudios for previews of our survival runs. If you have any more question, feel free to ask us directly on www.discord.gg/exorstudios and in the comments below.

See you next time!
EXOR Studios

New Creature Reveal: Plutrodon

Hello Riftbreakers!


https://store.steampowered.com/app/2506610/The_Riftbreaker_World_Expansion_III/

We thought we covered everything all the topics when it comes to the beasts you will encounter in the Fungal Swamp biome in World Expansion III. However, very attentive viewers on our stream (Tuesdays and Thursdays, 3 PM CEST www.twitch.tv/exorstudios) made us realize that we have yet to tell you about the Plutrodon. Here’s everything you need to know about this creature. WARNING: Please treat this article as a potential spoiler. If you’d rather find out all of this on your own, we recommend waiting for the release of the experimental branch, which should happen very, very soon! Enjoy!

Plutrodon and some of its animations. We changed the creature's default skin from green to... whatever the other one is to make it easier to spot the creature during more hectic moments.

Plutrodon falls into the category of a medium-sized creature. It is instantly recognizable in the wild, as it moves around on three legs only. That doesn’t mean the creature is slow or clumsy (looking at you, Krocoon). In fact, Plutrodon’s legs end with sharp claws that allow it to dig itself into the soft ground of the Fungal Swamp and gain the traction it needs to move around quickly. An additional side effect of this adaptation is the ability to climb almost all surfaces - but more on that later.

Plutrodons usually come in groups. It makes it really difficult to dodge their attacks, but it's not impossible.

Plutrodon will generally try to keep a safe distance from whatever it deems as a threat. Its main, ranged attack somewhat resembles the attack carried out by Morphium Towers. The creature will root itself in the ground and then attack the target with a pillar of spikes rising up from the ground. The attack starts near Plutrodon and travels towards the main target. What makes it especially dangerous is the fact that it damages everything on its path. If the Plutrodon targets your defensive towers hidden behind several layers of walls, all of those structures will be damaged by that attack.

A 'synthetic' situation, showcasing Plutrodon's attack strength. Even though you are behind the wall, you're not safe, as the spikes will reach you and your towers easily.

Plutrodons usually stick around in small groups, usually concentrated around bodies of water. There are three major strains of these creatures out there: the regular ones, the alpha strain, and the ultra strain. Creatures belonging to a ‘higher’ strain get bigger in size, more resilient to attacks, and hit harder. However, what doesn’t change is their general behavior and range of attack. If you figure out how to defeat the smaller ones, you should be able to take down the bigger prey. As with all the other creatures of the Fungal Swamp, Plutrodons do not build their nests. Instead, they utilize the strange living structure we told you about earlier as their hive.

These creatures work really well in conjunction with big tanks, like Fungors. Fungors take the damage from the towers, while Plutrodons try to destroy the defenses with their ranged attacks.

These creatures are hunters. They might not be the apex predator of the biome, but you should not discount their killer instinct. Thanks to their sharp claws, Plutrodons can climb almost any natural obstacle. Rocks, trees, and land formations are not obstacles but opportunities for them. Similarly to Stickrids, Plutrodons can come down from a tree and attack you at a moment’s notice. Always watch your back and pay attention to the radar. If you’ve dealt with Crawlogs in the Crystal Caves region, you had a taste of what’s to come - be prepared for more.

Plutrodons can climb off trees just like Stickrids.

If you have been watching our streams in this preview season, you might have noticed that Plutrodons changed their skin out of the blue a couple of weeks ago. Well, it turns out that if you put camo-green creatures on a background full of mud, leaves, trees, and other such props, the creatures blend in a little too much. In the heat of the battle, it was sometimes quite difficult to spot Plutrodons (and Stickrids, too, for that matter), especially if you defeated an entire wave and just had that one pesky critter left over, attacking buildings. As we know, that always happens. However, games should be fun, not frustrating, so we decided to give these creatures a major evolutionary disadvantage and completely redesigned their color palette. You can see the comparison of the old and new skins below. We hope it will lead to a better experience, but still - let us know what you think!

The dark green Plutrodons blended in a little bit too well.

The new version still matches the color shceme of the biome and blends with the ground, but the creatures are now far easier to spot.

The experimental version of the World Expansion III update is just around the corner. It has been quite a long time since the last patch. Over the course of the past couple of months, we have amassed over 6000 changes that will make their way to you with the Fungal Swamp update. Most of those changes are in the backend and necessary for the co-op to work, but there are a lot of optimizations, bugfixes, and new features we haven’t talked about yet waiting for you. We have been preparing the changelog for the entire last week - it’s going to be massive. If you don’t want to miss it, join www.discord.gg/exorstudios and get notified about the launch of the experimental branch.

See you later!
EXOR Studios

New Creature Reveal: Drexolian [Potential Spoilers]

Hello Riftbreakers!


World Expansion II brought many new enemies into the world of the Riftbreaker. The powerful, death-defying Necrodon was one of them. As you might already know, the Necrodon was a creature that we originally planned to include in the base version of the game. However, due to time constraints, we didn’t manage to flesh out the design and program all of its abilities in time. The Necrodon waited on the sidelines, waiting for a good moment to get a new life, which eventually came with the launch of the Into the Dark World Expansion. You will find a lot of parallels to this story while reading about today’s topic - the Drexolian.

Drexolian base model and several of its animations.

Drexolians were initially designed as one of the enemies of the Tropical Zone biome. They are the masters of disguise. Their bodies resemble a certain species of a tree commonly found in forest areas around the planet (huge reveal: Galatea is round, not flat). Their tall bodies are covered with hardened skin, resembling tree bark. It is quite stiff, which limits the creature’s mobility but gives it incredible resistance to many forms of damage. Drexolians also produce false leaves to give their disguise even more credibility. You shouldn’t be surprised if you build your base around one of these creatures only to find out about that fact hours later.

If you want to continue your deforestation practices, you'd better be ready to fight some angry trees.

These strange creatures are usually not hostile towards other species. Most of the time, they can be found simply resting, hidden among real trees. As long as they are not disturbed, you should be able to walk away unscathed. However, if you step too close for their comfort, there will be consequences. There will be no warning signs, and no lengthy ‘wake-up’ period like in the case of Gnerots. Drexolians will attack you immediately, and they have quite an arsenal of defensive techniques to use.

Oh, you wanted to run? It would be a shame if a wall rose up from the ground behind you.

Drexolians might be slow, but they are a deadly threat, both in close-quarters combat as well as from a distance. If you find yourself in the melee range, the creature will try to beat you to a pulp using its long arms disguised as tree branches. Those things might look brittle, but don’t let that fool you - even Mr. Riggs’ armor will have a hard time withstanding a flurry of hits from these. On the other hand - you are considerably faster, so if you notice an incoming attack, you should have no problems dodging it.

This forest looks like a nice source of plant biomass for a power plant... Nevermind, animal biomass will work as well.

If you get away from the angry tree monster, it’s going to try to chase you while simultaneously showering you with a barrage of splinters. Drexolians are able to rip off thin and razor-sharp pieces of their ‘bark,’ which they throw at enemies with great force. Our happy tree friends will also use this technique to wreck your base from afar. Drexolians might be quite passive in the wild, but you can expect literal hordes of them to join the attack waves during your campaign and survival runs in the Fungal Swamp biome.

Learning to spot camouflaged Drexolians will be a crucial skill in the Fungal Swamp.

The cherry on top of Drexolian’s ability set is tied to its slow movement speed. In order to effectively deal with their prey, these creatures can raise up the ground in front of them to form a temporary cage, greatly limiting the target’s movement. Once you’re walled in, you have only two choices - stand your ground and try to destroy the Drexolian before it destroys you, or break through the wall with your sheer firepower. Theoretically, you could wait until the wall sinks into the ground once more, but you’re likely to have experienced an express teleport back to your HQ in that time (i.e., you got wrecked).

Drexolians will gladly join other creatures and come knocking at the gates of your base if you get on their nerve.

The Drexolian had to wait for a while before the time came for its turn in the production pipeline. The Fungal Swamp biome was the perfect opportunity to bring it back. We’re quite happy with how it turned out, and we hope that you will enjoy the unique challenge it’s going to pose. You can see Drexolians in action during our streams on Tuesdays and Thursdays at 3 PM CEST at www.twitch.tv/exorstudios. We are also getting ready for an experimental release of the World Expansion III - hop on to www.discord.gg/exorstudios to get notified when that happens.

See you soon!
EXOR Studios

The Music of The Riftbreaker

Hello Riftbreakers!


Today, we’d like to talk about the music of The Riftbreaker. Some time ago, we explained what it takes to create convincing sound effects and voiceovers for the game. However, we have not talked much about the music, which is also a huge part of the game’s soundscape. In this article, we will discuss what goes into creating a soundtrack for a game like The Riftbreaker. We will also tell you a little bit about the themes we tried to sneak into the soundtracks of each biome, as well as the Adaptive Music System that rules it all.

[previewyoutube][/previewyoutube]
We even had a string quartet rendition of The Riftbreaker Main Theme at a side-event to Gamescom 2019. It was probably once in a lifetime opportunities to hear it like that, so we're glad it was caught on tape.

Music for The Riftbreaker is composed by an experienced composer and multi-instrumentalist, Marcin Pukaluk. He has years of experience creating original music scores for movies, games, and other media. Marcin is a one-man army, composing, performing, and arranging all his pieces by himself. However, we couldn’t just come up to him and ask, “Hey mate, could you design a soundtrack for a game you know nothing about”? We needed to provide some context first.

We invited Marcin to have a chat and playtest the game in our office. The project was in its early stages at that point. However, it was already clear that The Riftbreaker combines the themes of heavy industrialization and advanced technology with the exploration of an unknown planet full of wonders of nature. After some discussions, we came to the conclusion that the instruments that emphasized those themes were synths, drums, and strings. This basic set of instruments would be supported with other sounds as necessary.

By analyzing the gameplay from the first playable demos, we came to the conclusion that we can divide each play session into three types of player activities: combat, exploration, and base building. All of these activities are very different from each other. To create a good soundtrack that always fits the mood of the events on the screen, we needed to take that into account. This is why we decided to create separate playlists, each with a slightly different style, for combat, exploration, and base-building. It was a crucial bit of info for Marcin to determine the mood of the tracks to compose.

[previewyoutube][/previewyoutube]
A typical, calm and steady building piece. Gets you right in the groove of optimizing your supply chain.

The tracks that you can hear during base-building are quite calm and slow-paced but always have a steady rhythm. They are meant to help you focus on the task at hand without jumping into the foreground of the scene. The base instruments are supported by subtle industrial elements, like various ‘computer’ beeps, drones, and machinery clanging. All these elements fit well with what is usually happening within your base.

[previewyoutube][/previewyoutube]
One of the exploration pieces from the original game. It accompanies the player while exploring the wilderness of Galatea 37.

The exploration playlist creates the feeling of mystery and tension as you explore the Galatean wilderness. Long, steady notes, coupled with additional ambient sounds like wind howling or water dripping, give off a vibe of danger. The rhythm section in these tracks is very limited or even completely absent at times, amplifying the lack of safety.

[previewyoutube][/previewyoutube]
NO MERCY, DESTROY EVERYONE WHO THREATENS THE PEACE OF THIS PEACEFUL PLANET!

The last ‘main’ playlist in the game is battle music. It is the most dynamic of the three, featuring fast-paced drums and aggressive lead melodies performed on various instruments. We wanted to get your heart racing with these pieces. Listening to them makes you feel like you’re a superhero in a battle against the entire planet.

As the work on the game progressed, we also came up with additional ‘playlists’ that we thought could enhance the experience and make the soundtrack more complete.

[previewyoutube][/previewyoutube]
The fear playlist can get really spooky at times.

The ‘fear’ playlist is a collection of the most atmospheric pieces in the game. These tracks accompany you when you are out exploring Galatea 37 at night. It is basically the ‘exploration’ type of music, but with the feeling of dread turned up to the maximum. It features an even more creepy ambiance and droning sounds that make you feel uneasy.

[previewyoutube][/previewyoutube]
The idea behind the adventure playlist was to make you feel like an intrepid explorer. Like a certain copyrighted archeologist uncovering secrets of an ancient city.

Next up, we have the ‘adventure’ playlist. You can hear these pieces whenever you visit a new biome for the first time in the Campaign Mode or when you start a new Survival Mode run. Hopeful and full of joy, it is meant to inspire you on your mission to secure the future home for humanity.

[previewyoutube][/previewyoutube]
Just wait for the drop. It's nasty.

The last music variant we came up with is the most experimental one - we call it ‘anticipation’ music. We asked Marcin whether he could compose a couple of pieces using the Shepard Tone phenomenon. It’s an auditory illusion that makes the listener believe there is a constant tone in the music piece that is always rising. We use these tracks before the biggest attacks in the game to evoke feelings of danger and uncertainty.

[previewyoutube][/previewyoutube]
We had to feature some metal-adjacent music in an expansion called Metal Terror.

It is also worth adding that each World Expansion that we released featured new music that fit the theme of the biome added in that expansion. The Metallic Valley music features heavy, distorted guitars and ‘cybernetic’ sounds to match the aesthetic of both the biome and the creatures you can meet there.

[previewyoutube][/previewyoutube]
It's weird how music can evoke the feeling of space and hollowness of caverns. Special effects work wonders here.

The music of Crystal Caverns is characterized by a huge soundstage. Apart from the main instruments driving the music forward, you can also hear a ton of additional sound effects. Water dripping from the ceiling, wind howling in the distance, rock formations scraping against one another, and echoes of unknown creatures - you can hear all of those elements reverberating across the caverns, building the atmosphere.

[previewyoutube][/previewyoutube]
While the music from the MEtallic Valley and Crystal Caverns could work in other biomes, the Fungal Swamp is definitely one of a kind.

World Expansion III takes place in a Fungal Swamp, a place teeming with life. We wanted the music to reflect that. However, we also wanted to give the soundtrack of the swamp its own unique character. You can expect to hear a lot of ethnic instruments in this biome - drums, didgeridoos, djembe, and mouth harps. Sounds like it shouldn’t work, but it does, check it out:

The Riftbreaker features more than fifty individual music pieces, totaling up to almost four hours of original music. However, if we just let all of those music pieces play at random, we could end up in the middle of a heated battle with calm and relaxing building music in our ears. Or, quite the opposite - you don’t want the pumping battle soundtrack to keep playing long after you’re done defending your base. This is why we developed the Adaptive Music System.

The system controls the playback of all music in the game. It is an algorithm that analyzes the player's in-game situation and chooses the appropriate music piece to accompany it. It takes into account the current biome, the time of day, the number of enemies on the screen, and the player’s current activities. Based on the information gathered, a random piece from the appropriate playlist is selected. The system performs these checks quite often. It can also change the music on the fly - if you are exploring an unknown region and stumble upon a nest of enemy creatures, it will turn on the battle music for you. Once you’ve eradicated all threats, the music will switch back to the exploration theme.

[previewyoutube][/previewyoutube]
The full remastered soundtrack for your listening pleasure.

As you can see, creating a soundtrack for a game is quite a complex task that requires a lot of forward-thinking and creativity. If you enjoy the work we put into it together with Marcin Pukaluk, you can listen to it in a remastered version that is available both on Steam and YouTube. Or, you can rip the original versions straight from the game files. Be our guest! (By the way, an updated version of the soundtrack with more remasters is coming. Stay tuned.)

As always, we invite you to check out our streams every Tuesday and Thursday on www.twitch.tv/exorstudios. All our previews, co-op streams, and behind-the-scenes segments happen right there. You can also always catch us on Discord at www.discord.gg/exorstudios.

See you there!
EXOR Studios

P.S.
Some time ago we published a modding spotlight article about WirawanMYT’s Expanded Arsenal mod. Wirawan has just published a massive update for his creation, featuring dozens of new technologies, challenging enemy variants, and even more complex resource chains. Check out the trailer below and download the mod to give it a try!

[previewyoutube][/previewyoutube]

Improved Liquid Rendering

Hello Riftbreakers!


As you might have noticed from all the promotional materials we’ve released on the topic of the Fungal Swamp, this new biome is a lot different from the other areas of Galatea 37. Of course, all biomes are unique thanks to their varied fauna and flora, but the Swamp stands out because of something else. The amount of dry land is by far the lowest among the biomes we’ve visited so far. Not only does this present a building challenge to you, but also a visual challenge for us. Liquid pools were never the strongest point of The Riftbreaker’s visual presentation. However, thanks to the improvements in The Schmetterling Engine, this will change with the World Expansion III update.

https://store.steampowered.com/app/2506610/The_Riftbreaker_World_Expansion_III/
Wishlist, pretty please?

For a long time, we did not have support for rendering transparent materials in the engine due to the constraints of deferred shading. Last year, we made an effort to switch to a new shading technique called tiled deferred shading, which we described in detail in this article. This change was largely dictated by the fact that an idea for a water-based biome has been brewing in our minds for quite some time. Transparent materials were the first step in order to pull this off properly. After a period of experimentation carried out by the graphics team, we arrived at this result:

Each physical element that comes into contact with water causes waves to appear.

As you can see, the water we created is not perfectly clear. Moreover, the deeper the pool is, the darker the water gets. This way, we can simulate how the light behaves in the liquid without having to carry out the complex math of light refraction. It is done via a shader that controls the color of the liquid material based on the depth of the pool. This way, we can change the appearance of the liquid by adjusting shader properties. It also means that you can potentially create mods with new liquids and custom looks based on what we’ve done.

'Water' in the prologue mission did not look like water at all, however, we did not have the correct tools to make it better.

Naturally, filling a pool with water or any other liquid is not enough to simulate the behavior of a real liquid pool. To make a convincing lake, you need more than water. The bottom of the lake must be filled with various stones and plants, and the formation of the terrain itself must vary as well. Our level designers carefully redesigned every liquid pool on every tile in the game, creating a believable layer of tiny decorations hidden beneath the surface. You might not notice them a lot in-game, but believe us - if they weren’t there, the game simply wouldn’t look right.

After the switch to the new system, the water looks much more convincing. The waves that appear on the surface play a huge role in that. The edges of liquid pools are much more distinct in the new system and easier to notice.

Another aspect of a good looking water simulation is convincingly portraying the waves and ripples on the surface. That’s a job for another custom shader. First, we made sure that each vertex that comes into collision with the surface causes concentric waves to appear. This is visible when Mr. Riggs walks through a lake, for example, but truly shines when you observe a creature with more than two legs. In the case of Stickrids, for example, you can see each of the six legs causing its own ripple effect. In addition, the waves multiply and cancel each other out if they come into contact.

In the previous system we faked waves and ripples by using a 'refract' particle effect, which generally caused chaos on the screen.

The new and improved version. It takes some time for the surface to settle after it's been disturbed.

However, some phenomena can also cause waves to appear on water despite not making direct physical contact with it. Explosions and shockwaves caused by rockets and other projectiles should also have a visible effect and cause a wake to appear. The solution to that required some creativity, but we made that happen. Explosions and large projectiles now have an invisible collision sphere attached to them. The sphere is large enough to come into contact with the liquid surface. Thanks to that, our shader knows that it should cause waves to appear. The effect looks great, especially when you shoot multiple rockets - just check out the new and improved Swarm Missile launcher!

The improved Swarm Missile Launcher is a great tool for testing the 'interactability' of the liquid pools!

Additionally, to give our lakes a more lively and natural look, we decided to sprinkle in some details. Take water lilies as an example. All the vegetation and decorations in lakes are created using our prefab system. The level designer marks the area to be filled with a prefab, and the system spawns various props on the ground. However, we give water lilies a bit of special treatment. The game always spawns them on the surface of the water. This way, you can decorate your lakes, even without the ability to place objects directly on the surface in the editor. We also made sure that whenever a liquid comes into contact with the ground or a prop, you will see delicate foam forming at the point of contact. This allows the ground and liquids to blend in a natural way.

The refraction effect looked quite okay on some liquids, but it wasn't the level we were satisfied with.

Things can always look better. We won't stop improving.

We applied these changes to all the liquids in the game, so all the biomes are going to get a visual boost with the arrival of World Expansion III. Naturally, these changes are not without a performance cost, so if you would rather have a couple of extra frames per second or just do not enjoy these effects, you can simply flick a switch in the options menu to turn the water simulation off. If you’re on the fence - come and see the new liquids live at www.twitch.tv/exorstudios - we’re on at 3 PM CEST on Tuesdays and Thursdays. Drop by Discord to get notified about that: www.discord.gg/exorstudios


See you next time!
EXOR Studios