Underworld Ascendant Post-funding Update #43: Doing Damage

In the 43rd update to the Underworld Ascendant Kickstarter campaign, we learn more about the role-playing game's damage system and hear about the addition of veteran art designer Dave Flamburis to the team. Here's a sampling:

Damage is an analogous problem. Some things in life count as (dangerous) fire, swinging axes, big rocks, etc. In some cases such as the rock, and to a lesser extent the axe, damage is a direct result of its mass, shape and speed. In other cases, such as fire, the damage is just an innate part of (what it does). Just like the game has a physics system to decide how much force is applied to whom and what the result is, the game will have a damage system to decide how much damage is applied and what the results are. I did some work on that this week and have a little demo movie to share and discuss.

In our damage system there are two fundamental types (or classes for you programmers out there) of objects: ones that do damage and ones that take damage. Objects that do damage send a message to the objects they interact with that says how much damage they do. Objects that take damage receive that message and change their state based on it. Each is a property of the object in question, so these features are represented as Components in Unity. Many objects will have components for both doing and taking damage.

We realized early on that not all damage is the same. If I crush something, it has one kind of effect on an object, but if I burn it that can have a very different effect. To allow for this, a damage message has two parts. One is a number indicating the amount of damage, and the other is a damage type. Currently we have Fire, Electrical, and Kinetic (physical) damage types in the system but that list is designed to grow as we build out the game.

The swinging axe in the video has a component called DoesCollisionDamage. This component figures out damage based on the weight of the axe, its relative speed at the time of collision, and a hand tweaked multiplier that models the effect of a blade versus a blunt surface. It sends a kinetic damage message to the crate it is hitting every time it collides.

The crate actually has child game objects each with their own component to receive damage messages. This component can have a list of (resistances) that reduce the damage taken. Each resistance applies to one of the damage types and has a number to be subtracted from the damage and/or a percentage to reduce it by. Resistances might represent an object's innate toughness, armor or magical resistance. Every child object also has its own pool of hit points to which to apply the damage.

The crate starts with only the first child enabled and visible. When the hit points of that child reach 0, it disables itself and enables the next child-object in a pre-defined sequence. Thus the box goes through 3 states of increasing damage before eventually being destroyed by the axe altogether. You can imagine how, in game, you might temporarily block a trap this way, but you has better get through it before the object is destroyed and the trap starts working again!