diff --git a/33.jar b/33.jar new file mode 100644 index 0000000..dd56794 Binary files /dev/null and b/33.jar differ diff --git a/core/src/MyStrategy.java b/core/src/MyStrategy.java index e729a6c..55b6ca9 100755 --- a/core/src/MyStrategy.java +++ b/core/src/MyStrategy.java @@ -228,7 +228,6 @@ private boolean scaleOperations(VehicleGroupInfo myGroup) { return true; } - } } @@ -464,8 +463,13 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin addToArray(plainArray, enemyTanks, range, .1f); addToArray(plainArray, enemyArrvs, range, .1f); - subFromArray(plainArray, enemyTanks, (game.getIfvAerialAttackRange() + 10) / cellSize, 1.4f, -1); - subFromArray(plainArray, enemyArrvs, (game.getIfvAerialAttackRange() + 10) / cellSize, 1.4f, -1); + if (enemyFighters.isEmpty() && enemyHelics.isEmpty()) { + subFromArray(plainArray, enemyTanks, (game.getFighterVisionRange() - 15) / cellSize, 1.4f, -1); + subFromArray(plainArray, enemyArrvs, (game.getFighterVisionRange() - 15) / cellSize, 1.4f, -1); + } else { + subFromArray(plainArray, enemyTanks, (game.getIfvAerialAttackRange() + 10) / cellSize, 1.4f, -1); + subFromArray(plainArray, enemyArrvs, (game.getIfvAerialAttackRange() + 10) / cellSize, 1.4f, -1); + } } } @@ -473,7 +477,7 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin { Set> ifvCount = getUnitsCount(true).get(IFV).entrySet(); - double range = (game.getIfvAerialAttackRange() * 1.8) / cellSize; + double range = (game.getIfvAerialAttackRange() * 2.4) / cellSize; int factor = 6; @@ -561,7 +565,7 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin } if (!disableFear) { - subFromArray(plainArray, enemyIfv, (game.getHelicopterAerialAttackRange() + 30) / cellSize, 3.2f, minValForContra); + subFromArray(plainArray, enemyIfv, (game.getHelicopterAerialAttackRange() * 2.4) / cellSize, 3.2f, minValForContra); subFromArray(plainArray, enemyHelics, (game.getIfvAerialAttackRange() + 10) / cellSize, 1.4f, minValForContra); } @@ -1509,19 +1513,24 @@ private boolean tryPickNuclearTarget() { log(Utils.LOG_NUCLEAR_STRIKE + " start " + max); }); - delayedMoves.addFirst(move1 -> { - move.setAction(ActionType.MOVE); - move.setX(0); - move.setY(0); - log(Utils.LOG_NUCLEAR_STRIKE + " stop unit " + max); - }); + double startDistance = max.myVehicle.getPos(0).getDistanceTo(max.target); + double nextTickDistance = max.myVehicle.getPos(1).getDistanceTo(max.target); - delayedMoves.addFirst(move1 -> { - clearAndSelectOneUnit(max, move1, max.myVehicle); //TODO select group + if (nextTickDistance > startDistance) { //stop right there + delayedMoves.addFirst(move1 -> { + move.setAction(ActionType.MOVE); + move.setX(0); + move.setY(0); + log(Utils.LOG_NUCLEAR_STRIKE + " stop unit " + max); + }); - scheduledStrike.createdAt = world.getTickIndex(); - log(Utils.LOG_NUCLEAR_STRIKE + " select unit " + max); - }); + delayedMoves.addFirst(move1 -> { + clearAndSelectOneUnit(max, move1, max.myVehicle); //TODO select group + + scheduledStrike.createdAt = world.getTickIndex(); + log(Utils.LOG_NUCLEAR_STRIKE + " select unit " + max); + }); + } return true; } diff --git a/core/src/NuclearStrike.java b/core/src/NuclearStrike.java index 9a52102..98aef80 100644 --- a/core/src/NuclearStrike.java +++ b/core/src/NuclearStrike.java @@ -47,9 +47,17 @@ private void calcPredicted(VehicleWrapper myVehicle, VehicleWrapper target, MySt .mapToDouble(veh -> { double distanceTo; if (actualTarget != null) { - distanceTo = veh.getPos(PREDICTION_TICK).getDistanceTo(actualTarget); + if (veh.isEnemy) { + distanceTo = veh.getPos(0).getDistanceTo(actualTarget); + } else { + distanceTo = veh.getPos(30).getDistanceTo(actualTarget); + } } else { - distanceTo = veh.getDistanceToPredictBoth(target, PREDICTION_TICK); + if (veh.isEnemy) { + distanceTo = veh.getDistanceToPredictBoth(target, 0); + } else { + distanceTo = veh.getPos(30).getDistanceTo(target); + } } if (distanceTo > maxRadius) { @@ -100,9 +108,7 @@ public static NuclearStrike getMaxDmg(MyStrategy mys, int minNuclearDmg) { .filter(myVehicle -> myVehicle.getDistanceToPredictTarget(v, PREDICTION_TICK) < myVehicle.getActualVisionRange()) .map(myVehicle -> new NuclearStrike(myVehicle, v, mys))) - .filter(nuclearStrike -> { - return nuclearStrike.predictedDmg > minNuclearDmg; - }) + .filter(nuclearStrike -> nuclearStrike.predictedDmg > minNuclearDmg) .max(Comparator.comparingDouble(o -> o.predictedDmg)) .orElse(null); } diff --git a/core/src/Runner.java b/core/src/Runner.java index 1536a64..c336cc9 100755 --- a/core/src/Runner.java +++ b/core/src/Runner.java @@ -47,7 +47,7 @@ public static void main(String[] args) throws IOException { //runProc(null, true, "java", "-cp", "23.5.jar", "Runner"); //runProc(null, true, "java", "-cp", "24.jar", "Runner"); //runProc(null, true, "java", "-cp", "25.jar", "Runner"); - runProc(null, true, "java", "-cp", "32.jar", "Runner"); + runProc(null, true, "java", "-cp", "33.jar", "Runner"); } }).start(); new Runner(new String[]{"127.0.0.1", hasArgs ? "31001" : "31002", "0000000000000000"}).run(); diff --git a/lr/local-runner-sync.default.properties b/lr/local-runner-sync.default.properties index f968254..b057128 100755 --- a/lr/local-runner-sync.default.properties +++ b/lr/local-runner-sync.default.properties @@ -66,7 +66,8 @@ fog-of-war-quality=1 #seed=539675860738317 #seed=541562105365045 #seed=560101143593578 -seed=562820576579634 +#seed=562820576579634 +seed= # Путь к каталогу с плагинами или пустая строка для работы без плагинов. # Необходимо скомпилировать плагин, чтобы он загрузился игровым симулятором.