Conversation
Member
Author
|
@sourcery-ai summary |
Contributor
There was a problem hiding this comment.
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>帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的评审。
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/inferRotationare 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
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 控制器下的小地图/指针裁剪中心坐标。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
此 PR 为自动基质刷取任务新增了 ADB 控制器的支持,并修复了先前存在的少数细节问题(例如工业设备界面问题)。
此外,根据发现的 ADB 特性,微调了基础设施(例如寻路)的参数。
关联
此 PR 中附带的修复将关闭下述议题:
Fix #1507
Summary by Sourcery
为 AutoEssence 流程和地图跟踪添加针对 ADB 的专门支持和调优。
新功能:
resource_adb目录下新增一个 ADB 专用的 AutoEssence 流水线定义。增强内容:
WLQingboStockade流水线资源以及 AutoEssence 任务配置,以支持选择并运行基于 ADB 的流水线。Original summary in English
Summary by Sourcery
Add ADB-specific support and tuning for AutoEssence flows and map tracking.
New Features:
Enhancements:
新功能:
resource_adb目录下新增 ADB 专用的 AutoEssence 流水线定义。Original summary in English
Summary by Sourcery
为 AutoEssence 流程和地图跟踪添加针对 ADB 的专门支持和调优。
新功能:
resource_adb目录下新增一个 ADB 专用的 AutoEssence 流水线定义。增强内容:
WLQingboStockade流水线资源以及 AutoEssence 任务配置,以支持选择并运行基于 ADB 的流水线。Original summary in English
Summary by Sourcery
Add ADB-specific support and tuning for AutoEssence flows and map tracking.
New Features:
Enhancements: