From 828342da0d402b5043fc9c07fb771d7809e2d47e Mon Sep 17 00:00:00 2001 From: Umbrella167 <1670187757@qq.com> Date: Thu, 16 May 2024 21:02:58 +0800 Subject: [PATCH 1/2] add new car --- Core/HuRocos-2024/PlayConfig.lua | 4 +- Core/HuRocos-2024/play/Nor_Dribbling.lua | 2 +- Core/HuRocos-2024/play/Nor_Shoot.lua | 7 +- Core/HuRocos-2024/play/our_Penalty.lua | 22 +++-- Core/src/Utils/utils.cpp | 7 +- Core/tactics/play/TestCircleRun.lua | 2 +- Core/tactics/skill/Getball.lua | 2 +- ZBin/lua_scripts/worldmodel/param.lua | 104 +++++++++++++++++++---- ZBin/lua_scripts/worldmodel/task.lua | 24 +++--- 9 files changed, 126 insertions(+), 48 deletions(-) diff --git a/Core/HuRocos-2024/PlayConfig.lua b/Core/HuRocos-2024/PlayConfig.lua index 48e9956..3b88024 100644 --- a/Core/HuRocos-2024/PlayConfig.lua +++ b/Core/HuRocos-2024/PlayConfig.lua @@ -17,7 +17,7 @@ gRefConfig = { GameHalt = "HALT", GameStop = "STOP", OurTimeout = "HALT", - TheirIndirectKick = "NORMALPLAY", + TheirIndirectKick = "NORMALPLAYV2", OurIndirectKick = function() if ball.posX() > 3000 then return "our_CornerKick" @@ -33,6 +33,6 @@ gRefConfig = { OurBallPlacement = "our_BallPlacement", TheirPenaltyKick = "their_Penalty", OurPenaltyKick = "our_Penalty", - NormalPlay = "NORMALPLAY" -- {"NORMALPLAY", "NORMALPLAYV2"}, + NormalPlay = "NORMALPLAYV2" -- {"NORMALPLAY", "NORMALPLAYV2"}, } --]] diff --git a/Core/HuRocos-2024/play/Nor_Dribbling.lua b/Core/HuRocos-2024/play/Nor_Dribbling.lua index 0a16c1e..78ba024 100644 --- a/Core/HuRocos-2024/play/Nor_Dribbling.lua +++ b/Core/HuRocos-2024/play/Nor_Dribbling.lua @@ -30,7 +30,7 @@ local dribblingDir = function(role) end end local dribblingCount = 0 -local dribblingVel = 1000 +local dribblingVel = 3000 local canShootAngle = 30 local showPassPos = param.shootPos return { diff --git a/Core/HuRocos-2024/play/Nor_Shoot.lua b/Core/HuRocos-2024/play/Nor_Shoot.lua index 12dc290..45c07da 100644 --- a/Core/HuRocos-2024/play/Nor_Shoot.lua +++ b/Core/HuRocos-2024/play/Nor_Shoot.lua @@ -32,7 +32,6 @@ local debugMesg = function () debugEngine:gui_debug_msg(resShootPos,"rotCompensatePos",6,0,param.debugSize) debugEngine:gui_debug_x(param.shootPos,6,0,param.debugSize) debugEngine:gui_debug_msg(param.shootPos,"ShootPos",6,0,param.debugSize) - end return { @@ -69,7 +68,7 @@ firstState = "Init", end local Vy = player.rotVel("Assister") local ToTargetDist = player.toPointDist("Assister",param.shootPos) - resShootPos = task.compensateAngle("Assister",Vy,param.shootPos,ToTargetDist * param.rotCompensate) + resShootPos = task.compensateAngle("Assister",Vy,param.shootPos,ToTargetDist * param.rotCompensate(player.num("Assister"))) end, Assister = task.getball(function() return shoot_pos end,param.playerVel,param.getballMode), match = "[A]" @@ -90,14 +89,14 @@ firstState = "Init", end local Vy = player.rotVel("Assister") local ToTargetDist = player.toPointDist("Assister",param.shootPos) - resShootPos = task.compensateAngle("Assister",Vy,param.shootPos,ToTargetDist * param.rotCompensate) + resShootPos = task.compensateAngle("Assister",Vy,param.shootPos,ToTargetDist * param.rotCompensate(player.num("Assister"))) if(task.playerDirToPointDirSub("Assister",resShootPos) < param.shootError) then return "shoot" end end, - Assister = function() return task.TurnToPointV2("Assister", function() return resShootPos end,param.rotVel()) end, + Assister = function() return task.TurnToPointV2("Assister", function() return resShootPos end,param.rotVel(player.num("Assister"))) end, match = "{A}" }, diff --git a/Core/HuRocos-2024/play/our_Penalty.lua b/Core/HuRocos-2024/play/our_Penalty.lua index a1a23ae..091e884 100644 --- a/Core/HuRocos-2024/play/our_Penalty.lua +++ b/Core/HuRocos-2024/play/our_Penalty.lua @@ -4,7 +4,7 @@ local p2 = CGeoPoint(- param.pitchLength / 2 + 300,param.pitchWidth / 2 - 600) local p3 = CGeoPoint(- param.pitchLength / 2 + 300, -param.pitchWidth / 2 + 300) local p4 = CGeoPoint(- param.pitchLength / 2 + 300,-param.pitchWidth / 2 + 600) local p5 = CGeoPoint(- param.pitchLength / 2 , 0) -local shootThreshold = 3000 +local shootThreshold = 2500 local canShoot = function(role,ishootThreshold) if ball.posX() > ishootThreshold then @@ -35,7 +35,7 @@ local shootFlag = function(role) end local Power = function(role,shoot_flag,ishootThreshold) - local ipower = 100 + local ipower = 110 local ishoot_falg if type(shoot_flag) == 'function' then ishoot_falg = shoot_flag() @@ -44,11 +44,11 @@ local Power = function(role,shoot_flag,ishootThreshold) end if ball.posX() > ishootThreshold then if (ishoot_falg == kick.chip()) then - ipower = 130 + ipower = 7000 end else if (ishoot_falg == kick.chip()) then - ipower = 110 + ipower = 7000 end end return ipower @@ -98,10 +98,10 @@ firstState = "Init1", ["getball"] = { switch = function() + shoot_flag = shootFlag("Assister") param.shootPos = Utils.GetShootPoint(vision,player.num("Assister")) - - if player.myinfraredCount("Assister") > 15 then + if player.myinfraredCount("Assister") > 5 then if shoot_flag == 2 then return "shoot_dribbling" else @@ -115,6 +115,9 @@ firstState = "Init1", ["turnToPoint"] = { switch = function() shoot_flag = shootFlag("Assister") + if ball.posX() > shootThreshold then + return "shoot_point" + end if(bufcnt(player.myinfraredCount("Assister") < 1,4)) then return "getball" end @@ -133,14 +136,17 @@ firstState = "Init1", }, ["shoot_dribbling"] = { switch = function() + if ball.posX() > shootThreshold then + return "shoot_point" + end param.shootPos = Utils.GetShootPoint(vision,player.num("Assister")) shoot_flag = shootFlag("Assister") debugEngine:gui_debug_msg(CGeoPoint(0,0),shoot_flag) - if(bufcnt(player.myinfraredCount("Assister") < 1,1)) then + if player.myinfraredCount("Assister") < 1 then return "getball" end end, - Assister = task.ShootdotDribbling(param.shootError,function() return shoot_flag end ,function() return Power("Assister",function() return shoot_flag end ,shootThreshold) end), + Assister = task.ShootdotDribbling(param.shootError + 10,function() return shoot_flag end ,function() return Power("Assister",function() return shoot_flag end ,shootThreshold) end), match = "{A}" }, diff --git a/Core/src/Utils/utils.cpp b/Core/src/Utils/utils.cpp index a6b522b..c3ea836 100644 --- a/Core/src/Utils/utils.cpp +++ b/Core/src/Utils/utils.cpp @@ -24,7 +24,8 @@ GlobalTick Tick[PARAM::Tick::TickLength]; int now = PARAM::Tick::TickLength - 1; int last = PARAM::Tick::TickLength - 2; CGeoPoint lastMovePoint = CGeoPoint(inf, inf); -double playerInfraredCountBuffer = 100;// 红外判断缓冲值 +double playerInfraredCountBuffer = 95; //场地 3 红外判断缓冲值 +//double playerInfraredCountBuffer = 100; //场地 2 红外判断缓冲值 double playerBallRightsBuffer = 110;// 球权判断缓冲值 double pass_threshold = 0.1; //射门阈值 namespace Utils @@ -102,8 +103,8 @@ namespace Utils // 如果球的视野消失,但是有红外信息,认为球的位置在触发红外的机器人上 if(!pVision ->ball().Valid()) - if(RobotSensor.InfraredOnCount(i)>5) - Tick[now].ball.pos = pVision->ourPlayer(i).Pos()+Polar2Vector(120,pVision->ourPlayer(i).Dir()); + if(RobotSensor.InfraredOnCount(i)>5 && pVision->ourPlayer(i).Pos().dist(Tick[now].ball.pos) < 1000) + Tick[now].ball.pos = pVision->ourPlayer(i).Pos()+Polar2Vector(85,pVision->ourPlayer(i).Dir()); // 我方距离球最近的车号 double to_ball_dist = pVision->ourPlayer(i).Pos().dist(Tick[now].ball.pos); if (our_min_dist > to_ball_dist) diff --git a/Core/tactics/play/TestCircleRun.lua b/Core/tactics/play/TestCircleRun.lua index 359d11f..885cae4 100644 --- a/Core/tactics/play/TestCircleRun.lua +++ b/Core/tactics/play/TestCircleRun.lua @@ -23,7 +23,7 @@ firstState = "ready1", debugEngine:gui_debug_msg(CGeoPoint:new_local(0,0),player.rotVel("Assister")) end, - Assister = task.TurnRun(CGeoPoint(300,0),5), + Assister = task.TurnRun(CGeoPoint(120,60),6), match = "[A]" }, diff --git a/Core/tactics/skill/Getball.lua b/Core/tactics/skill/Getball.lua index cdc2613..73f216f 100644 --- a/Core/tactics/skill/Getball.lua +++ b/Core/tactics/skill/Getball.lua @@ -59,7 +59,7 @@ function Getball(task) [1] = {100,1}, [2] = {0,1}, [3] = {0,1}, - [4] = {0,1}, + [4] = {500,1}, [5] = {0,1}, [6] = {200,1.2}, [7] = {0,1}, diff --git a/ZBin/lua_scripts/worldmodel/param.lua b/ZBin/lua_scripts/worldmodel/param.lua index e5bbd74..142a0a0 100644 --- a/ZBin/lua_scripts/worldmodel/param.lua +++ b/ZBin/lua_scripts/worldmodel/param.lua @@ -42,7 +42,7 @@ ourButtomGoalPos = CGeoPoint:new_local(-pitchLength / 2, -goalRadius) penaltyMiddleLine = CGeoSegment(ourGoalPos, ourGoalPos + Utils.Polar2Vector(penaltyDepth, 0)) -- 是否为真实场地 -isReality = false +isReality = true Team = "TWO" -- Team = "TWO" allowTouch = false -- 是否开启touch canTouchAngle = 45 -- 可以touch的角度f @@ -53,9 +53,8 @@ debugSize = 100 -----------------------------------------------| playerVel = 1.88 -- 机器人速度 getballMode = 1 -- [0[激进模式], 1[保守模式], 2[middle]] --- local V_DECAY_RATE_Reality = 700 -- 场地摩擦 -local V_DECAY_RATE_Reality = 800 -- 场地摩擦 - +-- local V_DECAY_RATE_Reality = 800 -- 场地2摩擦 +local V_DECAY_RATE_Reality = 900 -- 场地3摩擦 lastInterPos = CGeoPoint:new_local(-INF, -INF) -- 上一次算点结果 rushToBallCount = 0 -- distRate = 0.2 -- @@ -80,21 +79,90 @@ playerRadius = 90 -- 机器人半径 -----------------------------------------------| local shootError_Reality = 5 --1.8 -- 射击误差 shootKp = 0.1 -- 射击力度比例 --- shootPos = CGeoPoint(0, 2300) +-- shootPos = CGeoPoint(0, 0) shootPos = CGeoPoint(pitchLength / 2, 0) -----------------------------------------------| -- rot参数 --| -----------------------------------------------| -rotPos = CGeoPoint(60, 60) --CGeoPoint(80,80) --旋转坐标 -rotVel = function() + --CGeoPoint(80,80) --旋转坐标 + +rotTableONE = { + -- [num] = {minist,maxDist,minPower, maxPower, ShootPower,chipPower} + [0] = {CGeoPoint(60, 60),4.5}, + [1] = {CGeoPoint(60, 60),4.5}, + [2] = {CGeoPoint(60, 60),4.5}, + [3] = {CGeoPoint(60, 60),4.5}, + [4] = {CGeoPoint(120,60),6}, + [5] = {CGeoPoint(60, 60),4.5}, + [6] = {CGeoPoint(60, 60),4.5}, + [7] = {CGeoPoint(60, 60),4.5}, + [8] = {CGeoPoint(60, 60),4.5}, + [9] = {CGeoPoint(60, 60),4.5}, + [10] = {CGeoPoint(60, 60),4.5}, + [11] = {CGeoPoint(60, 60),4.5}, + [12] = {CGeoPoint(60, 60),4.5}, + [14] = {CGeoPoint(60, 60),4.5}, + [15] = {CGeoPoint(60, 60),4.5}, + [16] = {CGeoPoint(60, 60),4.5}, +} +rotTableTWO = { + -- [num] = {minist,maxDist,minPower, maxPower, ShootPower,chipPower} + [0] = {CGeoPoint(60, 60),4.5}, + [1] = {CGeoPoint(60, 60),4.5}, + [2] = {CGeoPoint(60, 60),4.5}, + [3] = {CGeoPoint(120, 60),4.5}, + [4] = {CGeoPoint(120,60),4.5}, + [5] = {CGeoPoint(60, 60),4.5}, + [6] = {CGeoPoint(60, 60),4.5}, + [7] = {CGeoPoint(60, 60),4.5}, + [8] = {CGeoPoint(60, 60),4.5}, + [9] = {CGeoPoint(60, 60),4.5}, + [10] = {CGeoPoint(60, 60),4.5}, + [11] = {CGeoPoint(60, 60),4.5}, + [12] = {CGeoPoint(60, 60),4.5}, + [14] = {CGeoPoint(60, 60),4.5}, + [15] = {CGeoPoint(60, 60),4.5}, + [16] = {CGeoPoint(60, 60),4.5}, +} +rotTable = Team == "ONE" and rotTableONE or rotTableTWO +rotVel = function(num) + local turnVel = rotTable[num][2] if shootPos:x() == pitchLength / 2 then - return 6.5 + return turnVel + 0.8 else - return 4.5 + return turnVel end -end --旋转速度 -local rotCompensate_Reality = -0.015 --旋转补偿 +end + +rotPos = function(num) + + return rotTable[player.num(num)][1] +end + + +rotCompensateTable = { + -- [num] = {minist,maxDist,minPower, maxPower, ShootPower,chipPower} + [0] = {-0.015}, + [1] = {-0.015}, + [2] = {-0.015}, + [3] = {-0.015}, + [4] = {-0.015}, + [5] = {-0.015}, + [6] = {-0.015}, + [7] = {-0.015}, + [8] = {-0.015}, + [9] = {-0.015}, + [10] = {-0.015}, + [11] = {-0.015}, + [12] = {-0.015}, + [14] = {-0.015}, + [15] = {-0.015}, + [16] = {-0.015}, +} +local rotCompensate_Reality = function(num) + return rotCompensateTable[player.num(num)][1] +end-- -0.015 --旋转补偿 -----------------------------------------------| -- Tick固定匹配参数 --| -----------------------------------------------| @@ -112,7 +180,7 @@ markingPosRate2 = 1 / 10 -- defend参数 --| -----------------------------------------------| -- defender 模式, 0-盯球,1-盯人 -defenderMode = 0 +defenderMode = 1 defenderShootMode = function() return 1 end -- 1 flat 2 chip defenderBuf = playerRadius * 1.5 @@ -135,9 +203,9 @@ goalieAimDirRadius = pitchLength / 4 -- enemyAimBuf = goalRadius enemyAimBuf = goalWidth -- goalie 移动的线(mode-0) -goalieMoveLine = CGeoSegment(CGeoPoint:new_local(-pitchLength / 2 + playerRadius, -INF), +goalieMoveLine = CGeoSegment(CGeoPoint:new_local(-pitchLength / 2 + playerRadius*1, -INF), CGeoPoint:new_local(-pitchLength / 2 + playerRadius, INF)) -goalieMoveX = -pitchLength / 2 + playerRadius +goalieMoveX = -pitchLength / 2 + playerRadius*1 -- goalie 移动的半径(mode-1) goalieRadius = goalRadius - goalieBuf -- goalie 刚吸到球后准备的时间 @@ -150,7 +218,7 @@ goalieDribblingFrame = 200 goalieDribblingA = 1000 -- goalie 要踢向的点 -- goalieTargetPos = CGeoPoint(param.pitchLength / 2, param.pitchWidth / 2) -- 对面的点 -goalieTargetPos = CGeoPoint(-3300, -3000) -- 己方点(测试用) +goalieTargetPos = CGeoPoint(2000, 0) -- 己方点(测试用) -- 当截球点离goalie非常近的时候就会直接拦球 goalieCatchBuf = goalieBuf*2 @@ -182,7 +250,11 @@ FIT_PLAYER_POS_Y = pitchWidth / 2 - 200 ------------------------------------------- -- 方便实物,仿真的值互换 因为因为仿真的值是固定的 V_DECAY_RATE = isReality and V_DECAY_RATE_Reality or 2100 -rotCompensate = isReality and rotCompensate_Reality or 0.05 +rotCompensate = function(num) + +return isReality and rotCompensate_Reality(num) or 0.05 + +end shootError = isReality and shootError_Reality or 8 ------------------------------------------- --- 定位球配置 diff --git a/ZBin/lua_scripts/worldmodel/task.lua b/ZBin/lua_scripts/worldmodel/task.lua index 4de8b08..d5645a2 100644 --- a/ZBin/lua_scripts/worldmodel/task.lua +++ b/ZBin/lua_scripts/worldmodel/task.lua @@ -129,16 +129,16 @@ function getball_dribbling(role) return function() local idir = player.toBallDir(role) local p = ball.pos() + Utils.Polar2Vector(-10,idir) - local endVel = Utils.Polar2Vector(ball.velMod() + 100,idir) + local endVel = Utils.Polar2Vector(ball.velMod() + 300,idir) local toballDir = math.abs((ball.pos() - player.rawPos(role)):dir()) local playerDir = math.abs(player.dir(role)) local Subdir = math.abs(Utils.angleDiff(toballDir,playerDir) * 180/math.pi) local iflag = flag.dribbling + flag.allow_dss local DSS_FLAG = bit:_or(flag.allow_dss, flag.dodge_ball) - if Subdir > 15 and player.toBallDist(role) < 150 then + if Subdir > 30 then iflag = DSS_FLAG else - iflag = flag.dribbling + flag.allow_dss + iflag = flag.dribbling end local mexe, mpos = GoCmuRush { pos = p, dir = idir, acc = a, flag = iflag, rec = r, vel = endVel, speed = s, force_manual = force_manual } return { mexe, mpos } @@ -280,10 +280,10 @@ playerPowerTWO = { -- [num] = {minist,maxDist,minPower, maxPower, ShootPower,chipPower} [0] = {minDist_Power,maxDist_Power,200,330,400,7000}, [1] = {minDist_Power,maxDist_Power,120,330,315,7000},-- 可以挑球 ,吸球还行 - [2] = {minDist_Power,maxDist_Power,120,330,315,7000}, - [3] = {minDist_Power,maxDist_Power,120,330,315,7000}, - [4] = {minDist_Power,maxDist_Power,120,330,315,7000}, - [5] = {minDist_Power,maxDist_Power,120,330,315,7000}, + [2] = {minDist_Power,maxDist_Power,135,330,315,7000}, + [3] = {minDist_Power,maxDist_Power,2000,5000,5000,5000}, + [4] = {minDist_Power,maxDist_Power,2000,5000,4700,5000}, + [5] = {minDist_Power,maxDist_Power,130,330,315,7000}, [6] = {minDist_Power,maxDist_Power,120,330,450,7000}, -- 带球超强 ,挑球一般 [7] = {minDist_Power,maxDist_Power,120,330,315,7000}, -- 红外偶尔有问题 [8] = {minDist_Power,maxDist_Power,120,330,315,7000}, @@ -331,7 +331,6 @@ function power(p, num,shootFlag) res = playerPower[playerNum][5] end ---仿真的力度 - if not param.isReality then local SimulationRate = 15 res = res * SimulationRate @@ -339,6 +338,7 @@ function power(p, num,shootFlag) res = 3500 end end + debugEngine:gui_debug_msg(CGeoPoint(-param.pitchLength / 2,param.pitchWidth / 2), "POWER:"..res .." TargetPos: " .. p1:x()) return res end end @@ -459,7 +459,7 @@ function TurnToPointV2(role, p, speed) end if speed == nil then - speed = param.rotVel + speed = param.rotVel(role) end debugEngine:gui_debug_x(p1,6) @@ -479,7 +479,7 @@ function TurnToPointV2(role, p, speed) -- 顺时针旋转 -- debugEngine:gui_debug_msg(CGeoPoint(1000, 1000), "顺时针".. subPlayerBallToTargetDir) - local ipos = CGeoPoint(param.rotPos:x(), param.rotPos:y() * -1) --自身相对坐标 旋转 + local ipos = CGeoPoint(param.rotPos(player.num(role)):x(), param.rotPos(player.num(role)):y() * -1) --自身相对坐标 旋转 local ivel = speed * -1 local mexe, mpos = CircleRun {pos = ipos , vel = ivel} return { mexe, mpos } @@ -488,7 +488,7 @@ function TurnToPointV2(role, p, speed) -- debugEngine:gui_debug_msg(CGeoPoint(1000, 1000), "逆时针") -- debugEngine:gui_debug_msg(CGeoPoint(1000, 1000), "逆时针".. subPlayerBallToTargetDir) - local ipos = param.rotPos --自身相对坐标 旋转 + local ipos = param.rotPos(player.num(role)) --自身相对坐标 旋转 local ivel = speed local mexe, mpos = CircleRun {pos = ipos , vel = ivel} @@ -889,7 +889,7 @@ end -- 尽量避免撞车 function eschewingOurCar(role, targetPos, ourBuf, enemyBuf) if ourBuf == nil then - ourBuf = param.playerRadius*3 + ourBuf = param.playerRadius*5 end if enemyBuf == nil then From 758bb120a1640cdae5c25091c39dc6ab52765e73 Mon Sep 17 00:00:00 2001 From: Umbrella167 <1670187757@qq.com> Date: Fri, 17 May 2024 00:13:02 +0800 Subject: [PATCH 2/2] our_p --- Core/HuRocos-2024/play/HALT.lua | 10 ++++------ Core/HuRocos-2024/play/NORMALPLAYV2.lua | 4 ++-- Core/HuRocos-2024/play/Nor_Shoot.lua | 5 +++-- Core/HuRocos-2024/play/STOP.lua | 13 +++++++------ Core/HuRocos-2024/play/our_KickOff.lua | 19 ++++++------------- Core/tactics/play/TestCircleRun.lua | 1 - ZBin/lua_scripts/worldmodel/param.lua | 10 +++++----- ZBin/lua_scripts/worldmodel/task.lua | 8 ++++---- 8 files changed, 31 insertions(+), 39 deletions(-) diff --git a/Core/HuRocos-2024/play/HALT.lua b/Core/HuRocos-2024/play/HALT.lua index d0dce3e..c185e7d 100644 --- a/Core/HuRocos-2024/play/HALT.lua +++ b/Core/HuRocos-2024/play/HALT.lua @@ -6,15 +6,13 @@ switch = function() end, ["halt"] = { - ["Leader"] = task.stop(), + ["Kicker"] = task.stop(), ["Special"] = task.stop(), ["Assister"] = task.stop(), - ["Defender"] = task.stop(), - ["Middle"] = task.stop(), - ["Center"] = task.stop(), - ["Breaker"] = task.stop(), + ["Center"] = task.stop(), + ["Defender"] = task.stop(), ["Goalie"] = task.stop(), - match = "[LSADMCB]" + match = "[AKSC]{DG}" }, name = "HALT", diff --git a/Core/HuRocos-2024/play/NORMALPLAYV2.lua b/Core/HuRocos-2024/play/NORMALPLAYV2.lua index 02e455c..d6a61d6 100644 --- a/Core/HuRocos-2024/play/NORMALPLAYV2.lua +++ b/Core/HuRocos-2024/play/NORMALPLAYV2.lua @@ -202,7 +202,7 @@ local getState = function () resultState = "Getball" end - if Utils.InExclusionZone(ball.pos(), param.dribblingExclusionDist, "all") and ball_rights ~= 0 and resultState ~= "ShootPoint" then + if Utils.InExclusionZone(ball.pos(), param.dribblingExclusionDist, "all") and ball_rights ~= 0 then resultState = "dribbling" end @@ -326,7 +326,7 @@ firstState = "Init", switch = function() UpdataTickMessage(our_goalie_num,defend_num1,defend_num2) local State = getState() - if bufcnt(true,30) or State == "Getball" then + if bufcnt(true,35)then -- or State == "Getball" return State end diff --git a/Core/HuRocos-2024/play/Nor_Shoot.lua b/Core/HuRocos-2024/play/Nor_Shoot.lua index 45c07da..c0dcd81 100644 --- a/Core/HuRocos-2024/play/Nor_Shoot.lua +++ b/Core/HuRocos-2024/play/Nor_Shoot.lua @@ -106,13 +106,14 @@ firstState = "Init", debugMesg() if(bufcnt(player.myinfraredCount("Assister") < 1,1)) then return "getball" - end + end if(task.playerDirToPointDirSub("Assister",resShootPos) > param.shootError) then return "getball" end + end, - Assister = task.ShootdotV2(function() return resShootPos end, param.shootError, kick.flat ), + Assister = task.ShootdotV2(function() return resShootPos end, param.shootError,function() return (player.num("Assister") == 3 and param.Team == "TWO") and kick.chip() or kick.flat() end), match = "{A}" }, diff --git a/Core/HuRocos-2024/play/STOP.lua b/Core/HuRocos-2024/play/STOP.lua index cc714a3..135881c 100644 --- a/Core/HuRocos-2024/play/STOP.lua +++ b/Core/HuRocos-2024/play/STOP.lua @@ -26,6 +26,7 @@ local defendpos = { CGeoPoint(-3300,-850), } +local a = 1800 local DSS_FLAG = bit:_or(flag.allow_dss, flag.dodge_ball) gPlayTable.CreatePlay { @@ -38,13 +39,13 @@ firstState = "start", return "exit" end end, - Kicker = task.goCmuRush(middlePos,dir.playerToBall,DSS_FLAG), - Assister = task.goCmuRush(leftPos,dir.playerToBall,DSS_FLAG), - Special = task.goCmuRush(rightPos,dir.playerToBall,DSS_FLAG), - Tier = task.goCmuRush(defendpos[3],dir.playerToBall,DSS_FLAG), - Defender = task.goCmuRush(defendpos[2],dir.playerToBall,DSS_FLAG), + Kicker = task.goCmuRush(middlePos,dir.playerToBall,a,DSS_FLAG), + Assister = task.goCmuRush(leftPos,dir.playerToBall,a,DSS_FLAG), + Special = task.goCmuRush(rightPos,dir.playerToBall,a,DSS_FLAG), + Center = task.goCmuRush(defendpos[3],dir.playerToBall,a,DSS_FLAG), + Defender = task.goCmuRush(defendpos[2],dir.playerToBall,a,DSS_FLAG), Goalie = task.goCmuRush(defendpos[1],dir.playerToBall), - match = "[AKS]{TDG}" + match = "[AKSC]{DG}" }, name = "STOP", diff --git a/Core/HuRocos-2024/play/our_KickOff.lua b/Core/HuRocos-2024/play/our_KickOff.lua index 1511159..1862346 100644 --- a/Core/HuRocos-2024/play/our_KickOff.lua +++ b/Core/HuRocos-2024/play/our_KickOff.lua @@ -112,7 +112,6 @@ ballRights = -1 shoot_pos = CGeoPoint:new_local(param.pitchLength / 2,0) -- 被传球机器人 pass_player_num = 0 - -- touch power touchPower = 4000 @@ -188,19 +187,17 @@ firstState = "ready", Assister = task.goCmuRush(p1, Dir_ball("Assister"),_,DSS_FLAG), Special = task.goCmuRush(p3, Dir_ball("Special"),_,DSS_FLAG), Kicker = task.goCmuRush(p2, Dir_ball("Kicker"),_,DSS_FLAG), - Tier = task.goCmuRush(p7, Dir_ball("Tier"),_,DSS_FLAG), + Center = task.goCmuRush(p7, Dir_ball("Center"),_,DSS_FLAG), Defender = task.goCmuRush(p6, Dir_ball("Defender"),_,DSS_FLAG), Goalie = task.goalie("Goalie"), - match = "[ASK]{TDG}" + match = "[ASKC]{DG}" }, ["OtherRunPos"] = { switch = function () - - if GlobalMessage.Tick().ball.rights == -1 then + if GlobalMessage.Tick().ball.rights == -1 then return "exit" end - if(player.kickBall("Assister")) then return "SpecialTouch" end @@ -208,14 +205,13 @@ firstState = "ready", Assister = task.Shootdot("Assister",runPos_Special(-400), 5, kick.flat), Special = task.goCmuRush(runPos_Special(-400), Dir_ball("Special"), a, f, r, v), Kicker = task.goCmuRush(runPos_Kicker(-400), Dir_ball("Kicker"), a, f, r, v), - -- Tier = task.Shootdot("Tier",playerPos("Special"), shootKp, 5, kick.flat), - -- Defender = task.defender_defence("Defender"), Goalie = task.goalie("Goalie"), - match = "{ASKTDG}" + match = "[ASKC]{DG}" + }, ["SpecialTouch"] = { switch = function () - if GlobalMessage.Tick().ball.rights == -1 then + if GlobalMessage.Tick().ball.rights == -1 then return "exit" end if(player.kickBall("Special")) then @@ -225,8 +221,6 @@ firstState = "ready", Assister = task.goCmuRush(runPos_Assister(-400), Dir_ball("Assister"), a, DSS_FLAG, r, v), Special = task.touchKick(runPos_Kicker(0), false, param.shootKp, kick.flat), Kicker = task.goCmuRush(runPos_Kicker(-400), Dir_ball("Kicker"), a, f, r, v), - -- Tier = task.defender_defence("Tier"), - -- Defender = task.defender_defence("Defender"), Goalie = task.goalie("Goalie"), match = "{ASKTDG}" }, @@ -234,7 +228,6 @@ firstState = "ready", ["KickerTouch"] = { switch = function () - if GlobalMessage.Tick().ball.rights == -1 then return "exit" end diff --git a/Core/tactics/play/TestCircleRun.lua b/Core/tactics/play/TestCircleRun.lua index 885cae4..8b2078a 100644 --- a/Core/tactics/play/TestCircleRun.lua +++ b/Core/tactics/play/TestCircleRun.lua @@ -11,7 +11,6 @@ end local rotNewPos = function() - end diff --git a/ZBin/lua_scripts/worldmodel/param.lua b/ZBin/lua_scripts/worldmodel/param.lua index 142a0a0..74bd02f 100644 --- a/ZBin/lua_scripts/worldmodel/param.lua +++ b/ZBin/lua_scripts/worldmodel/param.lua @@ -42,7 +42,7 @@ ourButtomGoalPos = CGeoPoint:new_local(-pitchLength / 2, -goalRadius) penaltyMiddleLine = CGeoSegment(ourGoalPos, ourGoalPos + Utils.Polar2Vector(penaltyDepth, 0)) -- 是否为真实场地 -isReality = true +isReality = false Team = "TWO" -- Team = "TWO" allowTouch = false -- 是否开启touch canTouchAngle = 45 -- 可以touch的角度f @@ -129,7 +129,7 @@ rotTable = Team == "ONE" and rotTableONE or rotTableTWO rotVel = function(num) local turnVel = rotTable[num][2] if shootPos:x() == pitchLength / 2 then - return turnVel + 0.8 + return turnVel + 0.2 else return turnVel end @@ -146,9 +146,9 @@ rotCompensateTable = { [0] = {-0.015}, [1] = {-0.015}, [2] = {-0.015}, - [3] = {-0.015}, - [4] = {-0.015}, - [5] = {-0.015}, + [3] = {0}, + [4] = {0}, + [5] = {0}, [6] = {-0.015}, [7] = {-0.015}, [8] = {-0.015}, diff --git a/ZBin/lua_scripts/worldmodel/task.lua b/ZBin/lua_scripts/worldmodel/task.lua index be2a230..4ac79bf 100644 --- a/ZBin/lua_scripts/worldmodel/task.lua +++ b/ZBin/lua_scripts/worldmodel/task.lua @@ -260,7 +260,7 @@ playerPowerONE = -- [num] = {minist,maxDist,minPower, maxPower, ShootPower,chipPower} [0] = {minDist_Power,maxDist_Power,200,330,400,7000}, [1] = {minDist_Power,maxDist_Power,120,330,350,7000}, - [2] = {minDist_Power,maxDist_Power,135,330,350,7000}, + [2] = {minDist_Power,maxDist_Power,135,330,350,7000}, -- 吸球弱,可以挑球 [3] = {minDist_Power,maxDist_Power,135,330,350,7000}, [4] = {minDist_Power,maxDist_Power,135,330,350,7000}, [5] = {minDist_Power,maxDist_Power,135,330,350,7000}, @@ -281,9 +281,9 @@ playerPowerTWO = { [0] = {minDist_Power,maxDist_Power,200,330,400,7000}, [1] = {minDist_Power,maxDist_Power,120,330,315,7000},-- 可以挑球 ,吸球还行 [2] = {minDist_Power,maxDist_Power,135,330,315,7000}, - [3] = {minDist_Power,maxDist_Power,2000,5000,5000,5000}, - [4] = {minDist_Power,maxDist_Power,2000,5000,4700,5000}, - [5] = {minDist_Power,maxDist_Power,130,330,315,7000}, + [3] = {minDist_Power,maxDist_Power,330,750,1000,5000}, + [4] = {minDist_Power,maxDist_Power,330,750,1000,5000}, + [5] = {minDist_Power,maxDist_Power,165,340,450,7000}, [6] = {minDist_Power,maxDist_Power,120,330,450,7000}, -- 带球超强 ,挑球一般 [7] = {minDist_Power,maxDist_Power,120,330,315,7000}, -- 红外偶尔有问题 [8] = {minDist_Power,maxDist_Power,120,330,315,7000},