1. The Riftbreaker
  2. News

The Riftbreaker News

The Puppet Master - The development of the AI system for The Riftbreaker, part 2



Welcome to the second part of the story of the AI system in The Riftbreaker. Without much ado, we will pick up right where we left off, and if you haven’t read the previous part, you can do so here.

Everything we showed you up to this point was quite small in scale. That does not satisfy us. We want you to get that Starship Troopers feeling when you play The Riftbreaker - thousands of enemies attacking at a time. We set up this scenario to check how the creatures of various types will behave when they are spawned in their own spots all over the map. Red cubes represent flow fields that are pushing them away, which is very quick way to solve collision problems. They all have a common goal - destroy the human base. The groups will inevitably meet each other along the way - let’s see what happens.



Hi-res: https://gfycat.com/mildgrimykingfisher

Even though the units are limited by the terrain obstacles in the forms of cliffs and pits, the groups manage to blend together and do not block each other’s way to the objective. When they reach a severe bottleneck, they still wiggle around, trying to position themselves to the best of their abilities. That is what will eventually make alien hordes become both terrifying an beautiful - simulating a group of living organisms, rather than robots, each waiting for their turn to cross the passage.

Parallel to the development of the AI, other things happen in the studio. The first models of buildings take shape, the design of the world starts to take shape, more and more advanced elements are added. We can finally conduct tests on some real-life (real-game?) examples. We have set up a basic outpost with a couple of buildings (most of them do not even have textures yet). We also programmed the behavior and attacks for each of the enemies, and basic particle effects were added to symbolize their attacks. Bye, bye, colorful debug cubes! We let a couple of units of each type wreak havoc on the base. Can you guess which enemy types from The Riftbreaker each of them symbolizes?



Hi-res: https://gfycat.com/farflungslightarabianhorse

Even so that everything was working pretty well. There was one thing missing. How to get to the fancy level of Starcraft-like unit movement? Everything moves so smooth and fast in that game, with no movement delay. Well, we tried many things. Praying, watching TV, reading comic books. And guess what, that didn't help us a lot :( But one day our programmer found a solution when he was playing with his young son. They put small balls in a bucket and shook them. Every time, the balls were filling all the empty gaps in the bucket. What magic force was doing that? The answer was - THE GRAVITY. By combining a unique force of gravity for each creature with its very simple soft body simulation, we finally received something similar to Starcraft. With proper looks and animations added, this resembles a game all of a sudden!



Hi-res: https://gfycat.com/maleuncommonaegeancat

We mentioned earlier that it is important for us to make the creatures behave in a believable manner. The last thing we would want our players to see is a bunch of rabid space dogs standing in the field and doing nothing, simply because they currently cannot find a way to reach their target. That is not rabid enough for us. Instead, the creatures group around the target, filling the gaps and behaving like they are controlled by a hive mind. There is only one target, you must reach it by any means necessary. This looks like a living cell, to be honest!



Hi-res: https://gfycat.com/vigilantfoolishkiskadee

Finally, it is time to roll out the heavy artillery. The year of developing complex systems and algorithms, thousands of lines of code, countless cups of coffee later, we let thousands of units loose. No more words, let the images speak for themselves.



Hi-res: https://gfycat.com/occasionalsofthedgehog

Did we manage to capture that Starship Troopers feeling? What other aspects of game development would you like to read about? Let us know in the comments and on our Discord server! www.discord.gg/exorstudios We have a lot of new and exciting things coming your way and we can’t wait to show them off!

Other social media:
www.facebook.com/exorstudios
www.twitter.com/exorstudios
www.mixer.com/exor_studios
www.twitch.tv/exorstudios

The Puppet Master - The development of the AI system for The Riftbreaker, part 1



The Riftbreaker is an action-packed game. You are never truly safe while exploring the alien planet you found yourself on. Even when you’re hiding behind the walls of your base, trying to wait out the night there are thousands of enemies hungry for your skin. Spawning hordes of alien creatures is not a problem, but making them behave in a convincing way is. We would like to show you what steps the developer must take in order to make their game world feel alive.

Even if your goal is to have thousands of enemies attack the player at once, the road begins with just a couple of them. Presented above is one of the first prototypes for The Riftbreaker. There is basically nothing there and even the scale of objects is wrong, but it is enough to conduct the first experiments. Placeholder cubes symbolize the enemies and you can see they are trying to locate and reach the player. In that time we were trying to use our old creature collision detection system which we used in Zombie Driver. Each enemy had 3 ray traces in front of their collision body to avoid other entities and world parts.



HI-res: https://gfycat.com/spiritedlimpgrouper

Well, even if it seemed to work quite well, the algorithm was a bit outdated. It was simply not good enough. We wanted our creatures to be fast and furious and not clumsy. We removed all the ray traces and started using separation and cohesion forces. That gave us nicer movement, which was the first step to our future work. In that time we were playing with math and physics and were testing all our ideas. In this example, a couple of dozens of enemies are chasing the player around, while they slalom among the walls. The enemies funnel through the narrow passages and spread out again once they reach open space. Neat, everything seems to be working fine, but that is just the beginning.





HI-res: https://gfycat.com/grayvelvetybernesemountaindog

Any game would get boring pretty quickly if there was only one type of enemy unit in it. Even in Pac-Man each of the ghosts behaved in a unique way. (Seriously! https://dev.to/code2bits/pac-man-patterns--ghost-movement-strategy-pattern-1k1a) Galatea 37 is home to multiple species, and all of them are different from each other.

There is one important rule. If a system works with one thing, it must work with many things as well. We needed to test how our math equations will manage with creatures differing in size and speed. Will they stick to each other? Will they able to avoid all the world objects? So many questions needed to be answered at that time. And the only way to that is to put every idea and solution into life. Behold! We present you the ultimate Canoptrix, Arachnoid and Kafferroceros rush!





HI-res: https://gfycat.com/fabulousmediocrefoxterrier

Now is the time for the first test of combat abilities. At this point, we got a little tired of watching colorful cubes running around grey space, so we replaced orange ones with Zombie Driver Dog model. In this clip, you can see the dogs trying to attack the player, however, there are some defensive towers in the way. The attacks carried out by the monsters and the towers are symbolized by the red and green cubes you can see flying around. This is not only a test of pathfinding, but also attack priorities. We can order the enemies to attack either the player, the energy structures, the defenses or other buildings first. The player is the priority here, but if there is something in the way, it will get destroyed as well.





HI-res: https://gfycat.com/flawlesscreamygibbon

Tune in on Saturday for the next part of this story. You will learn how we found the solution to our problems and what we did to achieve the effect we aimed for. Until then, you’re all welcome to speculate on it on our Discord - www.discord.gg/exorstudios

Other social media:
www.facebook.com/exorstudios
www.twitter.com/exorstudios
www.mixer.com/exor_studios
www.twitch.tv/exorstudios