Skip to content
Back to wiki

Attack System

The attack system documentation of Generic Combat System.

A

Author

Author

Created: Nov 24, 2025Updated: Oct 12, 2026

Table of contents

Overview

GCS stores per-hit static data in an AttackDefinition. A melee or bullet AttackRequest then specifies when and how to use that data. One attack action can use different requests and definitions across its hit windows.

Attack Definition

FGCS_AttackDefinition is a DataTable row structure for a single hit. Create a DataTable with the FGCS_AttackDefinition row type, then add rows for the attack phases, weapons, or damage variants used by your game.

Main Fields

  • AttackTags: Gameplay Tags that describe the attack. They are added to the GameplayEffectSpec as dynamic asset tags for calculations and later processing.
  • SetByCallerMagnitudes: A GameplayTag-to-float map passed into the GameplayEffectSpec for execution calculations and other logic.
  • TargetEffectClass and TargetEffectContainer: Configure a Gameplay Effect class and an effect container for the hit target. These are not mutually exclusive; each valid configuration is applied independently. If TargetEffectClassLevel is less than 1, the Ability level is used. The container effect level is determined by the Ability level.
  • Hit feedback data: Configure target Gameplay Cues, KnockbackDistance, KnockbackMultiplier, HitStallingDuration, and HitPlayRateFactor.
  • Extension fields: C++ uses the NativeExtension struct, while Blueprint uses the Extension instanced struct to add project-specific attack data.

The attack-definition handle is written into the Gameplay Effect's EffectContext so later CombatFlow logic and processors can read the associated definition.

Organizing Attack Definition Tables

Split DataTables by weapon category, attack type, or the data organization that works for your project. A melee AttackRequest stores an attack-definition row handle directly; a bullet references its attack-definition row through its BulletDefinition.

Attack Requests

UGCS_AttackRequest_Base is the base class for attack requests, and each concrete request supplies an attack-definition handle. GCS currently provides melee and bullet request types. A request describes an attack's parameters; it does not execute hit handling by itself.

Melee Attacks

Use GCS_ANS_AttackTrace during a melee window to store a UGCS_AttackRequest_Melee. The request contains:

  • TracesToControl, the Trace tags to start and stop during the attack window.
  • AttackDefinitionHandle, the attack-definition row for this hit.

UGCS_ANS_AttackTrace is a request-data container, not a runtime Trace executor. Ability or project logic calls AddMeleeRequest / RemoveMeleeRequest on UGCS_AbilityTask_CollisionTrace at the start and end of the window. The task starts and stops Traces through UGCS_TraceSystemComponent, then returns hit data to the Ability through OnTargetsFound.

Bullet Attacks

For a bullet attack, UGCS_AttackRequest_Bullet selects a bullet definition through BulletDefinitionHandle. The BulletDefinition then selects the attack definition through AttackDefinition.

The request can also configure the launch and aiming source:

  • TargetingSourceType selects a camera-, Pawn-, or weapon-based forward/focus mode. For Custom, override GetTargetingTransform in a BulletRequest subclass.
  • SourceComponentLookupTagName finds a source component; SourceSocketName, SourceWeaponSocketName, and LocationOffset configure the source location.
  • When bRequireTargeting is enabled, TargetingPreset is required. The request can resolve the source Pawn's current combat target.

UGCS_ANS_BulletTrace can store a BulletRequest on the animation. The Ability's GameplayEvent must put the request in the event data's OptionalObject; UGCS_AbilityTask_BulletTrace listens for its configured event tag, reads the request, and asks UGCS_BulletSystemComponent to spawn the bullet.

Local prediction is limited to the trajectory and visual presentation of the first player-initiated bullet batch. Predicted bullets do not apply Gameplay Effects; the server authoritatively handles hits and effect resolution.

Custom Attack Request Types

Derive from UGCS_AttackRequest_Base to add parameters for your project. If a BulletRequest uses Custom for TargetingSourceType, derive from UGCS_AttackRequest_Bullet and implement GetTargetingTransform.