# HG changeset patch # User unc0rr # Date 1343407502 -14400 # Node ID 823bd65ef09587f764d7823de25ff9d0a7e737c4 # Parent 891209020113c5830fb96b915a10b5fa4d520404# Parent 92bdcd69bf2a6761df26745907ab2fac64f4a5c2 merge diff -r 891209020113 -r 823bd65ef095 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Fri Jul 27 10:47:23 2012 -0400 +++ b/hedgewars/uAI.pas Fri Jul 27 20:45:02 2012 +0400 @@ -178,9 +178,12 @@ begin AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0); AddAction(BestActions, aia_attack, aim_release, 1, 0, 0); - - AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0); - AddAction(BestActions, aia_Down, aim_release, 32, 0, 0); + + if abs(ap.Angle) > 32 then + begin + AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0); + AddAction(BestActions, aia_Down, aim_release, 32, 0, 0); + end; AddAction(BestActions, aia_waitAngle, ap.Angle, 250, 0, 0); AddAction(BestActions, aia_attack, aim_push, 1, 0, 0); @@ -274,7 +277,8 @@ break; if (BotLevel < 5) and (GoInfo.JumpType = jmpHJump) then // hjump support - if Push(ticks, Actions, AltMe, Me^.Message) then + // check if we could go backwards and maybe ljump over a gap after this hjump + if Push(ticks, Actions, AltMe, Me^.Message xor 3) then begin with Stack.States[Pred(Stack.Count)] do begin @@ -291,9 +295,8 @@ else AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0); end; - - // check if we could go backwards and maybe ljump over a gap after this hjump - Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message xor 3) + // but first check walking forward + Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message) end; if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support begin diff -r 891209020113 -r 823bd65ef095 hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Fri Jul 27 10:47:23 2012 -0400 +++ b/hedgewars/uAIAmmoTests.pas Fri Jul 27 20:45:02 2012 +0400 @@ -361,12 +361,12 @@ t: LongInt; begin valueResult:= BadTurn; -TestTime:= 0; +TestTime:= 500; ap.ExplR:= 0; meX:= hwFloat2Float(Me^.X); meY:= hwFloat2Float(Me^.Y); repeat - inc(TestTime, 1000); + inc(TestTime, 900); // Try to overshoot slightly, seems to pay slightly better dividends in terms of hitting cluster if meX