Files
Fishdice/analysis/FishDice/weaknesses.html
2026-06-25 10:46:23 +08:00

59 lines
4.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FishDice 缺点与风险</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="shell">
<div class="topbar"><a href="index.html">← 返回总览</a><span class="brand">缺点与风险</span></div>
<section class="hero">
<h1>当前框架的缺点、风险和补强方向</h1>
<p class="subtitle">FishDice 的核心设计很干净但它的能力边界也很明显目前完成的是玩法决策闭环不是资源、UI、场景、服务和目标玩法全链路框架。</p>
</section>
<section>
<h2>主要缺点</h2>
<table>
<tr><th>问题</th><th>风险</th><th>建议</th></tr>
<tr><td>配置仍内建在代码中</td><td>策划无法独立调规则、权重、候选、模式映射;发版成本高。</td><td>把 definition 层迁移到 JSON/ScriptableObject/远端表,但保留现有 validator。</td></tr>
<tr><td>没有生产级资源映射</td><td>result key 到图标、动画、prefab、音效的关系尚未定义。</td><td>增加 Unity Integration 层,保持 Runtime 只认 key。</td></tr>
<tr><td>UI 只是 Demo</td><td>没有 panel 生命周期、导航、层级、动画完成回调、数据绑定约定。</td><td>建立 LuckyDicePresentation 或 Presenter/ViewModel再接项目 UI 框架。</td></tr>
<tr><td>TargetMode 只解析,不启动</td><td>核心能产出 <code>slap_down_normal</code>,但没有真实玩法启动器。</td><td><code>TargetModeLauncher</code> 接口和 Unity 层实现。</td></tr>
<tr><td>Lucky Dice 筛选策略写死在 service 中</td><td>后续 cooldown、tutorial、活动来源、权重策略复杂后service 会膨胀。</td><td>把 filter 抽成可注册 pipeline并让 Trace 记录每个 filter 的前后数量。</td></tr>
<tr><td>Trace 目前是内存结果,不是日志系统</td><td>线上复盘还缺持久化、埋点、采样和导出协议。</td><td>新增 Trace sink 或 adapter把核心 trace 转接到日志/埋点系统。</td></tr>
<tr><td>异常和失败策略还偏工程化</td><td>部分错误通过 exception 抛出,生产玩法可能需要降级而不是中断。</td><td>区分配置启动期错误、请求错误、运行期可恢复错误。</td></tr>
</table>
</section>
<section>
<h2>最需要优先补的三件事</h2>
<div class="grid-3">
<div class="card"><h3>1. 配置外置</h3><p>先让规则、候选、target mode 从外部数据创建,并保留现有校验链。</p></div>
<div class="card"><h3>2. 目标玩法启动协议</h3><p>定义 <code>TargetModeEntry</code> 到真实玩法模块的启动、完成、失败回调。</p></div>
<div class="card"><h3>3. 表现层资源映射</h3><p>补齐 <code>ResultKey</code> 对应 icon/slot/prefab/动画资源的统一表。</p></div>
</div>
</section>
<section>
<h2>需要避免的后续走偏</h2>
<div class="note danger">不要为了快速接 UI把 Sprite、Prefab、Canvas、Coroutine 或场景跳转塞回 Runtime。那会破坏当前最有价值的纯核心边界。</div>
<div class="note danger">不要把新组合直接写成 <code>if normalizedKey == ...</code> 的业务方法。组合增长应优先走规则配置和 matcher/action 扩展。</div>
</section>
<section class="evidence">
<h2>证据</h2>
<ul>
<li><span class="path">LuckyDiceDefaultConfig.cs:151-238</span>:默认配置仍在代码内。</li>
<li><span class="path">LuckyDiceFlowService.cs:21-25</span>:候选筛选条件直接写在 service 内。</li>
<li><span class="path">TargetModeResolver.cs:9-33</span>:只解析 target mode不负责启动真实玩法。</li>
<li><span class="path">LuckyDiceDemoController.cs:131-244</span>UI 是 Demo 代码构建,不是可复用 UI 管理器。</li>
<li><span class="path">rg Addressables/AssetBundle/LoadAsset</span>:当前没有资源加载/映射框架证据。</li>
</ul>
</section>
</main>
</body>
</html>