Skip to content

Commit 827ba92

Browse files
authored
fix: 修复因 ocr 匹配文字错误导致的无法开始游戏问题 (#261)
* fix: 修复因 ocr 匹配文字错误导致的无法开始游戏问题 * fix: 移除无用的模板匹配并改为ocr识别 * fix: 修复无法从大世界进入游戏界面的问题
1 parent b1e23e8 commit 827ba92

4 files changed

Lines changed: 53 additions & 53 deletions

File tree

-1.59 KB
Binary file not shown.
-5.23 KB
Binary file not shown.

assets/resource/base/pipeline/Tetris/Tetris.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"[JumpBack]TetrisHandleLoading",
1414
"[JumpBack]TetrisDismissResult",
1515
"[JumpBack]TetrisCheckVitality",
16-
"[JumpBack]TetrisHandleGameActive",
17-
"[JumpBack]TetrisHandleGameIdle",
18-
"[JumpBack]TetrisHandleMatching",
19-
"[JumpBack]TetrisHandlePrepareTwo",
20-
"[JumpBack]TetrisHandlePrepareTwoReturn",
21-
"[JumpBack]TetrisHandlePrepareOne",
2216
"[JumpBack]TetrisHandleWorldWithPrompt",
2317
"[JumpBack]TetrisHandleExit",
2418
"[JumpBack]TetrisHandleWorldNoPrompt",
19+
"[JumpBack]TetrisHandlePrepareOne",
20+
"[JumpBack]TetrisHandlePrepareTwo",
21+
"[JumpBack]TetrisHandlePrepareTwoReturn",
22+
"[JumpBack]TetrisHandleMatching",
23+
"[JumpBack]TetrisHandleGameActive",
24+
"[JumpBack]TetrisHandleGameIdle",
2525
"TetrisExitWithError"
2626
]
2727
},
@@ -64,7 +64,7 @@
6464
"desc": "泯除方块 - 检测到游戏空闲(等待方块出现)",
6565
"recognition": "And",
6666
"all_of": [
67-
"TetrisSceneGameIdle"
67+
"TetrisGamingNext"
6868
],
6969
"pre_delay": 500,
7070
"next": [

assets/resource/base/pipeline/Tetris/TetrisScene.json

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@
8282
"테트로미노"
8383
]
8484
}
85-
},
86-
"pre_delay": 0,
87-
"post_delay": 0
85+
}
8886
},
8987
"TetrisSceneWorldWithPrompt": {
9088
"desc": "泯除方块 - 大世界场景且有方块入口提示",
@@ -101,26 +99,6 @@
10199
"post_delay": 0,
102100
"next": []
103101
},
104-
"TetrisScenePrepareOneMarker": {
105-
"desc": "泯除方块 - 检测准备界面一标记",
106-
"recognition": {
107-
"type": "TemplateMatch",
108-
"param": {
109-
"roi": [
110-
779,
111-
151,
112-
245,
113-
366
114-
],
115-
"template": [
116-
"Tetris/prepare_one_marker.png"
117-
]
118-
}
119-
},
120-
"pre_delay": 0,
121-
"post_delay": 0,
122-
"next": []
123-
},
124102
"TetrisScenePrepareOneSingle": {
125103
"desc": "泯除方块 - 检测单人模式入口",
126104
"recognition": {
@@ -175,7 +153,6 @@
175153
"type": "Or",
176154
"param": {
177155
"any_of": [
178-
"TetrisScenePrepareOneMarker",
179156
"TetrisScenePrepareOneSingle",
180157
"TetrisScenePrepareOneMulti"
181158
]
@@ -206,7 +183,7 @@
206183
"next": []
207184
},
208185
"TetrisSceneStartMatch": {
209-
"desc": "泯除方块 - 检测开始匹配按钮",
186+
"desc": "泯除方块 - 检测开始游戏按钮",
210187
"recognition": {
211188
"type": "OCR",
212189
"param": {
@@ -217,11 +194,11 @@
217194
36
218195
],
219196
"expected": [
220-
"开始匹配",
221-
"開始匹配",
222-
"(?i)Start\\s*Matchmaking",
223-
"マッチング開始",
224-
"매칭 시작"
197+
"开始游戏",
198+
"開始遊戲",
199+
"(?i)Start\\s*Game",
200+
"ゲーム開始",
201+
"게임 시작"
225202
]
226203
}
227204
},
@@ -286,24 +263,45 @@
286263
"pre_delay": 0,
287264
"post_delay": 0
288265
},
289-
"TetrisSceneDrop": {
290-
"desc": "泯除方块 - 检测下落按钮(游戏中标志)",
266+
"TetrisGamingNext": {
267+
"desc": "泯除方块 - 识别游戏中Next队列文字",
291268
"recognition": {
292-
"type": "TemplateMatch",
269+
"type": "OCR",
293270
"param": {
294271
"roi": [
295-
270,
296-
425,
297-
92,
298-
97
272+
792,
273+
52,
274+
45,
275+
25
299276
],
300-
"template": [
301-
"Tetris/drop.png"
277+
"expected": [
278+
"Next",
279+
"次の",
280+
"다음"
302281
]
303282
}
304-
},
305-
"pre_delay": 0,
306-
"post_delay": 0
283+
}
284+
},
285+
"TetrisGamingExisting": {
286+
"desc": "泯除方块 - 识别游戏中当前存活文字",
287+
"recognition": {
288+
"type": "OCR",
289+
"param": {
290+
"roi": [
291+
783,
292+
489,
293+
65,
294+
23
295+
],
296+
"expected": [
297+
"当前存活",
298+
"當前存活",
299+
"(?i)Existing",
300+
"現在の生存",
301+
"현재 생존"
302+
]
303+
}
304+
}
307305
},
308306
"TetrisSceneMatchend": {
309307
"desc": "泯除方块 - 检测对局结束界面",
@@ -326,12 +324,14 @@
326324
"post_delay": 0
327325
},
328326
"TetrisSceneGameActive": {
329-
"desc": "泯除方块 - 检测游戏中(下落按钮可见",
327+
"desc": "泯除方块 - 检测游戏中(下落按钮或游戏标记可见",
330328
"recognition": {
331-
"type": "And",
329+
"type": "Or",
332330
"param": {
333-
"all_of": [
334-
"TetrisSceneDrop"
331+
"any_of": [
332+
"TetrisSceneGameIdle",
333+
"TetrisGamingNext",
334+
"TetrisGamingExisting"
335335
]
336336
}
337337
},

0 commit comments

Comments
 (0)