Ref_Stop_V1_hc
约 2529 字
脚本分析:Ref_StopV1_hc
这是一个 停球阶段 (Stop) 的战术脚本,共有 9 个状态,管理 12 辆车(Leader, Kicker, Assister, Breaker, Receiver, Middle, Defender, Center, Fronter, Special, Goalie)。
状态总览与切换逻辑
┌─────────────────────────────────────┐
▼ │ 不满足条件返回
[start] ──────────────────────────────────┤
│ │
┌───────────┼────────────────┐ │
│ │ │ │
ball.x<-3200 ball.x<-3200 ball.x>=2700 ball.x∈(0,2700)
posY>10 posY<=0 posY>1500 or <-1500 各自方向
│ │ │
▼ ▼ ┌───┴───┐
[Their_corner [Their_corner [Avoid_ [Avoid_
Kick_Left] Kick_Right] Front_ Front_
Left] Right]
│ │
│ └── enemy.check_TheirCorner_num_true() → [Their_cornerKick](通用角球)
│
└── ball.x∈(0,2700) posY<-1500 → [Our_DirectKick_Left]
ball.x∈(0,2700) posY>1500 → [Our_DirectKick_Right]
ball.x∈(-3200,0) posY<-30 → [Their_DirectKick_Left]
ball.x∈(-3200,0) posY>1500 → [Their_DirectKick_Right]所有状态的公共退出条件:
cond.isGameOn()→ 切换到SituationSwitch_djb(比赛开始)
各状态详细车位
1. start(默认停球站位)
| 角色 | 位置 |
|---|---|
| Leader | middlePos(球前方约700mm,朝己方球门方向) |
| Kicker | leftPos(朝对方球门偏左3000mm) |
| Assister | rightPos(朝己方球门偏右1200mm) |
| Breaker | (-2500, 0) |
| Receiver | (-2000, 2500) |
| Middle | (-2000, -2500) |
| Defender | defenderV1(1) |
| Center | defenderV1(2) |
| Fronter | defenderAssister(3) |
| Special | defenderAssister(4) |
| Goalie | goalieV3() |
2. Their_cornerKick(对方角球通用,由enemy检测触发)
退出: !enemy.check_TheirCorner_num_true() 或 ball.x > -3200 → start
| 角色 | 位置 |
|---|---|
| Leader | middlePos |
| Kicker | (-1000, 2500) 或 (-2000, 0)(取决于ReceNum是否有效) |
| Assister | ball.y>0 → rightPos;否则 (-5000, 2000) |
| Breaker | ball.y<0 → rightPos;否则 (-5400, -1900) |
| Receiver | (-4000, -1100) |
| Middle | (-4000, 1000) |
| Defender | (-4000, 400) |
| Center | (-4000, -1000) |
| Fronter | defenderAssister(3) |
| Special | defenderAssister(4) |
| Goalie | goalieV3() |
3. Their_cornerKick_Left(对方左角球,ball.x<-3200 且 ball.y>10)
退出: enemy.check_TheirCorner_num_true() → Their_cornerKick;isGameOn → djb
| 角色 | 位置 |
|---|---|
| Leader | middlePos |
| Kicker | leftPos |
| Assister | rightPos |
| Breaker | Kicker_pos1(ball.y>0 → (-4450,-1750);否则 (-4450,1750)) |
| Receiver | Receiver_pos1(根据ball.y分区,约 (-3800~-4800, ±750~±1800)) |
| Middle | middle_corner_pos(ball.y>0 → (-5500,-2400);否则 (-5500,2400)) |
| Defender | defenderV1(1) |
| Center | defenderV1(2) |
| Fronter | defenderAssister(3) |
| Special | defenderAssister(4) |
| Goalie | goalieV3() |
4. Their_cornerKick_Right(对方右角球,ball.x<-3200 且 ball.y<=0)
退出: 同 Left
| 角色 | 位置(与Left完全相同) |
|---|---|
| Leader | middlePos |
| Kicker | leftPos |
| Assister | rightPos |
| Breaker | Kicker_pos1 |
| Receiver | Receiver_pos1 |
| Middle | middle_corner_pos |
| Defender/Center/Fronter/Special | 同上 |
| Goalie | goalieV3() |
注:Left 与 Right 当前代码位置分配完全一致,区别仅在切换条件上。
5. Avoid_Front_Left(球在右前方,x≥2700 且 y>1500)
退出: ball.x < 2700 或 ball.y < 1500 → start
| 角色 | 位置 |
|---|---|
| Leader | Leader_pos(动态,根据Player位置,约 (3000,±4000) 或 (ball.x-1000~1400,±4000)) |
| Kicker | Kicker_pos(动态,约 (2000,3900) 或 (ball.x,±2900)) |
| Assister | (3400, -1300) |
| Breaker | (3400, 1300) |
| Receiver | (0, 2000) |
| Middle | (0, -2000) |
| Defender | defenderV1(1) |
| Center | defenderV1(2) |
| Fronter | defenderAssister(3) |
| Special | defenderAssister(4) |
| Goalie | goalieV3() |
6. Avoid_Front_Right(球在右前方,x≥2000 且 y<-1000)
退出: ball.x < 2000 或 ball.y > -1000 → start
| 角色 | 位置(与Left相同) |
|---|---|
| Leader | Leader_pos |
| Kicker | Kicker_pos |
| Assister | (3400, -1300) |
| Breaker | (3400, 1300) |
| Receiver | (0, 2000) |
| Middle | (0, -2000) |
| Defender/Center/Fronter/Special/Goalie | 同上 |
7. Our_DirectKick_Left(我方直接球,x∈(0,2700) 且 y<-1500)
退出: ball.x>2700 或 ball.x<0 或 ball.y>-1500 → start
| 角色 | 位置 |
|---|---|
| Leader | middlePos |
| Kicker | Kicker_pos2((1000,0)) |
| Assister | (-2500, 2000) |
| Breaker | (-4500, -2500) |
| Receiver | Receiver_pos2(ball.y>0 → (0,1800);否则 (-1000,-1800)) |
| Middle | (1500, 2800) |
| Defender/Center/Fronter/Special/Goalie | 标准防守 |
8. Our_DirectKick_Right(我方直接球,x∈(0,2700) 且 y>1500)
退出: ball.x>2700 或 ball.x<0 或 ball.y<1500 → start
| 角色 | 位置 |
|---|---|
| Leader | middlePos |
| Kicker | Kicker_pos2((1000,0)) |
| Assister | (-2200, -3000) |
| Breaker | (-2200, 3000) |
| Receiver | Receiver_pos2 |
| Middle | Middle_pos2(ball.y>0 → (0,-1800);否则 (0,1800)) |
| Defender/Center/Fronter/Special/Goalie | 标准防守 |
9. Their_DirectKick_Left(对方直接球,x∈(-3200,0) 且 y<-30)
退出: ball.x<-3500 或 ball.x>0 或 ball.y>0 → start
| 角色 | 位置 |
|---|---|
| Leader | middlePos |
| Kicker | Kicker_pos3((ball.x-900, ball.y-900)) |
| Assister | (1000, 0) |
| Breaker | (-2300, -3000) |
| Receiver | Receiver_pos3(分3段,约 (ball.x-400, ±450) 或 (ball.x-1000,-2250)) |
| Middle | (-3500, 2800) |
| Defender/Center/Fronter/Special/Goalie | 标准防守 |
10. Their_DirectKick_Right(对方直接球,x∈(-3200,0) 且 y>1500)
退出: ball.x<-3500 或 ball.x>=0 或 ball.y<1500 → start
| 角色 | 位置 |
|---|---|
| Leader | middlePos |
| Kicker | Kicker_pos3 |
| Assister | (1500, 1500) |
| Breaker | (-2700, -700) |
| Receiver | Receiver_pos3 |
| Middle | Middle_pos3(与Receiver_pos3镜像,y取反) |
| Defender/Center/Fronter/Special/Goalie | 标准防守 |
几个关键动态位置函数说明
middlePos: 站在球与己方球门连线上,距球约700mm,作为中场压迫leftPos: 朝对方球门偏左3000mm(进攻跑位)rightPos: 朝己方球门偏右1200mm(防守跑位)Kicker_pos1: 根据ball.y在(-4450,±1750)拦截角球Kicker_pos3: 跟随球位(ball.x-900, ball.y-900)拦截
2
场地坐标系说明:X轴 -6000~+6000(己方门在-6000,对方门在+6000),Y轴 -4500~+4500(正方向为左侧/上方)
位置函数解析
middlePos(Leader 常用,中场压迫位)
| 条件 | 目标坐标 | 场地位置 |
|---|---|---|
| 球X∈(-5000,-3000) 且 Y∈(-3000,-1800) | (ball.x-700, ball.y-500) | 球在己方左后角,站在球的右下方挡路 |
| 球X∈(-5000,-3000) 且 Y∈(1800,3000) | (ball.x-700, ball.y+500) | 球在己方右后角,站在球的右上方挡路 |
| 其余 | 球与己方球门连线上,距球约700mm | 夹在球与己方球门之间,中场防压 |
leftPos(进攻跑位)
朝对方球门方向偏左3000mm → 深度进攻左侧插上,约在对方半场左侧边线附近
rightPos(防守侧翼)
朝己方球门方向偏右1200mm → 偏向己方一侧的侧翼,距球约1200mm
Stop_pos(未使用的备用位)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| refPosY < 0 | (-4050, 1950) | 己方后场左侧,靠近己方禁区角 |
| refPosY ≥ 0 | (-4050, -1950) | 己方后场右侧,靠近己方禁区角 |
Leader_pos(大前场避位,Avoid系列用)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| Player.x>3850 且 Y∈(0,2500) | (3000, 4000) | 对方半场左侧接近边线(Y=4000,边线4500) |
| Player.x>3850 且 Y∈(-2500,0) | (3000, -4000) | 对方半场右侧接近边线 |
| Player.x>3850 且 |Y|>2500 且 ball.y>0 | (ball.x-1400, 4000) | 跟随球X,贴左边线撤退 |
| Player.x>3850 且 |Y|>2500 且 ball.y<0 | (ball.x-1400, -4000) | 跟随球X,贴右边线撤退 |
| Player.x<3850 且 ball.y>0 | (ball.x-1000, 4000) | 跟随球X,贴左边线 |
| Player.x<3850 且 ball.y≤0 | (ball.x-1000, -4000) | 跟随球X,贴右边线 |
Y=±4000:距边线仅500mm,紧贴边线跑位
Kicker_pos(大前场避位,Avoid系列用)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| Player.x>3850 且 Y∈(0,2500) | (2000, 3900) | 对方半场偏后左侧边线附近 |
| Player.x>3850 且 Y∈(-2500,0) | (2000, 3900) | 同上(两分支代码相同) |
| Player.x>3850 且 Y>2500 | (ball.x, 2900) | 跟随球X,左侧中场 |
| Player.x>3850 且 Y<-2500 | (ball.x, -2900) | 跟随球X,右侧中场 |
| Player.x<3850 且 ball.y>0 | (ball.x, -2900) | 跟随球X,对侧右侧中场(交叉跑位) |
| Player.x<3850 且 ball.y≤0 | (ball.x, 2900) | 跟随球X,对侧左侧中场 |
Kicker_pos1(角球拦截位)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| ball.y > 0(球在左侧) | (-4450, -1750) | 己方后场右侧,禁区外沿右角附近,与角球交叉拦截 |
| ball.y ≤ 0(球在右侧) | (-4450, 1750) | 己方后场左侧,禁区外沿左角附近 |
X=-4450 几乎在己方禁区边缘(标准禁区深度到 x=-4200)
Kicker_pos2(我方直接球用)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| 任意 | (1000, 0) | 对方半场中央偏近侧,中路压迫 |
Kicker_pos3(对方直接球跟随位)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| 任意 | (ball.x-900, ball.y-900) | 球的右下方900mm处,斜向防守 |
Receiver_pos(进攻前场接应,未直接用于状态)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| Player.x>4200 且 Y>0 | (2700, 3900) | 对方半场左侧边线前 |
| Player.x>4200 且 Y<0 | (2700, -3900) | 对方半场右侧边线前 |
| Player.x<4250 | (2800, 0) | 对方半场中路待机 |
Receiver_pos1(角球防守接应)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| KickNum有效 且 ball.y>1800 | (-3800, 750) | 己方后场中偏左,禁区右前方 |
| KickNum有效 且 ball.y<-1800 | (-3800, -750) | 己方后场中偏右 |
| KickNum有效 且 ball.y∈(0,1800] | (-4800, 1800) | 己方禁区左侧角,深后场 |
| KickNum有效 且 ball.y≤0 | (-4800, -1800) | 己方禁区右侧角,深后场 |
| KickNum无效 且 ball.y>0 | (-4450, -1750) | 己方后场右侧(与 Kicker_pos1 相同) |
| KickNum无效 且 ball.y≤0 | (-4450, 1750) | 己方后场左侧 |
Receiver_pos2(我方直接球接应)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| ball.y > 0 | (0, 1800) | 中场左侧,等待转移 |
| ball.y ≤ 0 | (-1000, -1800) | 己方半场右侧中场 |
Middle_pos2(我方直接球中场镜像位)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| ball.y > 0 | (0, -1800) | 中场右侧(与Receiver_pos2镜像) |
| ball.y ≤ 0 | (0, 1800) | 中场左侧 |
Receiver_pos3 / Middle_pos3(对方直接球,互为镜像)
Receiver_pos3:
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| ball.y > 0 | (ball.x-400, 450) | 球后方,轻微右偏(偏中路) |
| ball.y∈(-1500,0] | (ball.x-1000, -2250) | 球后方右侧较远,防守侧翼 |
| ball.y≤-1500 | (ball.x-400, -450) | 球后方,轻微左偏 |
Middle_pos3(与Receiver_pos3左右镜像):
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| ball.y > 0 | (ball.x-400, -450) | 球后方对侧 |
| ball.y∈(-1500,0] | (ball.x-1000, 2250) | 球后方左侧较远 |
| ball.y≤-1500 | (ball.x-400, 450) | 球后方对侧 |
Breaker_pos3(与 Middle_pos3 完全相同,代码重复)
middle_corner_pos(角球时中场边线位)
| 条件 | 坐标 | 场地位置 |
|---|---|---|
| ball.y > 0 | (-5500, -2400) | 己方底线右侧,靠近己方右角(距底线仅500mm) |
| ball.y ≤ 0 | (-5500, 2400) | 己方底线左侧,靠近己方左角 |
各状态硬编码坐标汇总
| 坐标 | 所在状态 | 角色 | 场地位置描述 |
|---|---|---|---|
(-2500, 0) | start | Breaker | 己方半场中圆附近,中路待机 |
(-2000, 2500) | start | Receiver | 己方半场左侧中场线附近 |
(-2000, -2500) | start | Middle | 己方半场右侧中场线附近 |
(-1000, 2500) | Their_cornerKick | Kicker | 己方半场偏对方左侧中场 |
(-2000, 0) | Their_cornerKick | Kicker(fallback) | 己方半场中路待机 |
(-5000, 2000) | Their_cornerKick | Assister | 己方深后场左侧,禁区外缘 |
(-5400, -1900) | Their_cornerKick | Breaker | 己方底线右侧,几乎贴底线 |
(-4000, -1100) | Their_cornerKick | Receiver | 己方后场右侧,禁区右前 |
(-4000, 1000) | Their_cornerKick | Middle | 己方后场左侧,禁区左前 |
(-4000, 400) | Their_cornerKick | Defender | 己方后场中央,禁区前 |
(-4000, -1000) | Their_cornerKick | Center | 己方后场偏右,禁区前 |
(3400, -1300) | Avoid_Front_Left/Right | Assister | 对方半场右侧,深前场 |
(3400, 1300) | Avoid_Front_Left/Right | Breaker | 对方半场左侧,深前场 |
(0, 2000) | Avoid系列 | Receiver | 中场偏左,中场线附近 |
(0, -2000) | Avoid系列 | Middle | 中场偏右,中场线附近 |
(-2500, 2000) | Our_DirectKick_Left | Assister | 己方半场左侧中场 |
(-4500, -2500) | Our_DirectKick_Left | Breaker | 己方后场右侧深处(接近角落) |
(1500, 2800) | Our_DirectKick_Left | Middle | 对方半场左侧边线前 |
(-2200, -3000) | Our_DirectKick_Right | Assister | 己方半场右侧边线处 |
(-2200, 3000) | Our_DirectKick_Right | Breaker | 己方半场左侧边线处 |
(1000, 0) | Our_DirectKick系列 | Kicker | 对方半场中路近端 |
(-2300, -3000) | Their_DirectKick_Left | Breaker | 己方半场右侧边线 |
(-3500, 2800) | Their_DirectKick_Left | Middle | 己方后场左侧,偏边线 |
(1500, 1500) | Their_DirectKick_Right | Assister | 对方半场偏左中路 |
(-2700, -700) | Their_DirectKick_Right | Breaker | 己方半场中偏右,中路防守 |
一些值得注意的问题
(-5500, ±2400)(middle_corner_pos) — X=-5500 已深入己方禁区纵深范围,Y=±2400 接近禁区边缘,车在此位置需注意与 Goalie 冲突(3400, ±1300)— Y=±1300 在对方半场内侧翼,但 X=3400 距对方禁区(约x=4200起)还有800mm,安全Kicker_pos3 = (ball.x-900, ball.y-900)— 当球在左下角(如 x=-2000, y=-3000)时目标为(-2900, -3900),非常靠近边线(边线Y=-4500),可能会造成车辆贴边运动Avoid_Front_Right的退出条件ball.x < 2000与进入条件ball.x >= 2700不对称,存在一个 x∈[2000,2700) 的滞回区间,防止反复切换
贡献者
更新日志
8741b-ssl_vision 与 rocos_nbt于