Contributions:
Implementing Physics
AI Behaviour Tree Tool
Projectiles
Time: 17 Weeks
Team Size: 6 Programmers, 2 Procedural Artists, 5 Artists, 3 Level Designers
Engine: RatTrap (own engine)
Walter Volt is a first person shooter where you play as a mage in a city where the mayor just banned the use of magic.
Aside from shooting magic spells you also have telekinetic powers, which allows you to pickup and move objects as well as throw them at enemies.
This was devlopet as a part of the group projects during TGA.
For this project we hade the requierments that the game was First Person, used a physics engine (eg. Jolt / PhysX) and used Behaviour Trees for enemie(s).
We also decided to make Walter Volt into a single world, compared to other projects where each level designers, worked with thier own level. We now hade one big level, so we programmers got to work quite a bit with optimizations.
During the preprod we decided to used Jolt as our physics engine. Which I took on to implement into our engine RatTrap.
So I spent some time to understand and get it to work with Premake, as well as understanding how to setup the basics for Jolt.
To reduce the dependeci of Jolt in the rest of RatTrap and in the game. I setup a main Physics Engine class which held all the required parts for Jolt. Since I wanted to keep the Physics Engine responisble only with holding Jolt, I also made a class called Physics System, which was responsible for keeping track of things betwen Jolt and RatTrap, like syncing the position of objects and colliders. Functions to Create Colliders, Create Characters, update thier positions and rotations and more.
The Physics System was also responsible for keeping track of all active colldiers, and characters. So that if swap level eg. Player Gym to AI Gym, it removed the old colliders and added the new ones.
Since we needed a way to know what colliders was connected to which entity and wise versa, I set up two unorderd maps where one used the Entity ID as a key and Jolts BodyID as value (or rather an unsigned int) and one that had Jolts BodyID as key and the Entity ID as value. That way I could in the contact listners for Jolt, use the Colldiers BodyID to determin where I should save some collision data so it could be used for more specifik collsion handling. While also making it easier to interact with Jolt using only the Entity ID from RatTrap.
I also add a kinematic sensor on the characters to allow us to use Jolts raycast and various shape casts, such as sphere query. Which also makes it so I can send collision data from the sensor if something in normal physics update hits the character. While the extended virtual can send data the character hits under runtime. Which is why I needed a check to make sure that a characters own collider doesn't give us extra collision data.
Physics System
Character Contact Listener
While I didn't work much with the AI iteself or thier behaviour. I did make a tool for making Behaviour Trees, which we then used for making the AI.
While the Behaviour Tree creator was simple it allowed us to easier make behaviours, as well as debug them since we could view it under runtime, where it also colored the nodes that had run(blue), succeded(green) and failed(red).
For Behaviour Trees you have 3 types of nodes.
Leaf nodes which does not have children and are the behaviours and/or functions we want to run eg. Find Path, Move.
Decorator nodes that interacts with the results from thier child node in some way eg. swap fail to success.
Then last but not least Composite Nodes which are responsile for the how to run the tree, eg. Sequence which runs the children in thier order tills one doesn't succeced, or MemSequence runs similair as Sequence but instead of restarting from the begining it runs from the Child node that didn't return success.
I was debating on improving the Behavior Tree tool, but since I then made GOAP instead as exam work, and we want to use that during the next project. I decided to not improve on the Behaviour Tree tool.