Blend on Enum vs Cached Poses

Hi Everyone,

I’m just about to start the process of writing my animation system for the main player character in my game. In the game, the player can switch between different weapons, each of which has their own idle, movement, aiming, fire & reload anims. I have an enum which lists every weapon out.

I’m wondering what the best way to build this system is. I can see three routes:

  • I build a single state machine that switches poses within based on the enum
  • I build a state machine for each weapon and switch between the resulting poses at the end, based on the enum
  • I build a single machine with cached poses and update the cached poses every time the player switches their weapon

I suspect option 2 is going to be quite laborious, but I’m worried that option 1 is inefficient for the CPU, and that option 3 could glitch or hitch when updating all the poses.

Can anyone shed any further light on the pros and cons of each method and / or share any other options?

You don’t say how many weapons each of the players needs access to or how complex the weapons are in the first place. If class based where the player only needs access to a limited and set weapons load out then it would be easier to do it all like as above and in my experience it does not matter how you start out as it’s going to change over time as you figure out better ways and means.

The flip side if your players need to have access to a lot of different weapon types with out limitations as to use, a player can pick up a rocket launcher for example, the system we are using is a weapon BP that is referenced upon possession of a unique weapon and the BP contained all of the required resources to make the weapon function by extension.

Our design explained.

At the moment, I’m planning between 8 and 12 weapons, and the State machine is pretty light - 3 mains states (movement & idle, aiming with ranged weaponry and aiming thrown weaponry), weapons are simple and things like firing, reloading, quick melee and damage will be taken care of as single anims or montages…

I’m very used to working with anim sets - i.e. adding to a list of anims within a character or weapon, which are then passed to the state machine at the appropriate time. I prefer this to hooking up switching on enum as new weapons can be set up exclusively in the weapon BP itself,.This is my first time building my own anim system.

Thank you for the vid FrankieV, I’ll take a look at that later today :slight_smile: