Refactor: NPC perception rules out of AiHandler, split NpcAiService / NpcHelperService
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with the design skill and the review findings A3 and A4 from split/09-perceptions; then trace perception handling across AiHandler, NpcAiService, and NpcHelperService. Map the proposed service responsibilities and Reflex registration before implementation. Done means the responsibilities are moved as described with no behavior change; the performance notes are optional.
由索引模型根据 Issue 内容生成。
描述
Follow-up from the review of split/09-perceptions (architecture-reviewer findings A3 + A4).
Problem
AiHandler(adapter, ~720 lines) decides AI rules: loop rate, daily-state check,CallStateEnd, looking away
(ForgetHeroAfterLookingAwaychangesAttitudeTemp),PERC_MOVENPC,PERC_ASSESSBODY. None of it is testable
without a scene, and following one perception means reading AiHandler, NpcAiService and NpcHelperService.NpcAiService(~1,100 lines) andNpcHelperService(~620 lines) each took on a new responsibility: passive
perception broadcast/delivery, the body search, sight lines through alpha-tested polygons,Wld_DetectItem.
Proposal
NpcPerceptionService(new): passive perception broadcast + delivery,ExecutePassivePerception,
FindClosestSensedBody, and the body ofExecuteActivePerceptions(incl.PERC_MOVENPC,PERC_ASSESSBODY,
looking away).NpcSightDomain(new, owned byNpcHelperService):CanSee/CanSense,IsSightBlocked, see-through caches.NpcAiServicekeeps the state lifecycle and also getsCallStateEnd, the loop-rate and daily-state checks.AiHandlerkeeps only the Unity part:_npcPerceptionService.TickPerceptions(NpcData)and the state calls.Wld_DetectItemand the item distances could move to aWld_*/item service.
Plan with the design skill first (new service + Reflex registration), then implement. No behaviour change.
Related performance notes from the same review (can be done during the move):
FindClosestSensedBodywalks the whole NpcCache with a raycast per candidate on every perception tick.Wld_DetectItemwalks the whole VobCache per call.
- 主要语言
- C#
- 星标
- 33
- 派生
- 1
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 56
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Gothic-Unity-Project/Gothic-Unity 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 69/100
Gothic-Unity-Project/Gothic-Unity#487 ·
维护者通常 2 天内回复
-
Shadows未关闭feature
难度 5/5 一周以上 新手友好度 30/100
Gothic-Unity-Project/Gothic-Unity#497 ·
维护者通常 2 天内回复
-
improvement
难度 4/5 3-5 天 新手友好度 42/100
Gothic-Unity-Project/Gothic-Unity#496 ·
维护者通常 2 天内回复
-
feature
难度 5/5 一周以上 新手友好度 25/100
Gothic-Unity-Project/Gothic-Unity#495 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 57/100
Gothic-Unity-Project/Gothic-Unity#494 ·
维护者通常 2 天内回复
查看 Gothic-Unity-Project/Gothic-Unity 的全部 Issue
相似的 Issue
-
t/bug
难度 2/5 1-3 小时 新手友好度 75/100
dotnet/maui#39950 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
CommunityToolkit/Datasync#600 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
NimblePros/deviq-hugo#121 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
philterd/phileas-dotnet#188 ·
-
enhancement ready-for-human
难度 2/5 1-3 小时 新手友好度 62/100
fboucher/2d6-dungeon-app#288 · 1 条评论 ·
维护者通常 1 天内回复