Cover image of Changes and improvements to Damage System in 1.2

Before our 1.1 Update, we introduced some changes to the DamageManager API and promised more in future updates. Experimental 1.2 is the first showcase of a major change to damage systems: DamageEffects. In this blog post, we will explain what they are and what new features they introduce.

DamageEffects

As Arma Reforger has grown, so has the complexity of vanilla and modded damage systems. We wanted to make damage more accessible while also improving its moddability, and we ended up with DamageEffects. The goal of damage effects is to separate as much logic from DamageManagers as possible and substitute it with simple individual effects that interact with each other.

A simple example:

  • A bullet hits a player, adding a BulletDamageEffect to their DamageManager. The effect gets logged on the damage history.

  • As a consequence of the BulletDamageEffect, the player gets added a BleedingDamageEffect on the hitzone instead of the blood hitzone (compared to the old DamageManager behavior). This effect will be dealing bleeding damage as long as it's present on the ExtendedDamageManager.

  • When a BandageDamageEffect finally gets applied, it removes the bleedings on the hitzone it applied to.

While this is a simplified version of what is happening, it showcases the idea behind DamageEffects and how they behave.

Some damage source prefabs, like projectiles and explosions, now have a field to select which DamageEffect they will apply when dealing damage. With this, one can customize the consequences of taking damage by different means (e.g. higher caliber bullets result in higher bleeding rates).

If you want to use DamageEffects, they are done through the new ExtendedDamageManager component, which will contain the DamageEffects that get added during gameplay.

DamageHistory

The damage history contains all the DamageEffects that has gotten applied to a damage manager since the last time it was cleared. The damage history is only stored on the server and can be used to properly determine who should be given kill credits or assists for helping take down someone.

A New Way to Damage Over Time

The old DamageManager had two big problems with Dot: 

  • Couldn't differentiate Dot sources of the same DamageType applied to the same hitzone.

  • Damage over time had no automatic duration tracking.

The DotDamageEffect (DamageOverTime) addresses both of those problems. You can give them a duration after which they automatically get removed, you can distinguish their different instigators, you can deal the damage to a different hitzone to the one you applied it to (e.g. leg is bleeding, damage dealt to blood hitzone), and you can have as many on the same hit zone as you want.

Things that changed:

While ExtendedDamageManagers inherit from DamageManagers, their Dot logic is completely different. ExtendedDamageManager can only take damage over time through DamageEffects, and therefore, the following methods are no longer supported on ExtendedDamageManagers

  • OnDamageOverTimeAdded(EDamageType dType, float dps, HitZone hz)

  • OnDamageOverTimeRemoved(EDamageType dType, HitZone hz)

  • IsDamagedOverTime(EDamageType dType)

  • GetDamageOverTime(EDamageType dType)

  • RemoveDamageOverTime(EDamageType dType)

Any calls to these methods from an ExtendedDamageManager will be ignored by the system.

Along with those changes, the following classes and fields have been renamed:

  • ExplosionDamageEffect to ExplosionDamage.

  • BaseMoveComponent to ProjectileMoveComponent.

  • SubmunitionDamageEffect to SubmunitionEffect.

  • ExplosionDamageEffect field from ExplosionDamageEffects to ExplosionEffects.

  • The projectile effect BaseDamageEffect to ProjectileDamage.

These changes could cause prefab data loss. To avoid it, follow the same procedure described in Avoiding Prefab Data Loss in 1.2 Update with the previously mentioned classes and fields.

Currently, only characters use the ExtendedDamageManager, but we plan on having vehicles use them in the future. DamageEffects are still a work in progress, but instead of delaying them for a future update, we wanted to get them out as soon as possible so you could start feeling comfortable with them.

We are excited to present DamageEffects as we believe they are the future of damage. Since this is a completely new system, we are also interested in the feedback you can provide, especially during this experimental period. If you are interested in damage and damage effects, check out the BIKI for more information:

Published on 

We want you for our mailing list!

We offer great content once a month just for you!