AI: Nerf piano rating; AI will now only use it if it expects huge damage
authorWuzzy <Wuzzy2@mail.ru>
Mon, 12 Oct 2020 21:38:37 +0200
changeset 15771 82fd124e6512
parent 15770 ff8bd08f7d98
child 15772 036263d63b05
AI: Nerf piano rating; AI will now only use it if it expects huge damage
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Mon Oct 12 01:25:04 2020 +0200
+++ b/hedgewars/uAIAmmoTests.pas	Mon Oct 12 21:38:37 2020 +0200
@@ -1967,7 +1967,8 @@
 end;
 
 function TestPiano(Me: PGear; Targ: TTarget; Level: LongInt; var ap: TAttackParams; Flags: LongWord): LongInt;
-const BOUNCES = 5;
+// TODO: Test all 5 bounces
+const BOUNCES = 1; // we only test 1 bounce to avoid the rating getting excessively high
 var X, Y: real;
     dmg: array[0..BOUNCES-1] of LongInt;
     i, e, rate, valueResult, targetY: LongInt;
@@ -2014,6 +2015,8 @@
 
         for e:= -1 to 1 do
             begin
+            // TODO: RateExplosion should remember hogs that already died in the simulation;
+            // because currently, dead hogs might still be counted for damage
             rate:= RateExplosion(Me, trunc(X) + 30*e, trunc(Y)+40, 161, afIgnoreMe);
             if rate <> BadTurn then
                 dmg[i]:= dmg[i] + rate;