OPREP - REFACTORING ANIMS

reported by Šimon Kolčiter on February 18, 2014

UNIT: Šimon Kolčiter, Programmer, Programming Dept.
TO: Arma 3 Dev-Branch Users
OPSUM: Untangling the web: improving animations systems in Arma 3.

EVALUATION

Over the years - and across a variety of different projects - our underlying system of weapons and stances has been gradually extended to support new weapon types, actions, etc., bringing new gameplay and features to our players. However, it has now grown to the point of being relatively difficult to maintain.

Faced with a complicated 'spaghetti' relationship between game code and animation configs, which greatly increases the risk of potential problems, we've set out to refactor our system. Our objective is to make the process of managing and creating features far more robust.

DESIRED CHANGES

To achieve this, we've implemented a one way 'desire-based' system; i.e., the engine decides what stance/weapon is selected and sends the appropriate action to the animation system, which then selects the new animation state. The action represents either the desired weapon category (Rifle, Handgun, Launcher, Binoculars, no weapon), desired stance (Standing, Crouching, Prone) and weapon 'posture', which is determined by current AI state (safe, aware - lowered weapon, combat - raised).

Our goal has been to remove redundant actions that exist mostly to mimic different control settings or are a result of different implementation by different programmers adding different features requested by different designers over the last decade. Although we've managed to resolve most issues for players, making this work for the AI is slightly more challenging - the 'desired' states have to be determined by the engagement situation of a given character.

COMPLICATED RELATIONSHIP

Before we started with the overhaul, we knew that the relationship between AI and animation states was rather complex. To work around this issue, our plan was to implement a new system gradually - first weapons, then stances, then postures - converting old systems to new step-by-step. However, we quickly discovered that some features rely heavily upon each other, and must be changed all at once; improving and making it work with ten (flawed) others - only to change things again - is simply a waste of time.

Because of the complexity of the work - and our commitment to keeping the game playable - our efforts are currently focused upon making fixes only, avoiding the potentially unstable changes for the AI until after some important milestones have been met. Once the overhaul is complete, cases where the AI seems unresponsive or unable to use some specific poses should be improved. One example of a fix already present is that AI can now use binoculars properly; they'll switch to them promptly when needed. We hope to make more progress in the near future.

RISK/REWARD

Although this work isn't without risk - for example, a (now resolved) issue where AI couldn't switch stance after entering combat mode, which unfortunately crept onto Dev Branch - we think it's vital for maintaining and building upon the system in future. It's our priority to make sure the game is always playable, and we apologise for any inconvenience caused when we fall short of that goal!

While the visible benefits right now are fairly modest, we hope to be in a stronger position in future and refine/add new features in a sustainable way!