Skip to content

Commit

Permalink
- tune action distance
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry committed Dec 14, 2017
1 parent c43aa76 commit 87ebed8
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
Binary file added 24.2.jar
Binary file not shown.
Binary file added 24.3.jar
Binary file not shown.
Binary file added 25.jar
Binary file not shown.
35 changes: 31 additions & 4 deletions core/src/MyStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public final class MyStrategy implements Strategy {
private static final boolean HELICS_WAIT_FOR_FIGHTES = true;
public static final int CAN_DISABLE_FEAR_SINCE_TICK = 9300;
public static final int CAN_DISABLE_FEAR_SINCE_COUNT = 490;
public static final int MAX_CELL_DISTANCE_OF_MOVE = 11 / 2;
public static final int MAX_SWITCH_COUNT = 400;
private static int constantId;

Expand Down Expand Up @@ -436,7 +435,7 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin

Set<Map.Entry<Point2D, Integer>> myHelic = myHelicsMap.entrySet();

double range = (GROUP_SIZE * 1.8) / cellSize;
double range = (GROUP_SIZE * 1.2) / cellSize;

int factor = 6;

Expand Down Expand Up @@ -1592,10 +1591,38 @@ private void schedulePotentialMoveToPoint(VehicleGroupInfo myGroup) {
int myY = averagePoint.getIntY();

Point2D bestChoice = null;
int half = MAX_CELL_DISTANCE_OF_MOVE;
if (myGroup.vehicleType == TANK || myGroup.vehicleType == IFV) {
int half = 3;
/* switch (myGroup.vehicleType) {
case ARRV:
half = 3;
break;
case FIGHTER:
half = 4;
break;
case HELICOPTER:
half = 4;
break;
case IFV:
half = 3;
break;
case TANK:
half = 3;
break;
}*/

long count = um.facilityById.values().stream().filter(v -> v.isMy() && v.f.getType() == CONTROL_CENTER).count();

if (myGroup.count > 20) {
half++;
half++;
} else if (myGroup.count > 13) {
half++;
} else if (count >= 2) {
half--;
} else if (myGroups.size() < 5) {
half--;
}

for (int x = myX - half; x <= myX + half; x++) {
for (int y = myY - half; y <= myY + half; y++) {
Point2D currentChoice = new Point2D(x, y);
Expand Down
2 changes: 1 addition & 1 deletion core/src/RewindClientWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void drawPP(VehicleGroupInfo myGroup) {

double root = root(delta, delta);

double squareMaxDistance = Math.pow(cellSize * (MyStrategy.MAX_CELL_DISTANCE_OF_MOVE + 3), 2);
double squareMaxDistance = Math.pow(cellSize * (6 + 3), 2);


for (int x = 0; x < cellsX; x++) {
Expand Down
3 changes: 2 additions & 1 deletion core/src/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public static void main(String[] args) throws IOException {
//runProc(null, true, "java", "-cp", "23.2.jar", "Runner");
//runProc(null, true, "java", "-cp", "23.4.jar", "Runner");
//runProc(null, true, "java", "-cp", "23.5.jar", "Runner");
runProc(null, true, "java", "-cp", "24.jar", "Runner");
//runProc(null, true, "java", "-cp", "24.jar", "Runner");
runProc(null, true, "java", "-cp", "25.jar", "Runner");
}
}).start();
new Runner(new String[]{"127.0.0.1", hasArgs ? "31001" : "31002", "0000000000000000"}).run();
Expand Down
4 changes: 2 additions & 2 deletions lr/local-runner-sync.default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ fog-of-war-quality=1
# генератора случайных чисел или пустая строка.
# Параметр в командной строке имеет больший приоритет.
#seed=51764284009692
#seed=536603617854755
seed=536603617854755
#seed=539675860738317
seed=
#seed=541562105365045

# Путь к каталогу с плагинами или пустая строка для работы без плагинов.
# Необходимо скомпилировать плагин, чтобы он загрузился игровым симулятором.
Expand Down

0 comments on commit 87ebed8

Please sign in to comment.