feat: 收敛玩法运行时配置并加入故障恢复

This commit is contained in:
2026-04-01 13:04:26 +08:00
parent 1635a11780
commit 3ef841ecc7
73 changed files with 8820 additions and 2122 deletions

View File

@@ -27,6 +27,24 @@
"title": "完整配置示例",
"locale": "zh-CN"
},
"settings": {
"autoRotateEnabled": {
"value": true,
"isLocked": false
},
"trackDisplayMode": {
"value": "tail",
"isLocked": false
},
"gpsMarkerStyle": {
"value": "beacon",
"isLocked": true
},
"showCenterScaleRuler": {
"value": false,
"isLocked": false
}
},
"map": {
"tiles": "../map/lxcb-001/tiles/",
"mapmeta": "../map/lxcb-001/tiles/meta.json",
@@ -42,6 +60,13 @@
"url": "../kml/lxcb-001/10/c01.kml"
},
"CPRadius": 6,
"controlDefaults": {
"score": 10,
"template": "story",
"autoPopup": false,
"pointStyle": "classic-ring",
"pointColorHex": "#cc006b"
},
"metadata": {
"title": "完整路线示例",
"code": "full-001"
@@ -108,7 +133,7 @@
"body": "恭喜完成本次路线。",
"clickTitle": "终点说明",
"clickBody": "点击终点可再次查看结束说明。",
"autoPopup": true,
"autoPopup": false,
"once": true,
"priority": 2,
"clickExperience": {
@@ -118,16 +143,22 @@
"presentation": "dialog"
}
}
},
"legDefaults": {
"style": "classic-leg",
"colorHex": "#cc006b",
"widthScale": 1
}
},
"game": {
"mode": "classic-sequential",
"rulesVersion": "1",
"session": {
"startManually": true,
"startManually": false,
"requiresStartPunch": true,
"requiresFinishPunch": true,
"autoFinishOnLastControl": false,
"minCompletedControlsBeforeFinish": 1,
"maxDurationSec": 5400
},
"punch": {
@@ -138,14 +169,10 @@
"sequence": {
"skip": {
"enabled": true,
"radiusMeters": 30,
"requiresConfirm": true
"radiusMeters": 10,
"requiresConfirm": false
}
},
"scoring": {
"type": "score",
"defaultControlScore": 10
},
"guidance": {
"showLegs": true,
"legAnimation": true,
@@ -164,6 +191,25 @@
"userWeightKg": 65
}
},
"audio": {
"distantDistanceMeters": 80,
"approachDistanceMeters": 20,
"readyDistanceMeters": 5,
"cues": {
"guidance:distant": {
"loopGapMs": 4800,
"volume": 0.34
},
"guidance:approaching": {
"loopGapMs": 950,
"volume": 0.58
},
"guidance:ready": {
"loopGapMs": 650,
"volume": 0.68
}
}
},
"feedback": {
"audioProfile": "default",
"hapticsProfile": "default",
@@ -327,7 +373,23 @@
---
## 6. `playfield.controlOverrides` 字段说明
## 6. `playfield.controlDefaults` / `playfield.controlOverrides` 字段说明
推荐优先级:
`系统默认值 -> 玩法默认值 -> playfield.controlDefaults -> playfield.controlOverrides`
### `playfield.controlDefaults`
- 类型:`object`
- 说明:普通检查点的活动级默认配置
- 作用:减少重复书写,未单独覆盖的普通检查点默认继承这里
### `playfield.controlOverrides`
- 类型:`object`
- 说明:起点、普通点、终点的单点覆盖
- 作用:只写与活动默认不同的点
### key 命名规则
@@ -365,20 +427,22 @@
- 类型:`string`
- 说明:点击点位时弹出的标题
- 默认逻辑:未配置时回退到 `title`
- 默认逻辑:最小模板下默认不启用;仅在显式配置点击内容能力时生效
#### `clickBody`
- 类型:`string`
- 说明:点击点位时弹出的正文
- 默认逻辑:未配置时回退到 `body`
- 默认逻辑:最小模板下默认不启用;仅在显式配置点击内容能力时生效
#### `autoPopup`
- 类型:`boolean`
- 说明:打点完成后是否自动弹出
- 默认逻辑:`true`
- 默认逻辑:最小模板下默认 `false`
- 特殊逻辑:`game.punch.policy = "enter"` 时不自动弹原生内容
- 补充说明:白色内容卡已改为显式配置启用;普通点只有显式设置 `autoPopup = true` 才会在打点后先弹白卡
- 补充说明:终点完成后默认直接进入结果页,不走白色内容卡链路
#### `once`
@@ -454,6 +518,7 @@
- 类型:`boolean`
- 说明:是否手动开始
- 顺序赛建议默认值:`false`
### `game.session.requiresStartPunch`
@@ -470,6 +535,14 @@
- 类型:`boolean`
- 说明:最后一个目标完成后是否自动结束
### `game.session.minCompletedControlsBeforeFinish`
- 类型:`number`
- 说明:终点生效前至少需要完成的普通检查点数量
- 建议默认值:
- 顺序赛:`0`
- 积分赛:`1`
### `game.session.maxDurationSec`
- 类型:`number`
@@ -492,6 +565,9 @@
- 类型:`boolean`
- 说明:是否需要先聚焦/选中目标再打点
- 建议默认值:
- 顺序赛:`false`
- 积分赛:`false`
### `game.sequence.skip.enabled`
@@ -502,22 +578,13 @@
- 类型:`number`
- 说明:跳点可用半径
- 顺序赛建议默认值:打点半径的 `2`
### `game.sequence.skip.requiresConfirm`
- 类型:`boolean`
- 说明:跳点是否需要二次确认
### `game.scoring.type`
- 类型:`string`
- 说明:积分模式类型
- 当前常用值:`score`
### `game.scoring.defaultControlScore`
- 类型:`number`
- 说明:默认控制点分值
- 顺序赛建议默认值:`false`
### `game.guidance.showLegs`
@@ -574,6 +641,41 @@
- 类型:`string`
- 说明UI 动效 profile
### `game.audio`
- 类型:`object`
- 说明:高级音频运行时配置,用于控制三档距离提示音的距离阈值和 cue 参数
### `game.audio.distantDistanceMeters`
- 类型:`number`
- 说明:远距离提示音阈值
- 建议默认值:`80`
### `game.audio.approachDistanceMeters`
- 类型:`number`
- 说明:接近提示音阈值
- 建议默认值:`20`
### `game.audio.readyDistanceMeters`
- 类型:`number`
- 说明:可打点提示音阈值
- 建议默认值:`5`
- 备注:
- 运行时不会低于 `game.punch.radiusMeters`
### `game.audio.cues["guidance:distant" | "guidance:approaching" | "guidance:ready"]`
- 类型:`object`
- 说明:三档距离提示音的 cue 级配置
- 当前支持字段:
- `src`
- `volume`
- `loop`
- `loopGapMs`
---
## 8. `resources` 字段说明
@@ -625,6 +727,12 @@
},
"game": {
"mode": "score-o",
"session": {
"startManually": false
},
"punch": {
"requiresFocusSelection": true
},
"guidance": {
"showLegs": false,
"legAnimation": false,
@@ -637,7 +745,7 @@
}
```
并在 `playfield.controlOverrides` 中为普通点补:
并在 `playfield.controlDefaults` 中先写普通点统一默认,必要时再在 `playfield.controlOverrides` 中为少量特殊点补:
- `score`
@@ -648,4 +756,3 @@
- [D:\dev\cmr-mini\doc\config-template-minimal-game.md](D:/dev/cmr-mini/doc/config/最小游戏配置模板.md)
- [D:\dev\cmr-mini\doc\config-option-dictionary.md](D:/dev/cmr-mini/doc/config/配置选项字典.md)
- [D:\dev\cmr-mini\doc\config-docs-index.md](D:/dev/cmr-mini/doc/config/配置文档索引.md)