• Nothing
  • About
Menu

Asher Einhorn

  • Nothing
  • About
damagetypes.png

Filtering damage

July 30, 2015

Creating a more complicated damage model is something you should always implement in the beginning of a game's development. You may not plan to need it, but when your design changes it's a good thing to have in place.

Why would we want this?
It may be that you want certain characters to respond to only particular damage types like fire, or high-velocity munitions. Or perhaps you want equipment to shield against a certain super-set of these types, like a flak vest that stops explosive damage.

The idea of this is relatively simple - you set up a system that enables a receiver to only take damage from the types that it is allowing. Whenever you create a character, you can specify what it is vulnerable or invulnerable to. When damage is sent, it carries with it the relevant information that allows this filtering.

The fundamental idea behind its implementation is that the designer is able to create damage types, such as explosive, blunt, fire, and sub-types such as grenade, bullet and so on. These are then processed by the engine and assigned to unique bitmasks for fast processing. You can then create weapons that deal this damage, triggers that watch for them (for example a destructible wall only vulnerable to explosive damage), and characters who can listen for these types and process them how you choose.

In an upcoming post I will outline the basic implementation of this system. Stay tuned!

In Practical scripting Tags Scripting
← Reducing difficulty dynamically and invisiblyHow would we go about coding the memory marker? →
Twitter
  • RT @CKapmeh: Sunday Capilla San Bernardo / Nicolás Campodonico https://t.co/V56q7uftPf
    May 28, 2017, 10:42 AM
  • Crunch dadaism. Come to @Naughty_Dog and experience the highs of creative culture. https://t.co/9yMPcTdiYA
    May 27, 2017, 9:33 AM
  • Crunch garden #gamedev Avocado, Lemon and Peppers. From right to left. https://t.co/jtZXeWDEgh
    May 27, 2017, 9:31 AM
  • Working with a migraine two days in a row is quite possibly the most unpleasant thing in recent memory.
    May 26, 2017, 3:36 PM
  • Sure is fun to have a night off! #PS4share https://t.co/WMcEMY5yWE
    May 21, 2017, 7:59 PM
  • The EU/US PSN account conflict is an ongoing nightmare. Looks like I'm not playing anything tonight after all.... pain!
    May 21, 2017, 7:49 PM