Combat Attack/Defense

This article briefly explains the combat attack/defense process in the General Combat System (GCS), helping you to better understand the workflow of GCS.

Cover.GCS
罗传月武(YueWu)

Author

罗传月武(YueWu)

专注游戏开发和Web技术。

Created: Nov 25, 2025Updated: Sep 15, 2026

Table of contents

Overview

This article briefly explains the combat attack/defense process in the General Combat System (GCS), helping you to better understand the workflow of GCS.

Attack Process

The attack process refers to the procedure in which combat entities initiate attacks against other combat entities in the game.

Any entity involved in combat (including the environment object/traps) can initiate an attack against other combat entities in the game.

The sole purpose of the entire attack process is to: Create GameplayEffect instances and apply it to the targets.

The following diagram illustrates the general process of a humanoid character initiating an attack in GCS:

战斗流程.攻

Breakdown

  1. Activate Ability: The Attacker (Player/AI) activates different Abilities, such as melee Ability or Spell Ability.
  2. Initiate Attack Request: The ability will play different ability actions (montages), and you will place AttackTrace/BulletTraceanim notify states in the animation sequences, configuring the relevant attack request's configuration.
  3. Ability Handles Attack Request: The AttackTraceNotifyState 's start and end will pass the attack request to the Ability for processing through Gameplay events. The Ability will then construct the necessary GameplayEffect instances based on the relevant information in the attack request.
  4. Melee: If it is a Melee request, the associated collision trace instance of the character or weapon will be activated, and relevant information will be passed to the collision trace instance. Once the collision trace instance identifies a valid target, it will notify the Ability to apply the gameplay effect.
  5. Bullet: If it is a Bullet request, a bullet instance will be spawned through the bullet system, and relevant information (gameplay effect instances) will be passed to the bullet instance. Each bullet instance has its own collision traces, and once it identifies a valid target, the bullet will apply the attack to the target.

For The gameplay effect instances created during the attack process (GameplayEffectSpec/GameplayEffectContainerSpec), you can modify them before they are actually applied to the targets.
For example:

  1. Pass the numerical parameters defined in the attack definition to the GE.
  2. Add different Tags to the GE as needed and use them in subsequent processes (for example, using Tags to indicate whether it is fire damage or magic damage).
  3. Bullets reduce damage over distance.
  4. Add new targets to the GE during the bullet's flight.
  5. Send a GameplayEvent and pass the Context in, allowing other passive abilities to conditionally modify the contents of the Context.

Damage Calculation

GCS standardizes the implementation of the attack process, where the attacker's goal is to add a GameplayEffect to the target, and as a game designer, you need to customize your Damage Execution Calculation

Defense Process

The defense process refers to the procedure in which a combat entity is attacked by other combat entities in the game and the corresponding handling process.

The following diagram illustrates the general process of the 'victim' handling an incoming attack:

战斗流程设计.防

Each combat entity use Combat Flow to process each incoming attack.

Summary

The so-called combat essentially refers to: the offensive and defensive behavior between combat entities in the game, resulting in combat results and related result processing.