Skip to content

feat(AutoEssence): 自动基质刷取支持ADB控制器#1532

Merged
MistEO merged 9 commits intoMaaEnd:v2from
isHarryh:v2
Mar 23, 2026
Merged

feat(AutoEssence): 自动基质刷取支持ADB控制器#1532
MistEO merged 9 commits intoMaaEnd:v2from
isHarryh:v2

Conversation

@isHarryh
Copy link
Copy Markdown
Member

@isHarryh isHarryh commented Mar 22, 2026

概要

此 PR 为自动基质刷取任务新增了 ADB 控制器的支持,并修复了先前存在的少数细节问题(例如工业设备界面问题)。

此外,根据发现的 ADB 特性,微调了基础设施(例如寻路)的参数。

关联

此 PR 中附带的修复将关闭下述议题:

Fix #1507

Summary by Sourcery

为 AutoEssence 流程和地图跟踪添加针对 ADB 的专门支持和调优。

新功能:

  • resource_adb 目录下新增一个 ADB 专用的 AutoEssence 流水线定义。

增强内容:

  • 更新 AutoEssence 和 WLQingboStockade 流水线资源以及 AutoEssence 任务配置,以支持选择并运行基于 ADB 的流水线。
  • 调整 ADB 地图跟踪的小地图与旋转裁剪区域,以在 ADB 控制的屏幕上获得更好的对齐效果。
  • 重新调整 ADB 相机旋转滑动的时间参数,使控制响应更加顺畅。
Original summary in English

Summary by Sourcery

Add ADB-specific support and tuning for AutoEssence flows and map tracking.

New Features:

  • Introduce an ADB-specific AutoEssence pipeline definition under the resource_adb directory.

Enhancements:

  • Update AutoEssence and WLQingboStockade pipeline resources and AutoEssence task configuration to support selecting and running ADB-based pipelines.
  • Adjust ADB map-tracking minimap and rotation crop regions for improved alignment on ADB-controlled screens.
  • Retune ADB camera rotation swipe timing for smoother control response.

新功能:

  • resource_adb 目录下新增 ADB 专用的 AutoEssence 流水线定义。
  • 更新 AutoEssence 流水线和 WLQingboStockade 资源,以支持新的 ADB 控制器选项。
  • 调整 AutoEssence 任务配置,以支持通过基于 ADB 的流水线进行选择或运行。
Original summary in English

Summary by Sourcery

为 AutoEssence 流程和地图跟踪添加针对 ADB 的专门支持和调优。

新功能:

  • resource_adb 目录下新增一个 ADB 专用的 AutoEssence 流水线定义。

增强内容:

  • 更新 AutoEssence 和 WLQingboStockade 流水线资源以及 AutoEssence 任务配置,以支持选择并运行基于 ADB 的流水线。
  • 调整 ADB 地图跟踪的小地图与旋转裁剪区域,以在 ADB 控制的屏幕上获得更好的对齐效果。
  • 重新调整 ADB 相机旋转滑动的时间参数,使控制响应更加顺畅。
Original summary in English

Summary by Sourcery

Add ADB-specific support and tuning for AutoEssence flows and map tracking.

New Features:

  • Introduce an ADB-specific AutoEssence pipeline definition under the resource_adb directory.

Enhancements:

  • Update AutoEssence and WLQingboStockade pipeline resources and AutoEssence task configuration to support selecting and running ADB-based pipelines.
  • Adjust ADB map-tracking minimap and rotation crop regions for improved alignment on ADB-controlled screens.
  • Retune ADB camera rotation swipe timing for smoother control response.

@isHarryh
Copy link
Copy Markdown
Member Author

@sourcery-ai summary

@isHarryh isHarryh marked this pull request as ready for review March 23, 2026 10:31
Copilot AI review requested due to automatic review settings March 23, 2026 10:31
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并给出了一些整体性的反馈:

  • 现在 inferLocation/inferRotation 中硬编码的 ADB 小地图裁剪坐标和半径和 Win32 路径略有不同;建议把这些值提取为具名常量,或者按控制器类型拆分成一个小的配置结构体,以避免魔法数字,并方便以后重新调参。
  • RotateCamera 时长所做的修改(defaultTouchActionDelayMillis/2*5)依赖于整数运算和运算符优先级;建议要么加一条简短注释说明预期时长(例如 2.5 倍),要么重构成更清晰的表达式,以避免之后产生困惑或引入回归。
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The hard-coded ADB minimap crop coordinates and radii in `inferLocation`/`inferRotation` are now slightly different from the Win32 path; consider extracting these into named constants or a small configuration struct per controller type to avoid magic numbers and make future retuning easier.
- The change to `RotateCamera`’s duration (`defaultTouchActionDelayMillis/2*5`) relies on integer arithmetic and operator precedence; consider either adding a brief comment describing the intended timing (e.g., 2.5x) or refactoring to a clearer expression to avoid confusion or accidental regression later.

## Individual Comments

### Comment 1
<location path="agent/go-service/pkg/control/adaptor_adb.go" line_range="74" />
<code_context>
 func (aca *ADBControlAdaptor) RotateCamera(dx, dy int) {
 	cx, cy := aca.w/4*3, aca.h/2
-	aca.Swipe(cameraContact, cx, cy, dx, dy, defaultTouchActionDelayMillis*2, 0)
+	aca.Swipe(cameraContact, cx, cy, dx, dy, defaultTouchActionDelayMillis/2*5, 0)
 }

