Commit Graph

2282 Commits

Author SHA1 Message Date
github-actions[bot]
b42e2d244c chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25942030629
[skip changelog]
2026-05-15 21:23:51 +00:00
uye
155f049cf6 feat: 初步支持 生息演算:重启锚点 新手刷代币与科技点策略 2026-05-15 19:42:05 +08:00
Aliothmoon
416ecca979 perf: 优化 masked TM_CCOEFF_NORMED 匹配性能 (#16593)
* perf: FFT/sparse fast path for masked TM_CCOEFF_NORMED

* perf: optimize masked ccoeff matching

* perf: tune masked ccoeff dispatcher and remove fixed overhead

- sync_cache_revision: atomic acquire/release double-check avoids
  taking the mutex on every preproc_and_match call. No-mask hot path
  no longer pays for the singleton at all (init hoisted into the
  FFT/sparse branch).

- should_fallback_to_opencv: pick whichever path is empirically
  faster instead of only catching dense-mask small-result cases:
  * result < 1000 && K < 2000: keep sparse (OpenCV setup dominates)
  * result < 12000 && K >= 500: fallback (covers GameStart 200x120/
    58x58 and 138x130/105x105 dead zones)
  * K*result < 25M: fallback (covers SmileyOnWork 880x80/20x21 and
    similar long-thin / small-template FFT-loses cases)

Windows MSVC x64 (min-of-2, n=803/1402):
  coverage: regressions 198 -> 50, mean 10.5ms -> 7.4ms (1.40x)
  perf:     regressions  86 ->  3, mean  854us ->  296us (2.90x)

Android arm64-v8a NEON (single run, n=803/1402):
  coverage: regressions   0, mean 125ms -> 80ms  (1.72x)
  perf:     regressions   1 (1.20x edge), mean 6.4ms -> 2.8ms (10.95x)

* perf(masked-matcher): merge 3-channel I² into a single FFT in σ_I² compute

σ_I²(x,y) = Σ_c [(M ⋆ I_c²) - (M ⋆ I_c)² / N]
          = Σ_c (M ⋆ I_c²)        - (1/N) Σ_c (M ⋆ I_c)²
            ↑ this term is linear in I_c², so by convolution linearity
              Σ_c (M ⋆ I_c²) = M ⋆ Σ_c I_c².

Precompute I_sq_sum = Σ_c I_c² in spatial domain and do a single
FFT + single IFFT instead of three. The second term Σ_c (M ⋆ I_c)²
still requires per-channel computation (squaring is non-linear).

Net: -2 FFTs and -2 IFFTs per match() call (15 → 11 transforms).

Validated min-of-3 runs on the 10 largest FFT-path cases per platform:
  windows: 8/10 cases -22%, 2 cases (66x41 templ) unchanged
  android: 8/10 cases -22%, 2 cases (66x41 templ) unchanged

The two unchanged cases have very small templates where FFT is not
the bottleneck (cvtColor / convertTo / split dominate). Correctness
preserved across 1800 iterations × 10 cases on both platforms.

* fix: 测试代码忘记删除了

* fix: make TemplResource::m_revision atomic

* chore: 调一下匹配参数

* feat: 在日志中标记匹配路径(优化实现 vs cv::matchTemplate)
2026-05-15 19:22:29 +08:00
uye
592826aef3 fix: 15 章之后的难度切换 2026-05-15 16:15:26 +08:00
github-actions[bot]
72234dcc93 chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25886570116
[skip changelog]
2026-05-14 21:26:59 +00:00
status102
3ee852928f fix: 理智药过期天数识别失败取消确认逻辑未生效
- link to #16548
2026-05-14 19:50:49 +08:00
status102
fc81cc3bbd fix: 临期理智药天数缺省值 2026-05-14 19:50:33 +08:00
github-actions[bot]
2ede1dd544 chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25827562446
[skip changelog]
2026-05-13 21:32:01 +00:00
status102
3432050ff4 fix: 刷理智-理智药过期参数迁移输出Warning中参数名错误 2026-05-13 20:53:20 +08:00
github-actions[bot]
1e0d66cf7d chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25763261294
[skip changelog]
2026-05-12 21:29:51 +00:00
status102
f148494230 perf: OCRer DEBUG下绘制匹配结果 2026-05-13 04:50:02 +08:00
Aliothmoon
c6f930a60d feat: support native android (#16179)
* feat: add android controller support

* feat: add android compile options and add core static options

* fix: add __ANDROID__ macro for Android platform

* fix: move switch break into macro conditional block

* ci: add Android CMake presets (arm64, x64)

* fix: add missing Android TouchMode handling

* fix: remove unnecessary pre-check in android

* fix: restore unnecessary modifications

* fix: unified use __ANDROID__

* refactor: use interpolate_swipe_with_pause in AndroidController

* feat: add Android crash logcat output and native backtrace

* feat: only copy once from external lib screencap

* feat: add Android JNI AttachThread/DetachThread to working_proc

* fix: break control in switch

* fix: update click interval & swipe interval

* ci: restore Android build job with MaaFramework download

* fix: remove thread attach

* ci: temporarily remove MaaAndroidNativeControlUnit.so

* feat(android-ctrl): SWIPE_WITH_PAUSE 由 InstanceOption DeploymentWithPause 控制

* feat: SWIPE_WITH_PAUSE 默认启用

* feat: add android compile options and add core static options

* feat: use maafw controll unit

* fix: minor adjustments

* refactor: adapt maafw android lib

* fix: remove screencap when connect

* chore: change maafw lib use

* feat: adapt maafw control unit click & click_key

* fix: address critical issues in Android native controller

- Restore InstanceOptionKey::ClientType case in set_instance_option,
  which was accidentally removed and broke client type setting on all platforms
- Enable libMaaAndroidNativeControlUnit.so copy step in CI (was commented out),
  so Android artifacts actually include the required control unit library
- Fail connect() early when screen_resolution is missing or invalid in config,
  preventing silent {0,0} resolution that would break swipe and screencap
- Check touch_down() return value in swipe() and abort on failure

* fix: correct bounds_check off-by-one and extract KEYCODE_ESCAPE constant

- bounds_check used <= which allowed coordinates equal to screen width/height
  (off-screen); use < to match the valid range [0, dimension-1]
- Extract magic number 111 into KEYCODE_ESCAPE constexpr in press_esc()

* fix: avoid heap allocation in noexcept terminate/signal handlers

format_signal_reason was returning std::string and using std::format in
its default branch. Called from noexcept custom_terminate_handler before
the outer try block, any allocation failure would throw std::bad_alloc,
triggering recursive std::terminate and aborting crash reporting.

- Change return type to const char* noexcept, returning string literals
- Replace std::format("Signal {}", sig) with "Unknown Signal" (only the
  four registered signals are ever passed, so this branch is unreachable)
- Change signal_info in custom_terminate_handler from std::string to
  const char*, eliminating all allocations on the pre-try path

* fix: suppress unused-variable warning for signal_reason on non-Android
2026-05-12 22:15:15 +08:00
status102
9dcfeb28fd rft: 自动战斗拆出导航 2026-05-12 11:38:36 +08:00
status102
8780642041 fix: LogWarn 等宏在 Release 下依旧输出scope导致额外间隔 2026-05-11 10:16:44 +08:00
travellerse
2239a47229 fix: 界园肉鸽投资模式也启用通宝插件 (#16551)
fix: 界园肉鸽通宝拾取/交换不受 InvestWithMoreScore 限制
2026-05-10 16:41:05 +08:00
uye
11e0836aa0 feat: 支持使用 -Normal/-Hard 切换 常规/险地 难度 2026-05-09 23:29:19 +08:00
uye
6c9b907ffe fix: 修复删除 debug 截图时因文件被占用导致应用闪退的问题 2026-05-09 22:01:04 +08:00
uye
0e4d577add chore: 提前最小截图间隔的检查,小于间隔时跳过识别 2026-05-08 22:32:40 +08:00
status102
5b8ae926c2 fix: Analyzer执行前未检查m_roi是否未空 2026-05-07 19:34:21 +08:00
status102
728f9ca077 fix: 自动战斗进入等待过长
#16391
2026-05-06 03:16:23 +08:00
status102
22f3175b42 fix: OF-1战斗后等待过长导致部分后续流程失败
#16444
2026-05-06 02:15:22 +08:00
github-actions[bot]
469c1e670c chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25344285069
[skip changelog]
2026-05-04 21:25:03 +00:00
status102
c4c15ef103 rft: 剿灭入口检测支持代理卡耗尽情况 2026-05-05 05:01:59 +08:00
status102
9a2d43ca7e fix: 开始唤醒流程 2026-05-05 03:27:45 +08:00
Status102
736bab5427 rft: 重构战斗失败识别, 顺带支持沙盘战斗结束 (#16449) 2026-05-05 01:51:02 +08:00
status102
a387d5f8a4 perf: 自动编队Elite 图标匹配失败时认为elite = 0 2026-05-04 23:25:09 +08:00
uye
d913335886 fix: 编队时无精英化的干员练度会被当成 <-1, -1>
fix: #16464
2026-05-04 23:07:38 +08:00
Roland125
08f71fcfc0 fix: 修改recruit_one的返回值,适配更精细的招募计数(#16355) (#16371) 2026-05-04 22:53:04 +08:00
status102
3ef75d587c chore: remove debug code 2026-05-04 20:19:20 +08:00
Roland125
4a14245283 fix: 修复剿灭结算时,识别不到合成玉基线 (#16460)
<img width="508" height="175" alt="FABI(C}_VIB}7@N5KI51H R"
src="https://github.com/user-attachments/assets/1bb987c5-d0cc-41cd-92da-d31045490028"
/>
这是报告者的掉落图

<img width="630" height="166" alt="628X1BM7GI6$8 4(T%2}Q$0"
src="https://github.com/user-attachments/assets/8ecc8d6d-f44b-4540-93bd-8b73ef18f854"
/>
这是我本机的掉落图

明显看得出我本机的图,报酬二字上方那根线亮一些。

由于在我本机无法复现识别BUG,所以我只能用理论计算值来推断一个阈值。

根据反馈者的图提取出来的RGB值,算法计算出来的灰度是38.7(左)/44(右)。

均低于45的阈值,所以不可能有100像素长的线,于是合成玉基线被过滤掉了。

识别不到基线就不会识别对应的掉落物,就会触发无合成玉掉落导致的退出。

## Summary by Sourcery

将针对湮灭阶段的可选掉落识别处理置于仅调试用的宏之后进行控制,并在启用时将其接入自定义任务。

Enhancements:
- 当启用调试宏时,允许 `StageDropsTaskPlugin` 响应通用的动作结束任务。
- 在 `CustomTask` 中启用可选的 `StageDropsTaskPlugin` 注册,用于调试掉落识别问题。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Gate optional drop-recognition handling for annihilation stages behind a
debug-only macro and wire it into custom tasks when enabled.

Enhancements:
- Allow StageDropsTaskPlugin to respond to generic end-of-action tasks
when a debug macro is enabled.
- Enable optional registration of StageDropsTaskPlugin in CustomTask for
debugging drop recognition issues.

</details>
2026-05-04 19:35:35 +08:00
status102
b3122fbd94 fix: 肉鸽投资存款检测校验数据 2026-05-04 19:15:20 +08:00
uye
5445962a7b docs: 补全连接阶段的 ClientType 参数说明 2026-05-04 19:13:52 +08:00
github-actions[bot]
8f425bebf1 chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25290991448
[skip changelog]
2026-05-03 21:16:07 +00:00
status102
2cb0be8630 fix: typo 2026-05-04 01:52:44 +08:00
status102
4ff7c5f01d fix: 自动战斗多作业模式导航retry_time 2026-05-04 00:59:13 +08:00
fireflysentinel
e644e10d80 fix: PixelAnalyzer::set_gray_ub 复制粘贴笔误写到了 m_ub (cv::Scalar) 而非 m_gray_ub
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: fireflysentinel <phoenix1203@uchicago.edu>
2026-05-03 12:45:53 +08:00
fireflysentinel
c75eeb93bc fix: RoguelikeRecruitSupportAnalyzer::analyze HH:MM:SS substr 偏移导致 hour 永为 0、sec 严重低估
```cpp
boost::regex_search(result.text, match_results, boost::regex("[0-9]{2}:[0-9]{2}:[0-9]{2}"))
const auto& match_str = match_results[0].str();              // 8 字节 "HH:MM:SS"
const auto& hour = std::atoi(match_str.substr(2).c_str());   // ":34:56" → 0
const auto& min  = std::atoi(match_str.substr(3, 2).c_str());// "34" ✓(碰巧)
const auto& sec  = std::atoi(match_str.substr(7, 2).c_str());// "6"   → 个位
```

`"12:34:56"` 字节索引 `0=1, 1=2, 2=:, 3=3, 4=4, 5=:, 6=5, 7=6`:
- `substr(2)` 从冒号开始,atoi 立即停 → `hour = 0`
- `substr(3, 2)` 偶然命中 `"34"` → `min = 34` ✓
- `substr(7, 2)` 只有最后 1 字节 `"6"` → `sec` 是个位数字而非两位

正确偏移应为 `(0,2)`、`(3,2)`、`(6,2)`。

不是游戏机制:regex 用的就是 `[0-9]{2}:[0-9]{2}:[0-9]{2}`(ASCII 半角冒号),
匹配成功时 `match_str` 必然是严格 8 字节 `HH:MM:SS` 格式;如果游戏改成
`12时34分56秒` 这种本地化格式,regex 根本不会匹配,函数会在 line 142 提前
`return false`,根本走不到这段 substr 代码。所以 substr 的偏移只看 8 字节
ASCII 格式本身。

实际场景:招募刷新 CD 比如 `01:23:45`,当前算 `0*3600 + 23*60 + 5 = 1385`
秒,正确应是 `5025` 秒——少算近 1 小时。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: fireflysentinel <phoenix1203@uchicago.edu>
2026-05-03 12:44:56 +08:00
fireflysentinel
ef0e4958bf fix: RoguelikeFoldartalGainTaskPlugin::gain_stage_award || 链恒为 true 导致装备误入密文板列表; correct_rect计算顺序
```cpp
if (foldartal != "雷达" || "留声机" || "景观" || "LUD" || "踢脚" || "自走车")
```

C++ 把这串解析成 `(foldartal != "雷达") || ("留声机") || ("景观") || ...`,
后面 5 个字符串字面量是 `const char*`,非空指针视为 `true`,整个表达式恒真。
注释 `// 深入调查调查装备也使用同一个入口,先分类` 已经说明意图是排除这 6
个装备名,不让它们被 `gain_foldartal` 当密文板存入 `foldartal_list`。

不是游戏机制:这 6 个名字是萨米肉鸽"深入调查"事件的装备奖励(不是密文板),
跟密文板使用流程不应该混在一起;注释自陈"先分类"明确意图是过滤,
不是有意把所有 OCR 文字都收进来。

改成 `&&` 链做逐项排除。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: fireflysentinel <phoenix1203@uchicago.edu>
2026-05-03 11:37:04 +08:00
status102
cfa3fedb0c fix: correct_rect在rect负方向完全越界时依旧输出非0宽度结果 2026-05-03 11:13:21 +08:00
status102
3b909f3959 chore: log迁移
[skip changelog]
2026-05-03 03:31:40 +08:00
status102
a4e2b12e06 perf: 使用临期药品时, 如果存在时效识别失败的药品则取消本次吃药 2026-05-02 18:58:23 +08:00
status102
a5d95e5fbe fix: 开始唤醒过早开始切换账号 2026-05-02 15:02:57 +08:00
1b2c
e83e49f61b fix: 部分场景下无法自动启动游戏 (#16422)
943a798b38 在 AdbConnectionContext::replace_cmd 的统一替换表中加入了 [PackageName],
导致 m_adb.start / m_adb.stop 在 connect 阶段就被提前替换。当调用方未通过
AsstSetInstanceOption(ClientType, ...) 设置 client_type 时(如 maa-cli 等不感知该
新选项的第三方调用方),m_conn_ctx.package_name 为空字符串,m_adb.start 中的
[PackageName] 被替换为空,后续 start_game(client_type) 内的运行时替换沦为 no-op,
最终启动命令缺失包名导致启动游戏失败。

将 [PackageName] 从统一替换表移除,恢复其作为运行时参数的语义;connect 阶段唯一
需要 [PackageName] 的位置(Androws 的 displayId 查询)改为就地显式替换。

Close #16392

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:24:54 +08:00
status102
1c05ff9bc8 Revert "perf: 自动编队预编队后检查选中情况"
This reverts commit 2a5cdf24e7.
2026-05-02 02:49:49 +08:00
status102
6c6117ddb2 feat: 进入快捷编队页后校验清空状态 2026-05-02 02:49:49 +08:00
uye
013c899d34 perf: 优化 DEBUG_skill_ready 判断 2026-05-02 00:40:06 +08:00
uye
0df451b7d9 chore: 技能得分低也需要最小截图间隔 2026-05-01 23:47:11 +08:00
uye
a91286f41d perf: 大幅提升技能就绪识别准确率,优化技能截图保存策略 (#16393)
* feat: 技能截图默认保存 50 张,如存在 DEBUG_skill_ready.txt 时无限存储

* feat: maa 迎来大变

* fix: 修复技能截图保存的目录处理与并发安全

* perf: 写文件在锁外执行,init 在锁内执行
2026-05-01 12:14:12 +08:00
github-actions[bot]
84152a88f3 chore: Auto update by pre-commit hooks
https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/25134605560
[skip changelog]
2026-04-29 21:24:20 +00:00
status102
4215a05371 perf: 合并简化任务状态 2026-04-29 19:44:22 +08:00