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 天內回覆
-
bug
難度 3/5 1-2 天 新手友好度 57/100
Gothic-Unity-Project/Gothic-Unity#494 ·
維護者通常 2 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 49/100
Gothic-Unity-Project/Gothic-Unity#489 ·
維護者通常 2 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 42/100
Gothic-Unity-Project/Gothic-Unity#488 ·
維護者通常 2 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 55/100
Gothic-Unity-Project/Gothic-Unity#486 ·
維護者通常 2 天內回覆
查看 Gothic-Unity-Project/Gothic-Unity 的全部 Issue
相似的 Issue
-
bug github_actions
難度 2/5 1-3 小時 新手友好度 78/100
endercodezz/BYDLO#336 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 85/100
sebastienros/jint#4449 ·
維護者通常 1 天內回覆
-
clawsweeper:bulk-filed clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security issue-rating: 🦞 diamond lobster P2
難度 2/5 1-3 小時 新手友好度 82/100
openclaw/openclaw-windows-node#2010 · 2 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
imazen/imageflow-dotnet#72 · 1 則留言 ·