Skip to main content

Damage Over Time (DoT)

This guide walks you through creating your first Damage-over-Time (DoT) effect using Master Combat Core.

Prerequisites

Before starting, make sure:

  • You already have a player character.
  • An EntityComponent has been added to the player prefab (from the previous guide)
  • Core Attributes have been set up (e.g. hp)

Step 1 — Create the DoT Graph

  1. Right-click in the Project Window and create a new GraphObject:
    • Create > Soft Kitty > Node Graph Object
  2. Double-click the asset to open it in the Graph Editor
  3. Create two Variable Nodes and set their type to Dynamic Variables.
  4. Configure them as follows:
    UIDDefault Value
    damage1
    Layer1
  5. Add a Math NodeMultiply.
  6. Connect both Dynamic Variable Nodes to the input ports of the Multiply Math Node.

Step 2 — Configure Always-On Execution

  1. Remove the Trigger Node and Condition Node.

    • DoT graphs are executed continuously by the Over-Time Effect system and do not require triggers.
  2. Create a Target Entity Node and connect it to the Entity input of an AttributeChange Action Node.

  3. Connect the Multiply Math Node output to the Value input of the AttributeChange Action Node.

  4. Configure the Action Node:

    • Attribute UID: hp
    • Operation: Subtract

Your graph should now look like this:


Step 3 — Create the Over Time Effect (OTE)

  1. Go to:
    • Project Settings > SoftKitty > SubData - Over Time Effect
  2. Click Add New OverTimeEffect.
  3. Fill in basic information such as:
    • Display Name
    • Category
    • Duration
  4. Set:
    • UID: poison
    • Design Graph: drag in the DoT Graph you just created
  5. Click Read From Design Graph.
    • The system will detect and list all Dynamic Variables.
  6. Adjust values:
    • Set damage to any number you want
    • Layer is locked (system-managed)
  7. Enable:
    • Can Be Refreshed
    • Layered
    • Set Maximum Layer to 99

Step 4 — Apply the DoT via Code

You can now apply the DoT to an entity using code:

GameManager.GetPlayer().AddOverTimeEffect("poison", null);

During runtime:

  • Monitor the EntityComponent Inspector.
  • Repeatedly apply the DoT
  • Observe that:
    • The effect stacks
    • Damage scales with the number of layers
    • The player’s hp decreases accordingly

Step 5 — Apply DoT from a Damage Graph (On Hit)

You can also apply a DoT from another Graph.

  1. Open the Damage Graph created in the previous guide.
  2. Add a new Action Node.
  3. Change its type to OverTimeEffect.
  4. Set:

Now, when the damage graph executes:

  • Damage is applied
  • Poison is added to the target on hit

Result

You now have:

  • A fully functional Damage-over-Time system
  • Layered and refreshable effects
  • Graph-driven damage logic
  • Reusable DoT behavior across skills, weapons, and enemies

Notes & Best Practices

  • Dynamic Variables allow design-time tuning without code changes

  • Layering enables powerful effects like poison, burn, bleed, or corrosion

  • The same DoT graph can be reused across multiple effects