惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
IT之家
IT之家
V
Visual Studio Blog
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
A
About on SuperTechFans
博客园 - 聂微东
Blog — PlanetScale
Blog — PlanetScale
N
News and Events Feed by Topic
A
Arctic Wolf
WordPress大学
WordPress大学
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Fortinet All Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Y
Y Combinator Blog
T
Threat Research - Cisco Blogs
Latest news
Latest news
Simon Willison's Weblog
Simon Willison's Weblog
Cyberwarzone
Cyberwarzone
S
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
Lohrmann on Cybersecurity
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy International News Feed
J
Java Code Geeks
Spread Privacy
Spread Privacy
宝玉的分享
宝玉的分享
I
Intezer
L
LangChain Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
G
GRAHAM CLULEY
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News and Events Feed by Topic
AWS News Blog
AWS News Blog
Attack and Defense Labs
Attack and Defense Labs
Security Archives - TechRepublic
Security Archives - TechRepublic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - sun_dust_shadow

(翻译) 延迟补偿方法的协议设计与优化 Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization (翻译) Dota2 Random Distribution Dota2中的随机分布 (读书笔记)平衡掌控者 [瞄准辅助] 实现一种柔和平滑的瞄准辅助 (个人思考)实现游戏GAS系统中的Tag (翻译) Efficiency Tips on Switching Spaces and Transformation Matrices in Unity (翻译) V Rising's Animation Layering in Unity (翻译 unity2020.1) Understanding the managed heap (UnityEditor Tool) 语音控制unity editor暂停和播放 (翻译 ue gas) Gameplay Ability 总结 Overwatch Gameplay Architecture and Netcode 守望先锋的游戏架构与网络代码 (翻译 ) Source Multiplayer Networking Source引擎的多人网路系统 (翻译 gafferongames) Networked Physics in Virtual Reality VR中的网络物理 Topdown游戏中Input朝向的转化 (翻译 gafferongames) Client Server Connection 客户端服务器连接 (翻译 gafferongames)Reliable Ordered Messages 可靠有序消息 (翻译 gafferongames) Sending Large Blocks of Data 发送大块数据 (翻译 gafferongames) Packet Fragmentation and Reassembly 数据包分片与重组 游戏中Shotgun(喷子)发射子弹的实现
(个人思考)游戏技能的实现
sun_dust_shadow · 2025-10-19 · via 博客园 - sun_dust_shadow

游戏技能实现的三种方式:

1.类似UE中GAS的方式,统一为Ability,并且不处理任何数据逻辑。

https://github.com/No78Vino/gameplay-ability-system-for-unity

2.类似双影其境那种, 简单直观,每个Ability都是独立处理响应、行为。

3.一个SkillController方式。 SkillController驱动所有Skill的更新,Skill+Buff系统去处理战斗内每个Entity的行为。

其实类似第1中方式。不过没有这么明确的限定“属性”一定要在GAS中的GameEffect中进行处理

主要目标:本文讨论第3种的实现方式的实现思路。本文并没有讨论“属性”的实现,没有讨论editor实现。

第一步:有哪些内容需要实现?

1.触发器

一个triggerCondition可以触发 triggerActionList

一个Skill可以有多个triggerConditionList

2.每个skill的状态和具体逻辑,和触发后的逻辑;

skill的Active状态,skill在Active状态下内部逻辑

3.每个skill之间的关系。

比如当active skillA的时候 会禁用skillB。

比如有active skillA的时候,不能active skillB

4.多个skill绑定ownerEntity

第二步:怎么实现

so : ScriptableObject的缩写

我们定义了一个SkillContainer的So,里面包含了所有信息。

 public class SkillContainer
    {
        Trigger trigger;
        ISkill skill;
        TagAggregator TagAggregator;
    }

1. 一个triggerCondition只是condition,并不关心触发后的triggerActionList是什么。我们使用组合的方式

1.1 triggerCondition是一个so

1.2 triggerActionList的element是so (eventData)。

像一些CommonAction由指定CommonActionSystem去监听执行,比如常见的消耗、发射单发子弹行为。

像一些特殊的Action由当前skill.cs去执行。比如 每隔1s生成一颗环绕的旋转球

    class Trigger
    {
        TriggerCondition condition;
        TriggerActionList actionList;
    }

在实现skill流程后,通过配置去映射流程的实现, 并且,配置去“配”一些通用的功能。 

2.skill的话需要定义

2.1

interface ISkill
{
bool Active { get; set; }
bool TryActivate();
void Deactivate();
void Tick();
}

2.2 trigger的action直接监听1.2中的 triggerActionEventData

2.3  针对快节奏的项目,而非大世界的项目。我觉得直接把所有skill看作permanentSkill就行了,如果不需要了,直接Deactive。

如果是战斗内new的skill,也没有问题。

最多在Deactive的时候,把可能的“大数据”给clear或者returnPool。

这样比较简单直接

3.skill之间的关系

当整体skill流程完成后,通过skill内的tag数据去做“流程内”的细节处理。

比如在TryActive的函数内,需要检测这个skill和owner active skillList之间的关系。

4.我们使用entity+component的方式,而不是面向对象的方式实现。那么我们定义system和component:

class SkillListComponent: Component
{
  List
<SkillContainer>
}

同时, SkillSystem去Update这个SkillListComponent

    class SkillControllerSystem
    {

        Tick()
        {
            foreach (var entity in queryEntity)
            {
                var skillContainerList= entity.getComponent<SkillListComponent>().SkillList;
                foreach (var skillContainer in skillContainerList)
                {
                    if (skillContainer.skill.Active)
                    {
                        if (CheckTriggerCondition)
                        {
                            TriggerAction()
                        }
                        skillContainer.skill.Tick()
                    }
                }
            }
          
        }
    }