<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Building an RPG with GAS on BoilTask's Blog</title><link>https://boiltask.com/en/tags/building-an-rpg-with-gameplay-ability-system/</link><description>Recent content in Building an RPG with GAS on BoilTask's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Wed, 04 Feb 2026 20:13:45 +0800</lastBuildDate><atom:link href="https://boiltask.com/en/tags/building-an-rpg-with-gameplay-ability-system/index.xml" rel="self" type="application/rss+xml"/><item><title>Building an RPG with GAS - GAS Beginner's Guide</title><link>https://boiltask.com/en/note/building-an-rpg-with-gameplay-ability-system-2/</link><pubDate>Wed, 04 Feb 2026 20:13:45 +0800</pubDate><guid>https://boiltask.com/en/note/building-an-rpg-with-gameplay-ability-system-2/</guid><description>&lt;h2 id="core-learning-objectives"&gt;&lt;a href="#core-learning-objectives" class="header-anchor"&gt;&lt;/a&gt;Core Learning Objectives
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Ability System Component Initialization&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Master how to enable key plugins with one click&lt;/li&gt;
&lt;li&gt;Complete the initialization and configuration of the GAS core component, ASC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Gameplay Ability Design&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn how to design and implement Gameplay Abilities&lt;/li&gt;
&lt;li&gt;Understand the full lifecycle of ability activation and cancellation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Gameplay Tag System&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Master the creation and management of Gameplay Tags&lt;/li&gt;
&lt;li&gt;Use tags to enable flexible interactions between characters&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="gas-core-architecture-analysis"&gt;&lt;a href="#gas-core-architecture-analysis" class="header-anchor"&gt;&lt;/a&gt;GAS Core Architecture Analysis
&lt;/h2&gt;&lt;h3 id="ability-system-component-asc"&gt;&lt;a href="#ability-system-component-asc" class="header-anchor"&gt;&lt;/a&gt;Ability System Component (ASC)
&lt;/h3&gt;&lt;p&gt;ASC is the heart of the GAS framework and has the following characteristics:&lt;/p&gt;
&lt;pre class="mermaid"&gt;
graph TB
A[ASC] --&amp;gt; B[Owner Actor]
A --&amp;gt; C[Avatar Actor]
A --&amp;gt; D[Ability Actor Info]
D --&amp;gt; E[Player Controller]
D --&amp;gt; F[Animation Instance]
D --&amp;gt; G[Movement Component]
A --&amp;gt; H[Gameplay Abilities]
A --&amp;gt; I[Gameplay Tags]
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;ASC Core Features:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Exclusive component: each Actor can have only one ASC attached&lt;/li&gt;
&lt;li&gt;Central nervous system: handles underlying logic such as ability activation, effect calculation, and State Synchronization&lt;/li&gt;
&lt;li&gt;Two-way interaction: enables real-time interaction and feedback between Actors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Difference Between Owner and Avatar:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Owner&lt;/strong&gt;: the Actor that owns the ASC (such as a Gameplay character or PlayerController)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avatar&lt;/strong&gt;: the entity Actor that performs actions in the game world (such as a player character or NPC)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In single-player games or with ordinary NPCs, the Owner and Avatar are usually the same Actor; in multiplayer games, to improve performance and logical clarity, it is recommended to separate the two.&lt;/p&gt;
&lt;h3 id="gameplay-ability"&gt;&lt;a href="#gameplay-ability" class="header-anchor"&gt;&lt;/a&gt;Gameplay Ability
&lt;/h3&gt;&lt;p&gt;Gameplay Ability drives all actions in the game, from basic attacks to complex skills:&lt;/p&gt;
&lt;pre class="mermaid"&gt;
stateDiagram-v2
[*] --&amp;gt; Granted
Granted --&amp;gt; Activated : TryActivateAbility
Activated --&amp;gt; Executing : OnActivate
Executing --&amp;gt; Cancelled : CancelAbility
Executing --&amp;gt; Ended : OnEnd
Cancelled --&amp;gt; [*]
Ended --&amp;gt; [*]
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Ability Lifecycle Management:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Grant ability&lt;/strong&gt;: use the &lt;code&gt;GiveAbility()&lt;/code&gt; function to assign an ability class to the ASC&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Store handle&lt;/strong&gt;: the ability is encapsulated as a SpecHandle and stored in the ASC&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instantiate and trigger&lt;/strong&gt;: instantiate it as a GameplayAbility object when needed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Execution control&lt;/strong&gt;: activate and cancel through the SpecHandle&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="gameplay-tag"&gt;&lt;a href="#gameplay-tag" class="header-anchor"&gt;&lt;/a&gt;Gameplay Tag
&lt;/h3&gt;&lt;p&gt;Gameplay Tag is a lightweight string identifier with a hierarchical structure:&lt;/p&gt;
&lt;pre class="mermaid"&gt;
graph TD
A[CharacterAction] --&amp;gt; A1[Attack]
A --&amp;gt; A2[Skill]
A1 --&amp;gt; A11[Melee]
A1 --&amp;gt; A12[Ranged]
A2 --&amp;gt; A21[FireSpell]
A2 --&amp;gt; A22[IceSpell]
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Advantages of the Tag System:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Global management&lt;/strong&gt;: configure centrally in Project Settings and use throughout the project&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hierarchical structure&lt;/strong&gt;: supports parent-child tree classification for easier organization and management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic extension&lt;/strong&gt;: add and remove tags dynamically at runtime&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container support&lt;/strong&gt;: Gameplay Tag Container can hold multiple tags for combined use&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="hands-on-exercise-1-modifying-the-basic-jump-ability"&gt;&lt;a href="#hands-on-exercise-1-modifying-the-basic-jump-ability" class="header-anchor"&gt;&lt;/a&gt;Hands-on Exercise 1: Modifying the Basic Jump Ability
&lt;/h2&gt;&lt;h3 id="project-setup-and-environment-preparation"&gt;&lt;a href="#project-setup-and-environment-preparation" class="header-anchor"&gt;&lt;/a&gt;Project Setup and Environment Preparation
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Step 1: Create a Project&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a new third-person Template project named &lt;code&gt;Example1_1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Enable the &lt;code&gt;Gameplay Abilities&lt;/code&gt; plugin in Editor Preferences&lt;/li&gt;
&lt;li&gt;Restart the editor to complete plugin activation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Modify the Character Blueprint&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 在角色蓝图中添加Ability System Component
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;UAbilitySystemComponent&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ASC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;CreateDefaultSubobject&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;UAbilitySystemComponent&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;ASC&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Step 3: Create the Jump Ability&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a Blueprint &lt;code&gt;BPGAJump&lt;/code&gt; based on the engine&amp;rsquo;s built-in &lt;code&gt;GameplayAbility&lt;/code&gt; class&lt;/li&gt;
&lt;li&gt;Set the instancing policy to &amp;ldquo;Instanced per Actor&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Call the &lt;code&gt;GiveAbility()&lt;/code&gt; function during character initialization to grant the jump ability&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="implementing-the-ability-trigger-mechanism"&gt;&lt;a href="#implementing-the-ability-trigger-mechanism" class="header-anchor"&gt;&lt;/a&gt;Implementing the Ability Trigger Mechanism
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;SpecHandle Management:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;span class="lnt"&gt;8
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 存储能力句柄
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;FGameplayAbilitySpecHandle&lt;/span&gt; &lt;span class="n"&gt;JumpSpecHandle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 激活跳跃能力
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;TryActivateAbility&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;JumpSpecHandle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 取消跳跃能力
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;CancelAbilityHandle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;JumpSpecHandle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Input Binding Refactor:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Replace the original direct jump call with triggering the ability through the ASC&lt;/li&gt;
&lt;li&gt;Activate the ability when the key is pressed and cancel it when released&lt;/li&gt;
&lt;li&gt;Preserve the original jump feel while implementing the GAS architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="implementing-area-jump-restrictions"&gt;&lt;a href="#implementing-area-jump-restrictions" class="header-anchor"&gt;&lt;/a&gt;Implementing Area Jump Restrictions
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Create Gameplay Tags:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create the &lt;code&gt;Character.BlockJump&lt;/code&gt; tag in Project Settings&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;BlockTag&lt;/code&gt; variable (Gameplay Tag type) in the trigger zone Blueprint&lt;/li&gt;
&lt;li&gt;Set the default value to &lt;code&gt;Character.BlockJump&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Trigger Zone Logic:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="mermaid"&gt;
sequenceDiagram
participant P as Player
participant T as Trigger Zone
participant A as ASC
participant G as Gameplay Ability
P-&amp;gt;&amp;gt;T: Enter Zone
T-&amp;gt;&amp;gt;A: Add Tag(Character.BlockJump)
A-&amp;gt;&amp;gt;G: Check Activation Blocked Tags
G--&amp;gt;&amp;gt;A: Ability Blocked
P-&amp;gt;&amp;gt;P: Jump Input
A--&amp;gt;&amp;gt;P: Jump Failed
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Configure Ability Blocking:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add &lt;code&gt;Character.BlockJump&lt;/code&gt; to the jump ability&amp;rsquo;s &lt;code&gt;Activation Blocked Tags&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;When the character has this tag, the jump ability is automatically disabled&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="hands-on-exercise-2-building-a-gimmick-level-system"&gt;&lt;a href="#hands-on-exercise-2-building-a-gimmick-level-system" class="header-anchor"&gt;&lt;/a&gt;Hands-on Exercise 2: Building a Gimmick Level System
&lt;/h2&gt;&lt;h3 id="project-architecture-design"&gt;&lt;a href="#project-architecture-design" class="header-anchor"&gt;&lt;/a&gt;Project Architecture Design
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Class Naming Convention:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All custom classes use the &lt;code&gt;AB&lt;/code&gt; prefix (ArenaBattle)&lt;/li&gt;
&lt;li&gt;Base character class: &lt;code&gt;ABBaseCharacter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Player character class: &lt;code&gt;ABPlayerCharacter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;NPC character class: inherits from &lt;code&gt;ABBaseCharacter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Module Dependency Configuration:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Build.cs文件中添加必要模块
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;PublicDependencyModuleNames&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddRange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;Core&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;CoreUObject&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Engine&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;InputCore&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s"&gt;&amp;#34;UMG&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;GameplayAbilities&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;GameplayTags&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="asc-initialization-strategy"&gt;&lt;a href="#asc-initialization-strategy" class="header-anchor"&gt;&lt;/a&gt;ASC Initialization Strategy
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Player Character Initialization:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;AABPlayerCharacter&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;PossessedBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AController&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;NewController&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Super&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;PossessedBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NewController&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// ASC初始化最佳时机
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;InitAbilityActorInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;UI Integration Interface:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement the &lt;code&gt;UAbilitySystemInterface&lt;/code&gt; interface&lt;/li&gt;
&lt;li&gt;Override &lt;code&gt;GetAbilitySystemComponent()&lt;/code&gt; to return the ASC reference&lt;/li&gt;
&lt;li&gt;Make it easier for the UI system to access character state information&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="implementing-the-gimmick-interaction-system"&gt;&lt;a href="#implementing-the-gimmick-interaction-system" class="header-anchor"&gt;&lt;/a&gt;Implementing the Gimmick Interaction System
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Gimmick Box Design:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="mermaid"&gt;
graph LR
A[Gimmick Box] --&amp;gt; B[Trigger Volume]
A --&amp;gt; C[Mesh Effect]
A --&amp;gt; D[ASC]
A --&amp;gt; E[Target Gimmick]
B --&amp;gt; F[OnActorBeginOverlap]
F --&amp;gt; G[Apply Gameplay Tag]
G --&amp;gt; H[Notify Target]
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Box Blueprint Configuration:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Root component&lt;/strong&gt;: Trigger Volume (trigger volume)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Visual effect&lt;/strong&gt;: Mesh Effect component&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GAS support&lt;/strong&gt;: Ability System Component&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Target reference&lt;/strong&gt;: Target Gimmick variable (Actor reference)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Tag Event System:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 创建事件标签
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;FGameplayTag&lt;/span&gt; &lt;span class="n"&gt;EventGimmickCleared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FGameplayTag&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;RequestGameplayTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Event.GimmickCleared&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;FGameplayTag&lt;/span&gt; &lt;span class="n"&gt;EventGameCleared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FGameplayTag&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;RequestGameplayTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Event.GameCleared&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 根据箱子类型发送不同事件
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;FGameplayTag&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt; &lt;span class="n"&gt;TagContainer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bGameClear&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;TagContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EventGameCleared&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;TagContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EventGimmickCleared&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;AddLooseGameplayTags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TagContainer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Gimmick Area Response:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 绑定标签变更事件
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;RegisterGameplayTagEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EventGimmickCleared&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddUObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;ABP_Gimmick&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;OnGimmickClearedBP&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 机关解谜成功处理
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;ABP_Gimmick&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;OnGimmickClearedBP&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// 旋转门开启
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;PlusXGate&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;SetRelativeRotation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FRotator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="game-clear-system"&gt;&lt;a href="#game-clear-system" class="header-anchor"&gt;&lt;/a&gt;Game Clear System
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Game Clear Detection Logic:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the &lt;code&gt;Game Clear&lt;/code&gt; flag of the gimmick box in the second area to true&lt;/li&gt;
&lt;li&gt;Send the &lt;code&gt;Event.GameCleared&lt;/code&gt; tag when the player touches the box&lt;/li&gt;
&lt;li&gt;The player character listens for this tag and triggers the game clear event&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Visual Feedback System:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 触发烟花特效
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;FireworkComponent&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;Activate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 显示庆祝UI
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;HUDWidget&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;SetGameCleared&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// UI组件内部实现
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;UHUDWidget&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;SetGameCleared&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;bCleared&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;CelebrationText&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;SetVisibility&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bCleared&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;ESlateVisibility&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nl"&gt;Visible&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ESlateVisibility&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Hidden&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="debugging-and-optimization-tips"&gt;&lt;a href="#debugging-and-optimization-tips" class="header-anchor"&gt;&lt;/a&gt;Debugging and Optimization Tips
&lt;/h2&gt;&lt;h3 id="gas-debug-commands"&gt;&lt;a href="#gas-debug-commands" class="header-anchor"&gt;&lt;/a&gt;GAS Debug Commands
&lt;/h3&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;bash&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 显示GAS调试信息&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;showdebug abilitysystem
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 可在蓝图自动化执行&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Execute Console Command &lt;span class="s2"&gt;&amp;#34;showdebug abilitysystem&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="performance-optimization-recommendations"&gt;&lt;a href="#performance-optimization-recommendations" class="header-anchor"&gt;&lt;/a&gt;Performance Optimization Recommendations
&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Tag management&lt;/strong&gt;: use Tag Container appropriately to avoid making individual tags overly complex&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ability instancing&lt;/strong&gt;: choose the appropriate instancing policy based on requirements&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Event listening&lt;/strong&gt;: unregister event listeners that are no longer needed in a timely manner&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory management&lt;/strong&gt;: properly manage the lifecycle of SpecHandle&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="key-takeaways"&gt;&lt;a href="#key-takeaways" class="header-anchor"&gt;&lt;/a&gt;Key Takeaways
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Central Role of ASC&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All GAS Actors are uniformly scheduled through the ASC&lt;/li&gt;
&lt;li&gt;During initialization, the Owner and Avatar references are automatically stored in AbilityActorInfo&lt;/li&gt;
&lt;li&gt;Acts as the central nervous system for interactions between Actors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Ability Management Flow&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;GiveAbility()&lt;/code&gt; function to grant abilities and obtain a SpecHandle&lt;/li&gt;
&lt;li&gt;Use the SpecHandle for precise ability activation and cancellation control&lt;/li&gt;
&lt;li&gt;Supports on-demand instantiation to optimize memory usage&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Advantages of the Tag System&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A globally available lightweight state management solution&lt;/li&gt;
&lt;li&gt;Share game state without defining additional variables&lt;/li&gt;
&lt;li&gt;The hierarchical structure supports complex conditional logic&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Architecture Design Philosophy&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Avoid complex Blueprint communication and adopt event-based loosely coupled design&lt;/li&gt;
&lt;li&gt;Use the tag system to implement flexible state-driven behavior&lt;/li&gt;
&lt;li&gt;Modular design facilitates feature expansion and maintenance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By studying this tutorial, developers can master the core concepts and practical techniques of GAS and build efficient, flexible game interaction systems. The power of GAS lies in its complete solution set, which makes implementing complex game mechanics simple and elegant.&lt;/p&gt;
&lt;h2 id="references"&gt;&lt;a href="#references" class="header-anchor"&gt;&lt;/a&gt;References
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://dev.epicgames.com/community/learning/courses/QQv/unreal-engine-building-an-rpg-with-gameplay-ability-system/V1n5/unreal-engine-getting-started-with-gas" target="_blank" rel="noopener"&gt;Getting Started with GAS - Building an RPG with Gameplay Ability System&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Building an RPG with GAS - Introduction to RPG and GAS Construction</title><link>https://boiltask.com/en/note/building-an-rpg-with-gameplay-ability-system-1/</link><pubDate>Wed, 04 Feb 2026 12:51:11 +0800</pubDate><guid>https://boiltask.com/en/note/building-an-rpg-with-gameplay-ability-system-1/</guid><description>&lt;blockquote&gt;
&lt;p&gt;Based on the introduction to the Unreal Engine community course &amp;ldquo;Building an RPG with Gameplay Ability System,&amp;rdquo; this is a compiled set of related documentation.&lt;/p&gt;
&lt;p&gt;GAS: Gameplay Ability System (GAS) is a plugin in Unreal Engine for implementing a gameplay ability system. It provides a flexible way to define and manage in-game abilities, such as attacking, moving, and jumping. GAS allows developers to define abilities declaratively rather than hardcoding them in code. This makes the gameplay ability system more extensible and maintainable.&lt;/p&gt;
&lt;p&gt;RPG: Role-Playing Game (RPG) is a genre of game that creates virtual worlds by simulating character interaction. It usually involves players taking on roles, interacting with other players or NPCs (non-player characters), and completing quests and challenges. RPGs generally focus on character development, social interaction, and personal growth.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="what-exactly-is-gas"&gt;&lt;a href="#what-exactly-is-gas" class="header-anchor"&gt;&lt;/a&gt;What Exactly Is GAS?
&lt;/h2&gt;&lt;h3 id="core-definition"&gt;&lt;a href="#core-definition" class="header-anchor"&gt;&lt;/a&gt;Core Definition
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Gameplay Ability System (GAS)&lt;/strong&gt; is a &lt;strong&gt;game character interaction design framework based on the concept of &amp;ldquo;Abilities&amp;rdquo;&lt;/strong&gt; developed and maintained long-term by Epic Games.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In one sentence&lt;/strong&gt;: It is the underlying mechanism system that enables game characters to &amp;ldquo;do something.&amp;rdquo;&lt;/p&gt;
&lt;h3 id="applicable-scenarios"&gt;&lt;a href="#applicable-scenarios" class="header-anchor"&gt;&lt;/a&gt;Applicable Scenarios
&lt;/h3&gt;&lt;p&gt;GAS is particularly suitable for the following types of game development:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Game Type&lt;/th&gt;
&lt;th&gt;Typical Features&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;RPG&lt;/strong&gt; (Role-Playing Game)&lt;/td&gt;
&lt;td&gt;Complex skill tree systems, character progression systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Action-Adventure Games&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Diverse combat actions, combo systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MOBA&lt;/strong&gt; (Multiplayer Online Battle Arena)&lt;/td&gt;
&lt;td&gt;Multi-hero ability interactions, team collaboration mechanics&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Core criterion&lt;/strong&gt;: As long as your game requires characters to have &amp;ldquo;cool skill trees, the ability to fight and level up, and the ability to battle or cooperate with others,&amp;rdquo; GAS is the best choice.&lt;/p&gt;
&lt;h3 id="why-do-we-need-gas"&gt;&lt;a href="#why-do-we-need-gas" class="header-anchor"&gt;&lt;/a&gt;Why Do We Need GAS?
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Pain points of traditional development&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Building an ability system from scratch requires &lt;strong&gt;years of accumulated experience&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Especially for &lt;strong&gt;networked multiplayer games&lt;/strong&gt;, the development workload is huge and error-prone&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Advantages of GAS&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Official backing&lt;/strong&gt;: Developed by Epic Games and maintained and updated long-term&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Battle-tested&lt;/strong&gt;: Validated by multiple AAA titles, with extremely high stability&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Highly flexible&lt;/strong&gt;: Modular design, freely extensible and customizable&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Out of the box&lt;/strong&gt;: Built-in networking support, State Synchronization, input validation, and other mechanisms&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="the-other-side-of-gas"&gt;&lt;a href="#the-other-side-of-gas" class="header-anchor"&gt;&lt;/a&gt;The &amp;ldquo;Other Side&amp;rdquo; of GAS
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;⚠️ Barrier to entry&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Steep learning curve&lt;/strong&gt;: Requires understanding a large number of subsystems and their relationships&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;High configuration complexity&lt;/strong&gt;: High modularity means more components need to be configured&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficult debugging&lt;/strong&gt;: The decoupled design between modules increases the complexity of locating problems&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;❌ Unsuitable scenarios&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Minimalist small-scale games (Overkill)&lt;/li&gt;
&lt;li&gt;Millisecond-level competitive games with stringent response-time requirements (performance overhead)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="gas-design-philosophy-core-gameplay-loop"&gt;&lt;a href="#gas-design-philosophy-core-gameplay-loop" class="header-anchor"&gt;&lt;/a&gt;GAS Design Philosophy: Core Gameplay Loop
&lt;/h2&gt;&lt;h3 id="problems-with-traditional-game-logic"&gt;&lt;a href="#problems-with-traditional-game-logic" class="header-anchor"&gt;&lt;/a&gt;Problems with Traditional Game Logic
&lt;/h3&gt;&lt;p&gt;Although Unreal Engine provides an intelligent decision-making system (allowing players/NPCs to make autonomous decisions based on the battle situation), &lt;strong&gt;the specific interaction logic still needs to be written from scratch by developers&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The real game experience comes from &lt;strong&gt;the actual impact of actions on the underlying mechanics&lt;/strong&gt;, for example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cast an ability → change base attributes → unlock a new ability → character levels up → form a loop&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="the-three-pillars-of-gas"&gt;&lt;a href="#the-three-pillars-of-gas" class="header-anchor"&gt;&lt;/a&gt;The &amp;ldquo;Three Pillars&amp;rdquo; of GAS
&lt;/h3&gt;&lt;p&gt;GAS formally breaks the core gameplay loop into three major modules and provides &lt;strong&gt;out-of-the-box&lt;/strong&gt; support:&lt;/p&gt;
&lt;pre class="mermaid"&gt;
graph LR
A[Abilities&amp;lt;br/&amp;gt;技能] --&amp;gt; B[Attributes&amp;lt;br/&amp;gt;属性]
B --&amp;gt; C[Effects&amp;lt;br/&amp;gt;效果]
C --&amp;gt; A
&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Abilities&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Define actions a character can perform&lt;/td&gt;
&lt;td&gt;Basic attack, dodge roll, channeled casting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Attributes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The character&amp;rsquo;s numeric state&lt;/td&gt;
&lt;td&gt;Health, stamina, mana&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Effects&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The actual impact on attributes&lt;/td&gt;
&lt;td&gt;Deal damage, restore health, add Buff&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Core advantage&lt;/strong&gt;: This design achieves &lt;strong&gt;god-tier modularity&lt;/strong&gt;—the modules are decoupled from one another, enabling both small prototypes and AAA-scale titles.&lt;/p&gt;
&lt;h3 id="one-stop-network-synchronization-support-in-gas"&gt;&lt;a href="#one-stop-network-synchronization-support-in-gas" class="header-anchor"&gt;&lt;/a&gt;One-Stop Network Synchronization Support in GAS
&lt;/h3&gt;&lt;p&gt;GAS has built-in powerful multiplayer support:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Input validation mechanism&lt;/strong&gt;: Prevents cheating and ensures the legitimacy of actions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;State rollback system&lt;/strong&gt;: Handles synchronization issues during complex interactions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Frame-level synchronization&lt;/strong&gt;: Ensures fairness across the entire network and runs stably even in complex network environments&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="detailed-explanation-of-the-six-core-gas-components"&gt;&lt;a href="#detailed-explanation-of-the-six-core-gas-components" class="header-anchor"&gt;&lt;/a&gt;Detailed Explanation of the Six Core GAS Components
&lt;/h2&gt;&lt;h3 id="ability-system-component-asc--the-heart-of-the-system"&gt;&lt;a href="#ability-system-component-asc--the-heart-of-the-system" class="header-anchor"&gt;&lt;/a&gt;Ability System Component (ASC) — The Heart of the System
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;: The core and foundation of the GAS architecture&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Core functions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Acts as the &lt;strong&gt;central hub&lt;/strong&gt;, coordinating and managing all other GAS components&lt;/li&gt;
&lt;li&gt;Handles lifecycle management such as granting, activating, and canceling abilities&lt;/li&gt;
&lt;li&gt;Handles registration and synchronization of attribute sets&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;: Simply attach the ASC component to any Actor, and that Actor gains the ability to use GAS.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-header"&gt;
&lt;span class="highlight-language"&gt;cpp&lt;/span&gt;
&lt;/div&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 核心概念：ASC 是 GAS 的&amp;#34;入口点&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// 所有功能都建立在 ASC 的基础之上
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="gameplay-tags--a-state-description-language"&gt;&lt;a href="#gameplay-tags--a-state-description-language" class="header-anchor"&gt;&lt;/a&gt;Gameplay Tags — A State Description Language
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;: The &amp;ldquo;Pro upgrade&amp;rdquo; of the built-in tag system&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Core features&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tree-like hierarchy&lt;/strong&gt;: Supports parent-child inheritance relationships (e.g., &lt;code&gt;Status.Buff.Fire&lt;/code&gt; inherits from &lt;code&gt;Status.Buff&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;State snapshot&lt;/strong&gt;: Precisely describes the various states an Actor is currently in&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conditional trigger&lt;/strong&gt;: Defines prerequisites for ability activation (e.g., &amp;ldquo;the crowd-control removal ability can only be used when the &lt;code&gt;Status.Stunned&lt;/code&gt; tag is present&amp;rdquo;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Design value&lt;/strong&gt;: Gameplay Tags are the core pillar for GAS to achieve &lt;strong&gt;modular design&lt;/strong&gt; and &lt;strong&gt;high extensibility&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id="gameplay-abilities-ga--the-gameplay-implementation-layer"&gt;&lt;a href="#gameplay-abilities-ga--the-gameplay-implementation-layer" class="header-anchor"&gt;&lt;/a&gt;Gameplay Abilities (GA) — The Gameplay Implementation Layer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;: The actual &amp;ldquo;gameplay&amp;rdquo; definition layer; every executable action corresponds to a GA&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Coverage&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Basic actions: basic attack, roll, jump&lt;/li&gt;
&lt;li&gt;Complex abilities: channeled casting, combos, ultimate abilities&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Execution flow&lt;/strong&gt;:
GA has built-in complete &lt;strong&gt;lifecycle management&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class="mermaid"&gt;
graph TD
A[尝试激活] --&amp;gt; B{检查标签条件}
B --&amp;gt;|通过| C[激活成功]
B --&amp;gt;|失败| D[激活失败]
C --&amp;gt; E[执行 Ability Tasks]
E --&amp;gt; F{执行结果}
F --&amp;gt;|成功| G[触发 Gameplay Events]
F --&amp;gt;|取消| H[执行取消逻辑]
F --&amp;gt;|失败| I[执行失败回调]
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Key features&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ability Tasks&lt;/strong&gt;: Specifically handle asynchronous flows (e.g., &amp;ldquo;release after charging for 2 seconds&amp;rdquo;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Event-driven&lt;/strong&gt;: Trigger Gameplay Events on success, affecting other parts of the system&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="attribute-sets--the-data-itself"&gt;&lt;a href="#attribute-sets--the-data-itself" class="header-anchor"&gt;&lt;/a&gt;Attribute Sets — The Data Itself
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;: The &amp;ldquo;data container&amp;rdquo; for character attributes&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Attribute categories&lt;/strong&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Persistent attributes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Long-lived, saved to the save game&lt;/td&gt;
&lt;td&gt;Health, Level&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Temporary attributes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Transient, used for calculation and transfer&lt;/td&gt;
&lt;td&gt;Damage of the current attack&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Design Pattern&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;UAttributeSet&lt;/code&gt; class to define attributes&lt;/li&gt;
&lt;li&gt;Supports predictive network synchronization (Client-Side Prediction)&lt;/li&gt;
&lt;li&gt;Automatically triggers delegate events when attributes change&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="gameplay-effects-ge--attribute-modifiers"&gt;&lt;a href="#gameplay-effects-ge--attribute-modifiers" class="header-anchor"&gt;&lt;/a&gt;Gameplay Effects (GE) — Attribute Modifiers
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;: The essence of all interactions in the game — &lt;strong&gt;modification of the target&amp;rsquo;s attribute values&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Core mechanism&lt;/strong&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As long as the player&amp;rsquo;s action lands squarely on the target, the Gameplay Effect is responsible for determining how the target&amp;rsquo;s attributes change.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Example flow&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;
&lt;div class="highlight-body"&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;玩家发动攻击（GA）→ 命中判定成功 → 应用 Gameplay Effect → 修改 NPC 的生命值属性&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;The diverse capabilities of GE&lt;/strong&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Effect Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Application Scenario&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Instant modification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Immediately changes attribute values&lt;/td&gt;
&lt;td&gt;Instant damage, instant healing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Damage over Time (DoT)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Continuously deducts health over a period&lt;/td&gt;
&lt;td&gt;Poison, burning effects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Healing over Time (HoT)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Continuously restores health over a period&lt;/td&gt;
&lt;td&gt;Healing spells, health regeneration auras&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Buff/Debuff stacking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stackable status effects&lt;/td&gt;
&lt;td&gt;Attack power increase, defense reduction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Invincibility frames&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Brief invincible state&lt;/td&gt;
&lt;td&gt;Invincibility time after dodging&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Developer friendliness&lt;/strong&gt;: All GEs can be configured &lt;strong&gt;purely visually in Blueprint&lt;/strong&gt;, with no code required—just adjust parameters.&lt;/p&gt;
&lt;h3 id="gameplay-cues-gc--the-audiovisual-feedback-layer"&gt;&lt;a href="#gameplay-cues-gc--the-audiovisual-feedback-layer" class="header-anchor"&gt;&lt;/a&gt;Gameplay Cues (GC) — The Audiovisual Feedback Layer
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;: An independent system dedicated to managing &amp;ldquo;decorative effects&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original design intent&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Separate core logic from presentation&lt;/strong&gt;: The server only needs to handle game logic and does not need to play effects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optimize network bandwidth&lt;/strong&gt;: GCs can be triggered locally on the client, reducing unnecessary network synchronization&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Coverage&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visual effects (VFX): particle effects, screen shake, material changes&lt;/li&gt;
&lt;li&gt;Audio feedback (SFX): ability sound effects, hit sound effects, ambient sound effects&lt;/li&gt;
&lt;li&gt;UI feedback: floating damage numbers, health bar change animations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Timing&lt;/strong&gt;: Usually triggered after a GE modifies attributes, providing immediate feedback to the player.&lt;/p&gt;
&lt;h2 id="the-complete-chain-of-the-gas-core-gameplay-loop"&gt;&lt;a href="#the-complete-chain-of-the-gas-core-gameplay-loop" class="header-anchor"&gt;&lt;/a&gt;The Complete Chain of the GAS Core Gameplay Loop
&lt;/h2&gt;&lt;p&gt;To intuitively show how the components work together, here is the complete combat loop flow:&lt;/p&gt;
&lt;pre class="mermaid"&gt;
graph TD
subgraph &amp;#34;输入阶段&amp;#34;
A[玩家输入] --&amp;gt; B[Gameplay Ability&amp;lt;br/&amp;gt;GA: 攻击技能]
end
subgraph &amp;#34;执行阶段&amp;#34;
B --&amp;gt; C{Gameplay Tags&amp;lt;br/&amp;gt;检查激活条件}
C --&amp;gt;|条件满足| D[Ability Tasks&amp;lt;br/&amp;gt;执行攻击动画/检测]
D --&amp;gt; E[命中检测&amp;lt;br/&amp;gt;触发 Gameplay Event]
end
subgraph &amp;#34;效果阶段&amp;#34;
E --&amp;gt; F[Gameplay Effect&amp;lt;br/&amp;gt;GE: 伤害计算]
F --&amp;gt; G[Attribute Set&amp;lt;br/&amp;gt;修改 Health/Damage]
end
subgraph &amp;#34;反馈阶段&amp;#34;
G --&amp;gt; H[Gameplay Cue&amp;lt;br/&amp;gt;GC: 播放受击特效/音效]
H --&amp;gt; I[UI 更新&amp;lt;br/&amp;gt;血条变化/伤害数字]
end
subgraph &amp;#34;循环闭环&amp;#34;
G --&amp;gt; J[经验值增加]
J --&amp;gt; K[升级判定]
K --&amp;gt;|升级| L[解锁新 GA&amp;lt;br/&amp;gt;属性成长]
L --&amp;gt; A
end
&lt;/pre&gt;
&lt;h2 id="course-learning-path-planning"&gt;&lt;a href="#course-learning-path-planning" class="header-anchor"&gt;&lt;/a&gt;Course Learning Path Planning
&lt;/h2&gt;&lt;p&gt;This course series will gradually go deeper according to the following milestones:&lt;/p&gt;
&lt;h3 id="milestone-1-gas-basic-environment-setup"&gt;&lt;a href="#milestone-1-gas-basic-environment-setup" class="header-anchor"&gt;&lt;/a&gt;Milestone 1: GAS Basic Environment Setup
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Content&lt;/strong&gt;: Configure the ASC, understand Gameplay Tags, and create the first GA&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Goal&lt;/strong&gt;: Set up the GAS development environment and master the basic concepts&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="milestone-2-core-combat-system"&gt;&lt;a href="#milestone-2-core-combat-system" class="header-anchor"&gt;&lt;/a&gt;Milestone 2: Core Combat System
&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Attack ability implementation&lt;/strong&gt;: Triggered by input, with precise frame detection via animation notifications (Anim Notify)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Attribute system setup&lt;/strong&gt;: Create an AttributeSet and define core attributes such as Health&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Damage mechanism&lt;/strong&gt;: Use GE to implement standardized health deduction&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Temporary attribute application&lt;/strong&gt;: Introduce the Damage attribute to handle complex attack scenarios (critical hits, elemental damage, etc.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Visual feedback&lt;/strong&gt;: Configure Gameplay Cues to achieve hit feel&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Goal achieved&lt;/strong&gt;: Complete the full combat loop between the player and NPCs.&lt;/p&gt;
&lt;h3 id="milestone-3-progression-system-and-advanced-mechanics"&gt;&lt;a href="#milestone-3-progression-system-and-advanced-mechanics" class="header-anchor"&gt;&lt;/a&gt;Milestone 3: Progression System and Advanced Mechanics
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Experience system&lt;/strong&gt;: Defeat NPCs to gain experience&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Level-up mechanism&lt;/strong&gt;: Accumulated experience triggers level-ups and attribute growth&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Persistent effects&lt;/strong&gt;: Use GE&amp;rsquo;s Duration mechanism to implement DoT, temporary Buffs, invincibility frames, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Goal achieved&lt;/strong&gt;: Complete the core gameplay loop of &amp;ldquo;combat → growth → stronger combat.&amp;rdquo;&lt;/p&gt;
&lt;h2 id="7-supporting-project-description"&gt;&lt;a href="#7-supporting-project-description" class="header-anchor"&gt;&lt;/a&gt;7. Supporting Project Description
&lt;/h2&gt;&lt;h3 id="project-structure"&gt;&lt;a href="#project-structure" class="header-anchor"&gt;&lt;/a&gt;Project Structure
&lt;/h3&gt;&lt;p&gt;The sample project is divided into two main asset folders:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Folder&lt;/th&gt;
&lt;th&gt;Content Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Arena Battle/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;General assets (based on the Infinity Blade asset pack)&lt;br&gt;Includes scenes, animations, materials, and basic VFX&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Arena Battle GAS/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;GAS-specific assets&lt;br&gt;Continuously updated as the course progresses, including configurations such as GA, GE, and AttributeSet&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="c-vs-blueprint-best-practices"&gt;&lt;a href="#c-vs-blueprint-best-practices" class="header-anchor"&gt;&lt;/a&gt;C++ vs Blueprint: Best Practices
&lt;/h2&gt;&lt;h3 id="technology-stack-selection-recommendations"&gt;&lt;a href="#technology-stack-selection-recommendations" class="header-anchor"&gt;&lt;/a&gt;Technology Stack Selection Recommendations
&lt;/h3&gt;&lt;p&gt;Although most GAS functionality can be implemented through Blueprint, &lt;strong&gt;squeezing out its full potential&lt;/strong&gt; requires combining it with C++.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Recommended development model&lt;/strong&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technical Approach&lt;/th&gt;
&lt;th&gt;Responsibilities&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Core logic layer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;C++&lt;/td&gt;
&lt;td&gt;ASC initialization, AttributeSet definition, complex GE calculations, network synchronization logic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Presentation configuration layer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Blueprint&lt;/td&gt;
&lt;td&gt;Specific GA flows, Gameplay Tags configuration, GE parameter tuning, visual effect binding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Core idea&lt;/strong&gt;: C++ builds a stable framework, while Blueprint handles content design that requires frequent iteration.&lt;/p&gt;
&lt;h2 id="summary-and-outlook"&gt;&lt;a href="#summary-and-outlook" class="header-anchor"&gt;&lt;/a&gt;Summary and Outlook
&lt;/h2&gt;&lt;h3 id="review-of-key-points"&gt;&lt;a href="#review-of-key-points" class="header-anchor"&gt;&lt;/a&gt;Review of Key Points
&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Nature of GAS&lt;/strong&gt;: A modular character interaction framework based on the concept of Abilities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Three pillars&lt;/strong&gt;: Abilities (what to do), Attributes (state data), Effects (how to change)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Six core components&lt;/strong&gt;: ASC (heart), Tags (state language), GA (gameplay layer), AttributeSets (data layer), GE (modifiers), GC (feedback layer)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Core advantages&lt;/strong&gt;: Officially maintained, network-ready, highly extensible, suitable for full-scale development from prototypes to AAA&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="learning-value"&gt;&lt;a href="#learning-value" class="header-anchor"&gt;&lt;/a&gt;Learning Value
&lt;/h3&gt;&lt;p&gt;Even if you do not use GAS directly in the final project, deeply understanding its &lt;strong&gt;underlying architecture design&lt;/strong&gt; can help you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Build more robust custom game systems&lt;/li&gt;
&lt;li&gt;Master modular, decoupled design philosophy&lt;/li&gt;
&lt;li&gt;Improve your architecture skills for complex systems&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="references"&gt;&lt;a href="#references" class="header-anchor"&gt;&lt;/a&gt;References
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://dev.epicgames.com/community/learning/courses/QQv/unreal-engine-building-an-rpg-with-gameplay-ability-system/zBvq/unreal-engine-introduction-to-building-an-rpg-with-gameplay-ability-system" target="_blank" rel="noopener"&gt;Introduction to Building an RPG with Gameplay Ability System - Building an RPG with Gameplay Ability System&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>