</code_context>
<issue_to_address>
**issue (bug_risk):** Clarify delay computation to avoid unintended truncation and precedence issues.

With integer math this expression is evaluated as `(defaultTouchActionDelayMillis / 2) * 5`, so the division truncates before multiplying and can differ from `defaultTouchActionDelayMillis * 5 / 2`. If you want an exact 2.5× multiplier of the original delay, please rewrite it as `defaultTouchActionDelayMillis*5/2` (or use a named constant) to avoid subtle rounding differences.
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • The hard-coded ADB minimap crop coordinates and radii in inferLocation/inferRotation are now slightly different from the Win32 path; consider extracting these into named constants or a small configuration struct per controller type to avoid magic numbers and make future retuning easier.
  • The change to RotateCamera’s duration (defaultTouchActionDelayMillis/2*5) relies on integer arithmetic and operator precedence; consider either adding a brief comment describing the intended timing (e.g., 2.5x) or refactoring to a clearer expression to avoid confusion or accidental regression later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The hard-coded ADB minimap crop coordinates and radii in `inferLocation`/`inferRotation` are now slightly different from the Win32 path; consider extracting these into named constants or a small configuration struct per controller type to avoid magic numbers and make future retuning easier.
- The change to `RotateCamera`’s duration (`defaultTouchActionDelayMillis/2*5`) relies on integer arithmetic and operator precedence; consider either adding a brief comment describing the intended timing (e.g., 2.5x) or refactoring to a clearer expression to avoid confusion or accidental regression later.

## Individual Comments

### Comment 1
<location path="agent/go-service/pkg/control/adaptor_adb.go" line_range="74" />
<code_context>
 func (aca *ADBControlAdaptor) RotateCamera(dx, dy int) {
 	cx, cy := aca.w/4*3, aca.h/2
-	aca.Swipe(cameraContact, cx, cy, dx, dy, defaultTouchActionDelayMillis*2, 0)
+	aca.Swipe(cameraContact, cx, cy, dx, dy, defaultTouchActionDelayMillis/2*5, 0)
 }

</code_context>
<issue_to_address>
**issue (bug_risk):** Clarify delay computation to avoid unintended truncation and precedence issues.

With integer math this expression is evaluated as `(defaultTouchActionDelayMillis / 2) * 5`, so the division truncates before multiplying and can differ from `defaultTouchActionDelayMillis * 5 / 2`. If you want an exact 2.5× multiplier of the original delay, please rewrite it as `defaultTouchActionDelayMillis*5/2` (or use a named constant) to avoid subtle rounding differences.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本 PR 为 AutoEssence(自动基质刷取) 增加对 ADB 控制器 的资源与流水线支持,并同步调整相关地图导航与识别参数,使其能在移动端/模拟器的 ADB 控制方式下运行。

Changes:

  • AutoEssence 任务配置新增支持 ADB 控制器,并清理与已移除节点相关的 override。
  • 新增 assets/resource_adb 下 AutoEssence 的 ADB 专用 pipeline 覆写与所需模板图片资源。
  • 更新 AutoEssence 主流水线与清波寨路径点,调整 ADB 下 MapTracker 小地图裁剪坐标与 ADB 相机旋转时长。

Reviewed changes

Copilot reviewed 6 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
assets/tasks/AutoEssence.json AutoEssence 任务声明支持 ADB 控制器,并移除对已删除节点的 pipeline_override。
assets/resource_adb/pipeline/AutoEssence/AutoEssence.json 提供 ADB 下对若干关键节点(Alt 键相关、按钮 ROI、误入界面关闭等)的 pipeline 覆写。
assets/resource_adb/image/AutoEssence/SpDialog.png ADB 资源包新增体力不足弹窗模板图。
assets/resource_adb/image/AutoEssence/FactoryDeviceDialog.png ADB 资源包新增工业设备界面模板图。
assets/resource_adb/image/AutoEssence/EssenceTrigger.png ADB 资源包新增激发按钮模板图。
assets/resource_adb/image/AutoEssence/EssenceScaling1.png ADB 资源包新增倍数选择模板图(1)。
assets/resource_adb/image/AutoEssence/EssenceScaling2.png ADB 资源包新增倍数选择模板图(2)。
assets/resource_adb/image/AutoEssence/EssenceOverrideOn.png ADB 资源包新增刻写开关模板图(开)。
assets/resource_adb/image/AutoEssence/EssenceOverrideOff.png ADB 资源包新增刻写开关模板图(关)。
assets/resource_adb/image/AutoEssence/EssenceOngoing.png ADB 资源包新增挑战进行中判定模板图。
assets/resource_adb/image/AutoEssence/EssenceObtain.png ADB 资源包新增领取奖励按钮模板图。
assets/resource/pipeline/AutoEssence/WLQingboStockade.json 微调清波寨散步路径点坐标。
assets/resource/pipeline/AutoEssence/AutoEssence.json 增强节点描述、引入地区识别失败提示节点、替换 AltKeyUp 节点名并新增若干识别/动作参数调整。
agent/go-service/pkg/control/adaptor_adb.go 调整 ADB 旋转视角的 Swipe 时长计算。
agent/go-service/map-tracker/infer.go 调整 ADB 控制器下的小地图/指针裁剪中心坐标。

@MistEO MistEO merged commit f9afb09 into MaaEnd:v2 Mar 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

自动刷基质误点设备后卡死

3 participants