Far Frontier Studios
Head of Community
Mankind Reborn Staff
- May 3, 2023
- Pegasi 51
- Terran Defense Corps
Weapons are likely the oldest feature implemented in MR back in 2017, alongside the character, controls, camera, and animations. It was quite inefficient and a chunky blob of text where most of the weapon behavior was allocated into one file. Moving forward I wanted to modernize and make the weapons more modular while providing better tools for tweaking them inside the editor.
One of the biggest changes is the move towards decoupling weapon code into actions (Using the Action Framework I built months ago), for example, let's say a weapon has the following functionality:
So in theory, let's say the PP7 has the actions described before, and for fun, we want to change the Semi-Fire action to a Burst-Fire, so instead of writing more code or tweaking a bunch of variables inside the weapon, we just change the PrimaryFire action from Semi-Fire to Burst-Fire, and now our PP7 has burst functionality, without writing a single line of code. So pretty much we can build weapons dynamically by changing these actions around, and also these actions can change during gameplay, for example adding a flashlight mod to the PP7 will grant it the flashlight action, etc. While the weapons will still function the same way as before, the way they'll handle that has been completely reworked from scratch and this will grant us a large amount of flexibility when it comes to creating new weapons or tweaking existing ones.