Open AI Championship

Quick start

Round 1: before start

Project

Sandbox

Round 1

Round 2

Finals

Recent comments

18 november 20:20: SladeThe wrote comment on post Repeater utility
18 november 19:45: Jeners wrote comment on post Local runner
18 november 19:42: dimir wrote comment on post Round 1
18 november 19:10: ykaland wrote comment on post Repeater utility
18 november 18:30: dimir wrote comment on post Round 1
18 november 17:21: tyamgin wrote comment on post Round 1
18 november 16:21: malinovsky239 wrote comment on post Round 1
18 november 16:10: tyamgin wrote comment on post Rules
18 november 12:10: doratio wrote comment on post Language packages
18 november 10:56: third112 wrote comment on post Language packages

VK Group

Telegram chat

 

We’ll show you how to join CodeWars in a few minutes.

Register

Of course, you need to register. We kindly ask all participants to provide accurate and complete information about yourself.

Download language pack

Download the package for your favorite programming language from the language packs page. We support C++, Java, C#, Pascal, Python 2 and 3, Ruby. Unzip the archive and open an existing project or create a new one from scratch. We have already prepared projects for some IDE. You may need to configure some paths.

Download Local runner

Local runner is a special version of game engine adapted for participants. Local runner gives you the opportunity to run a test games locally on your computer. Read more about it here.

Read the documentation

The official and complete rules are published in the Rules section, please read them. Some organizational aspects you can find in the descriptions of the Sandbox and stages of the championship (Round 1, Round 2, Finals).

Submit your strategy

You can submit you strategy here. Before the system will accept your strategy, it will be compiled and tested in a few short games. If everything is OK, your strategy will automatically start to participate in regular qualifying games in Sandbox. Carefully read the section “What you should pay attention to” for various aspects due to which your strategy can get the “Verification error” verdict. The total number of submissions are not restricted, however there are restrictions on too frequent submitting. Any attempt to destabilize the system will result in disqualification. You can write your strategy in an arbitrary number of files, you will only need to pack everything into a ZIP archive and send it. All files must be in root of archive. Unfortunately, creating custom packages in the Java strategy is unacceptable. Remember that in your starter pack you can change only the file MyStrategy.${ext} (where ${ext} — extension language you are using), and even if you change some other file and also add it to the archive, it will be replaced on standard (except for MyStrategy.h in C++).

What you should pay attention to

  • it is prohibited to interact with the network, file system and other resources, except for RAM and the current directory, violators will be disqualified;
  • total CPU time of your strategy process is limited (exact details you can find in the documentation);
  • the strategy process should not use more than 256 MB of RAM;
  • if your strategy exceeds the time or memory limit or crashes during the execution, it stops to participate in this game (however, your score points do not expire);
  • the strategy of each participant runs in a separate process.

Let’s write a simple strategy on Java

The simplest strategy is doing nothing and not moving (you can check it by sending this code to the system):

import model.*;

public final class MyStrategy implements Strategy {
    @Override
    public void move(Player me, World world, Game game, Move move) {
    }
}

Now let’s select all our vehicles and send them towards the enemy. The move method takes the following form:

public void move(Player me, World world, Game game, Move move) {
    if (world.getTickIndex() == 0) {
        move.setAction(ActionType.CLEAR_AND_SELECT);
        move.setRight(world.getWidth());
        move.setBottom(world.getHeight());
        return;
    }

    if (world.getTickIndex() == 1) {
        move.setAction(ActionType.MOVE);
        move.setX(world.getWidth() / 2.0D);
        move.setY(world.getHeight() / 2.0D);
    }
}

There is no inertia in the world of CodeWars, thus units can instantly change their speed. However, the position change of a vehicle of each type in one tick is limited by game constants. Your units will move a small distance every tick, until they move for a distance specified in the order, or until they get a new order. In the example above your strategy makes two moves for two ticks. This is acceptable, however the game simulator limits a number of moves in 60 ticks. All moves above a limit will be ignored.

Now let’s write more complicated code. We order our vehicles to attack a nearest visible enemy. If we can’t find an enemy, then just move to the center of the map. Try to understand by yourself, how the strategy works. The code contains detailed comments that will help you.

import model.*;

import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Stream;

@SuppressWarnings({"UnsecureRandomNumberGeneration", "FieldCanBeLocal", "unused", "OverlyLongMethod"})
public final class MyStrategy implements Strategy {
    /**
     * A map from vehicle type to target types ordered by effective damage descending.
     */
    private static final Map<VehicleType, VehicleType[]> preferredTargetTypesByVehicleType;

    static {
        preferredTargetTypesByVehicleType = new EnumMap<>(VehicleType.class);

        preferredTargetTypesByVehicleType.put(VehicleType.FIGHTER, new VehicleType[] {
                VehicleType.HELICOPTER, VehicleType.FIGHTER
        });

        preferredTargetTypesByVehicleType.put(VehicleType.HELICOPTER, new VehicleType[] {
                VehicleType.TANK, VehicleType.ARRV, VehicleType.HELICOPTER, VehicleType.IFV, VehicleType.FIGHTER
        });

        preferredTargetTypesByVehicleType.put(VehicleType.IFV, new VehicleType[] {
                VehicleType.HELICOPTER, VehicleType.ARRV, VehicleType.IFV, VehicleType.FIGHTER, VehicleType.TANK
        });

        preferredTargetTypesByVehicleType.put(VehicleType.TANK, new VehicleType[] {
                VehicleType.IFV, VehicleType.ARRV, VehicleType.TANK, VehicleType.FIGHTER, VehicleType.HELICOPTER
        });
    }

    private Random random;

    private TerrainType[][] terrainTypeByCellXY;
    private WeatherType[][] weatherTypeByCellXY;

    private Player me;
    private World world;
    private Game game;
    private Move move;

    private final Map<Long, Vehicle> vehicleById = new HashMap<>();
    private final Map<Long, Integer> updateTickByVehicleId = new HashMap<>();
    private final Queue<Consumer<Move>> delayedMoves = new ArrayDeque<>();

    /**
     * Main strategy method, controlling the vehicles.
     * The game engine calls this method once each time tick.
     *
     * @param me    the owner player of this strategy.
     * @param world the current world snapshot.
     * @param game  many game constants.
     * @param move  the object that encapsulates all strategy instructions.
     */
    @Override
    public void move(Player me, World world, Game game, Move move) {
        initializeStrategy(world, game);
        initializeTick(me, world, game, move);

        if (me.getRemainingActionCooldownTicks() > 0) {
            return;
        }

        if (executeDelayedMove()) {
            return;
        }

        move();

        executeDelayedMove();
    }

    /**
     * Initialize our strategy.
     * <p>
     * Usually you can use a constructor, but in this case we want to initialize the generator of random numbers
     * with a value obtained from the game engine.
     */
    private void initializeStrategy(World world, Game game) {
        if (random == null) {
            random = new Random(game.getRandomSeed());

            terrainTypeByCellXY = world.getTerrainByCellXY();
            weatherTypeByCellXY = world.getWeatherByCellXY();
        }
    }

    /**
     * Save all input data in the strategy fields for simpler access and actualize vehicle data.
     */
    private void initializeTick(Player me, World world, Game game, Move move) {
        this.me = me;
        this.world = world;
        this.game = game;
        this.move = move;

        for (Vehicle vehicle : world.getNewVehicles()) {
            vehicleById.put(vehicle.getId(), vehicle);
            updateTickByVehicleId.put(vehicle.getId(), world.getTickIndex());
        }

        for (VehicleUpdate vehicleUpdate : world.getVehicleUpdates()) {
            long vehicleId = vehicleUpdate.getId();

            if (vehicleUpdate.getDurability() == 0) {
                vehicleById.remove(vehicleId);
                updateTickByVehicleId.remove(vehicleId);
            } else {
                vehicleById.put(vehicleId, new Vehicle(vehicleById.get(vehicleId), vehicleUpdate));
                updateTickByVehicleId.put(vehicleId, world.getTickIndex());
            }
        }
    }

    /**
     * Take delayed move from queue and execute.
     *
     * @return {@code true} if and only if a delayed move has been found and executed.
     */
    private boolean executeDelayedMove() {
        Consumer<Move> delayedMove = delayedMoves.poll();
        if (delayedMove == null) {
            return false;
        }

        delayedMove.accept(move);
        return true;
    }

    /**
     * The core logic of our strategy.
     */
    private void move() {
        // Every 180 ticks ...
        if (world.getTickIndex() % 180 == 0) {
            // ... for each vehicle type ...
            for (VehicleType vehicleType : VehicleType.values()) {
                VehicleType[] targetTypes = preferredTargetTypesByVehicleType.get(vehicleType);

                // ... if it can attack ...
                if (targetTypes == null || targetTypes.length == 0) {
                    continue;
                }

                // ... find center of our formation ...
                double x = streamVehicles(
                        Ownership.ALLY, vehicleType
                ).mapToDouble(Vehicle::getX).average().orElse(Double.NaN);

                double y = streamVehicles(
                        Ownership.ALLY, vehicleType
                ).mapToDouble(Vehicle::getY).average().orElse(Double.NaN);

                // ... find center of enemy formation or center of the world ...
                double targetX = Arrays.stream(targetTypes).map(
                        targetType -> streamVehicles(
                                Ownership.ENEMY, targetType
                        ).mapToDouble(Vehicle::getX).average().orElse(Double.NaN)
                ).filter(Double::isFinite).findFirst().orElseGet(
                        () -> streamVehicles(
                                Ownership.ENEMY
                        ).mapToDouble(Vehicle::getX).average().orElse(world.getWidth() / 2.0D)
                );

                double targetY = Arrays.stream(targetTypes).map(
                        targetType -> streamVehicles(
                                Ownership.ENEMY, targetType
                        ).mapToDouble(Vehicle::getY).average().orElse(Double.NaN)
                ).filter(Double::isFinite).findFirst().orElseGet(
                        () -> streamVehicles(
                                Ownership.ENEMY
                        ).mapToDouble(Vehicle::getY).average().orElse(world.getHeight() / 2.0D)
                );

                // .. and add delayed moves to select and move our vehicles.
                if (!Double.isNaN(x) && !Double.isNaN(y)) {
                    delayedMoves.add(move -> {
                        move.setAction(ActionType.CLEAR_AND_SELECT);
                        move.setRight(world.getWidth());
                        move.setBottom(world.getHeight());
                        move.setVehicleType(vehicleType);
                    });

                    delayedMoves.add(move -> {
                        move.setAction(ActionType.MOVE);
                        move.setX(targetX - x);
                        move.setY(targetY - y);
                    });
                }
            }

            // Also find center of our ARRV formation ...
            double x = streamVehicles(
                    Ownership.ALLY, VehicleType.ARRV
            ).mapToDouble(Vehicle::getX).average().orElse(Double.NaN);

            double y = streamVehicles(
                    Ownership.ALLY, VehicleType.ARRV
            ).mapToDouble(Vehicle::getY).average().orElse(Double.NaN);

            // .. and send it to the center of the world.
            if (!Double.isNaN(x) && !Double.isNaN(y)) {
                delayedMoves.add(move -> {
                    move.setAction(ActionType.CLEAR_AND_SELECT);
                    move.setRight(world.getWidth());
                    move.setBottom(world.getHeight());
                    move.setVehicleType(VehicleType.ARRV);
                });

                delayedMoves.add(move -> {
                    move.setAction(ActionType.MOVE);
                    move.setX(world.getWidth() / 2.0D - x);
                    move.setY(world.getHeight() / 2.0D - y);
                });
            }

            return;
        }

        // If all our vehicles are stuck for 60 ticks ...
        if (streamVehicles(Ownership.ALLY).allMatch(
                vehicle -> world.getTickIndex() - updateTickByVehicleId.get(vehicle.getId()) > 60
        )) {
            // ... find center of our formation ...
            double x = streamVehicles(Ownership.ALLY).mapToDouble(Vehicle::getX).average().orElse(Double.NaN);
            double y = streamVehicles(Ownership.ALLY).mapToDouble(Vehicle::getY).average().orElse(Double.NaN);

            // ... and rotate it.
            if (!Double.isNaN(x) && !Double.isNaN(y)) {
                delayedMoves.add(move -> {
                    move.setAction(ActionType.CLEAR_AND_SELECT);
                    move.setRight(world.getWidth());
                    move.setBottom(world.getHeight());
                });

                delayedMoves.add(move -> {
                    move.setAction(ActionType.ROTATE);
                    move.setX(x);
                    move.setY(y);
                    move.setAngle(random.nextBoolean() ? StrictMath.PI : -StrictMath.PI);
                });
            }
        }
    }

    private Stream<Vehicle> streamVehicles(Ownership ownership, VehicleType vehicleType) {
        Stream<Vehicle> stream = vehicleById.values().stream();

        switch (ownership) {
            case ALLY:
                stream = stream.filter(vehicle -> vehicle.getPlayerId() == me.getId());
                break;
            case ENEMY:
                stream = stream.filter(vehicle -> vehicle.getPlayerId() != me.getId());
                break;
            default:
        }

        if (vehicleType != null) {
            stream = stream.filter(vehicle -> vehicle.getType() == vehicleType);
        }

        return stream;
    }

    private Stream<Vehicle> streamVehicles(Ownership ownership) {
        return streamVehicles(ownership, null);
    }

    private Stream<Vehicle> streamVehicles() {
        return streamVehicles(Ownership.ANY);
    }

    private enum Ownership {
        ANY,

        ALLY,

        ENEMY
    }
}

This is not the most effective strategy and its chance to win is very low, but this is only an example. Good luck!



amurushkin

amurushkin

ХНУРЭ (бывш. ХИРЭ, ХТУРЭ)

Powered by Yandex.Translate

so how to set the movement? using the coordinates or the relative displacement? if using the offset, why in the first case the strategy goes exactly to the middle of the screen and stops and does not continue movement?

Nov 7, 2017 11:47:24 PM
Dfire

Dfire

КРОК

Powered by Yandex.Translate

And you will guarantee the hash and equals to Unit and Vehicle ?

Nov 7, 2017 11:59:24 PM
serlis

serlis

Харьковский НУ им. Каразина

amurushkin

amurushkin

ХНУРЭ (бывш. ХИРЭ, ХТУРЭ)

Powered by Yandex.Translate

so how to set the movement? using the coordinates or the relative displacement? if using the offset, why in the first case the strategy goes exactly to the middle of the screen and stops and does not continue movement?

You specify the maximum offset (if you specify floor of the map, you once again reach the middle)

Nov 8, 2017 12:24:35 AM
Nemzs1337

Nemzs1337

Университет ИТМО

Powered by Yandex.Translate

And you can wonder what is the lack of a method to “Get all the equipment out of the fog of war”? It’s quite uncomfortable to work with technology updates

Nov 9, 2017 9:51:05 PM
GreenTea

GreenTea

Organization::ISDDesign

Nemzs1337

Nemzs1337

Университет ИТМО

Powered by Yandex.Translate

And you can wonder what is the lack of a method to “Get all the equipment out of the fog of war”? It’s quite uncomfortable to work with technology updates

A lot of equipment and to convey information about her, each tick would be costly. So we pass only the variable part of the state. You can do in the code to conduct the actual list of units and update it is not difficult to implement.

Nov 9, 2017 10:31:07 PM
tyamgin

tyamgin

Симферополь

Powered by Yandex.Translate

Do I understand correctly that you do not recommend to store model objects from the previous tick, but they also keep them in the map vehicleById?

Nov 9, 2017 11:15:04 PM
Jeners

Powered by Yandex.Translate

And why not implement the update of the array data units by means of API? Well, that is, to store data about objects in the body of a class automatically to add them there, well and update “I” ie in fact to realize that you want to implement from the participants, but at the same time that it was originally sewn into the API? Just not quite understandable movements in this direction

Nov 9, 2017 11:54:52 PM
GS_Aero

GS_Aero

ИП

amurushkin

amurushkin

ХНУРЭ (бывш. ХИРЭ, ХТУРЭ)

Powered by Yandex.Translate

so how to set the movement? using the coordinates or the relative displacement? if using the offset, why in the first case the strategy goes exactly to the middle of the screen and stops and does not continue movement?

Since is a vector, it will be offset by the length of the vector.

Nov 10, 2017 4:26:34 PM
GS_Aero

GS_Aero

ИП

GS_Aero

GS_Aero

ИП

Powered by Yandex.Translate

Since is a vector, it will be offset by the length of the vector.

Damn, not so. In the basic example specifies the vector: Move.setAction(ActionType::MOVE); Move.setX(MyWorld->getWidth() / 2.0); Move.setY(MyWorld->getHeight() / 2.0); Shifted by half the size of the map, i.e. to the middle.

Nov 10, 2017 4:50:17 PM
third112

Powered by Yandex.Translate

“Now let’s write a more complex code”. This is only the 2nd example in Java :( IMHO the manual it needs to be translated in all supported language packs, otherwise they will be at a disadvantage.

Nov 11, 2017 2:26:53 PM
mrsergkr

mrsergkr

КемГУ

Powered by Yandex.Translate

“Now let’s write a more complex code”. This is only the 2nd example in Java :( IMHO the manual it needs to be translated in all supported language packs, otherwise they will be at a disadvantage.

I spent an hour and a half to rewrite this strategy in c++. This despite the fact that my knowledge is almost none. Normal programmer will spend less time. So what about any inequality of the question.

Nov 11, 2017 5:43:32 PM
mrsergkr

mrsergkr

КемГУ

tyamgin

tyamgin

Симферополь

Powered by Yandex.Translate

Do I understand correctly that you do not recommend to store model objects from the previous tick, but they also keep them in the map vehicleById?

If I’m not mistaken, was talking about the Player objects, World, Game and Move.

Nov 11, 2017 5:47:29 PM
alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Powered by Yandex.Translate

Good people, help. Studying Java, it is impossible to sort the flow at least for the x coordinate. Confused to the comparator and lambda expressions. Show a simple example. Thank you

Nov 11, 2017 5:59:19 PM
third112
mrsergkr

mrsergkr

КемГУ

Powered by Yandex.Translate

I spent an hour and a half to rewrite this strategy in c++. This despite the fact that my knowledge is almost none. Normal programmer will spend less time. So what about any inequality of the question.

If You have no knowledge, then why do You think that translated right?

Nov 11, 2017 6:24:15 PM
alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Powered by Yandex.Translate

Good people, help. Studying Java, it is impossible to sort the flow at least for the x coordinate. Confused to the comparator and lambda expressions. Show a simple example. Thank you

seems clear stream.sorted(Comparator.comparing(Vehicle::getX))

Nov 11, 2017 6:38:30 PM
Dimon777

Dimon777

АО ЦКБА

Powered by Yandex.Translate

When attempting to send even a test strategy (the what is written in the manual) is a compilation error: MyStrategy.cpp: In member function ‘virtual void MyStrategy::move(const model::Player&, const model::World&, const model::Game&, model::Move&)’: MyStrategy.cpp:10:16: error: ‘ACTION_CLEAR_AND_SELECT’ was not declared in this scope move.setAction(ACTION_CLEAR_AND_SELECT); ^~~~~~~~~~~~~~~~~~~~~~~ MyStrategy.cpp:16:16: error: ‘ACTION_MOVE’ was not declared in this scope move.setAction(ACTION_MOVE); ^~~~~~~~~~~)

Nov 11, 2017 6:46:23 PM
Sanda

Sanda

JetBrains

Dimon777

Dimon777

АО ЦКБА

Powered by Yandex.Translate

When attempting to send even a test strategy (the what is written in the manual) is a compilation error: MyStrategy.cpp: In member function ‘virtual void MyStrategy::move(const model::Player&, const model::World&, const model::Game&, model::Move&)’: MyStrategy.cpp:10:16: error: ‘ACTION_CLEAR_AND_SELECT’ was not declared in this scope move.setAction(ACTION_CLEAR_AND_SELECT); ^~~~~~~~~~~~~~~~~~~~~~~ MyStrategy.cpp:16:16: error: ‘ACTION_MOVE’ was not declared in this scope move.setAction(ACTION_MOVE); ^~~~~~~~~~~)

Try updating the language pack

Nov 11, 2017 6:54:21 PM
Dimon777

Dimon777

АО ЦКБА

Sanda

Sanda

JetBrains

Powered by Yandex.Translate

Try updating the language pack

a test strategy has not sent a file, and inserting code in the form…

Nov 11, 2017 6:57:00 PM
infsega

infsega

Align Technology Inc

Powered by Yandex.Translate

“Now let’s write a more complex code”. This is only the 2nd example in Java :( IMHO the manual it needs to be translated in all supported language packs, otherwise they will be at a disadvantage.

On the contrary, while rewriting the code for your language, understand what he does :)

Nov 11, 2017 6:57:24 PM
Dimon777

Dimon777

АО ЦКБА

Dimon777

Dimon777

АО ЦКБА

Powered by Yandex.Translate

a test strategy has not sent a file, and inserting code in the form…

thanks, I think figured out

Nov 11, 2017 7:04:32 PM
third112
infsega

infsega

Align Technology Inc

Powered by Yandex.Translate

On the contrary, while rewriting the code for your language, understand what he does :)

Means a disadvantage, because those who work in Java do not have to rewrite code.

Nov 11, 2017 8:05:19 PM
alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Powered by Yandex.Translate

A sense to rewrite it? With this code will not go far))

Nov 11, 2017 8:13:53 PM
AlexKol

AlexKol

BB

alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Powered by Yandex.Translate

A sense to rewrite it? With this code will not go far))

Pfft, 500 people will surely be with the strategy from the example)

Nov 11, 2017 8:14:59 PM
aabzac

aabzac

БГУИР

alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Powered by Yandex.Translate

A sense to rewrite it? With this code will not go far))

Well, I downloaded the code from the example and go out with him in 1 round probably will not be difficult )

Nov 11, 2017 9:43:11 PM
Borisov

Borisov

НИТУ "МИСиС"

Powered by Yandex.Translate

private final Queue<Consumer<Move>> delayedMoves = new ArrayDeque<>(); delayedMoves.add(move -> { move.setAction(ActionType.CLEAR_AND_SELECT); move.setRight(world.getWidth()); move.setBottom(world.getHeight()); move.setVehicleType(VehicleType.ARRV); }); Could you tell me how to implement the same in C++?

Nov 13, 2017 1:40:14 AM
SladeThe

SladeThe

Russian AI Cup Team

alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Powered by Yandex.Translate

seems clear stream.sorted(Comparator.comparing(Vehicle::getX))

In this case it is better to use a Comparator.comparingDouble because it works with the primitive double type, and Comparator.comparing converts the value to the object and compares the objects, which is much less effective.

Nov 13, 2017 2:22:21 AM
SladeThe

SladeThe

Russian AI Cup Team

Borisov

Borisov

НИТУ "МИСиС"

Powered by Yandex.Translate

private final Queue<Consumer> delayedMoves = new ArrayDeque<>(); delayedMoves.add(move -> { move.setAction(ActionType.CLEAR_AND_SELECT); move.setRight(world.getWidth()); move.setBottom(world.getHeight()); move.setVehicleType(VehicleType.ARRV); }); Could you tell me how to implement the same in C++?

Don’t know how to write exactly the same code, but you can create a new object Move and put it in place, and then take it out and copy all the fields.

Nov 13, 2017 2:24:13 AM
third112

Powered by Yandex.Translate

As a General Pascal to allocate 10 units, for example, tanks and send them to a point with given coordinates? Tried different - does not work. Maybe a bug? And you can send 10 tanks in 10 different points in 1 tick? The manual is clearly not enough examples of such elementary operations. The API description is too formal, with a lot of minor techniques and access to the main for a limited time is problematic.

Nov 13, 2017 10:46:41 AM
AlexKol

Powered by Yandex.Translate

As a General Pascal to allocate 10 units, for example, tanks and send them to a point with given coordinates? Tried different - does not work. Maybe a bug? And you can send 10 tanks in 10 different points in 1 tick? The manual is clearly not enough examples of such elementary operations. The API description is too formal, with a lot of minor techniques and access to the main for a limited time is problematic.

Take first things github latest packages and lokalbaner because I first took it and didn’t work.

Nov 13, 2017 10:48:30 AM
third112

Powered by Yandex.Translate

Take first things github latest packages and lokalbaner because I first took it and didn’t work.

Thanks, already took. But ideas about 10 tanks to no avail

Nov 13, 2017 10:51:51 AM
dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

Thanks, already took. But ideas about 10 tanks to no avail

10 tanks in 10 different points is impossible. In principle, to someone where to send you will need two actions, selection and movement (CLEAR_AND_SELECT, MOVE).

Ideally, first create a group, then when you need somewhere to send the group - CLEAR_AND_SELECT(group number), MOVE(dx, dy)

Nov 13, 2017 10:59:34 AM
third112
dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

10 tanks in 10 different points is impossible. In principle, to someone where to send you will need two actions, selection and movement (CLEAR_AND_SELECT, MOVE). Ideally, first create a group, then when you need somewhere to send the group - CLEAR_AND_SELECT(group number), MOVE(dx, dy)

But how to select? Only a rectangle? Or number (id) of the tank? How to quickly get the range of valid numbers? I don’t understand: the aim of the strategy is to make or rebus (i.e. vague manual) to solve? I assumed that 10 tanks in 10 locations at a time not send. This is a common drawback of all games with a large number of units, so many interesting AI-reshaniya in these games are impossible.

Nov 13, 2017 11:08:14 AM
AlexKol

AlexKol

BB

dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

10 tanks in 10 different points is impossible. In principle, to someone where to send you will need two actions, selection and movement (CLEAR_AND_SELECT, MOVE). Ideally, first create a group, then when you need somewhere to send the group - CLEAR_AND_SELECT(group number), MOVE(dx, dy)

Yes, everything is possible 10 times consecutively added. Or allocated and take the type, in short a lot of options.

Nov 13, 2017 11:08:18 AM
Scarlet

Powered by Yandex.Translate

Do not confuse the person. The question was about one tick. If one tick to consistently send 10 tanks in 10 locations (CLEAR_AND_SELECT and MOVE), then nothing will happen. The word really. For one tick, even one tank not to send. For one tick you can do one action (MOVE or CLEAR_AND_SELECT etc.). So 10 tanks in 10 locations 20 action = 20 ticks. And if you remember about limit of 12 action for 60 ticks, then you can understand this game is not about the management of each tank, but about the balance (finally, after the introduction of YAU) between the size of managed groups and the limit of action. However, all this should have become clear from the rules.

Nov 13, 2017 11:03:03 PM
dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

Do not confuse the person. The question was about one tick. If one tick to consistently send 10 tanks in 10 locations (CLEAR_AND_SELECT and MOVE), then nothing will happen. The word really. For one tick, even one tank not to send. For one tick you can do one action (MOVE or CLEAR_AND_SELECT etc.). So 10 tanks in 10 locations 20 action = 20 ticks. And if you remember about limit of 12 action for 60 ticks, then you can understand this game is not about the management of each tank, but about the balance (finally, after the introduction of YAU) between the size of managed groups and the limit of action. However, all this should have become clear from the rules.

Well I wrote a whole =)

Nov 13, 2017 11:43:44 PM
dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

But how to select? Only a rectangle? Or number (id) of the tank? How to quickly get the range of valid numbers? I don’t understand: the aim of the strategy is to make or rebus (i.e. vague manual) to solve? I assumed that 10 tanks in 10 locations at a time not send. This is a common drawback of all games with a large number of units, so many interesting AI-reshaniya in these games are impossible.

Select (CLEAR_AND_SELECT, ADD_TO_SELECTION, DESELECT) ANY rectangle (the rectangle is added to optional the type of units [tank, for example] that you want to allocate), OR group number.

Nov 13, 2017 11:46:29 PM
dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

But how to select? Only a rectangle? Or number (id) of the tank? How to quickly get the range of valid numbers? I don’t understand: the aim of the strategy is to make or rebus (i.e. vague manual) to solve? I assumed that 10 tanks in 10 locations at a time not send. This is a common drawback of all games with a large number of units, so many interesting AI-reshaniya in these games are impossible.

If I understand correctly the term “valid range of numbers”, in any way, so as to allocate unit id is impossible, but You can select a unit by its id, to its center, compute the rectangle of size 2*x 2 vehicleRadius*vehicleRadius with the center in the center of the unit, and give the command CLEAR_AND_SELECT with the given rectangle. And that, in General, inefficient as Scarlet noticed in the comments above. Except when you need to send a single unit somewhere, say, intelligence.

Nov 13, 2017 11:51:07 PM
dimir

dimir

СПбГЭТУ (ЛЭТИ)

Powered by Yandex.Translate

But how to select? Only a rectangle? Or number (id) of the tank? How to quickly get the range of valid numbers? I don’t understand: the aim of the strategy is to make or rebus (i.e. vague manual) to solve? I assumed that 10 tanks in 10 locations at a time not send. This is a common drawback of all games with a large number of units, so many interesting AI-reshaniya in these games are impossible.

And then there are official Telegram channel (link below left), where You will answer your questions much faster.

Nov 13, 2017 11:53:54 PM
luckybet100

luckybet100

Moscow

Powered by Yandex.Translate

Help please, launch compile_java.sh then launch the command java-jar java-cgdk.jar gives this error no main manifest attribute, in java-cgdk.jar. Campiglio just SAMP, what to do?

Nov 16, 2017 4:47:55 PM
luckybet100

luckybet100

Moscow

Powered by Yandex.Translate

Mac os high siera

Nov 16, 2017 4:50:51 PM
SladeThe

SladeThe

Russian AI Cup Team

luckybet100

luckybet100

Moscow

Powered by Yandex.Translate

Help please, launch compile_java.sh then launch the command java-jar java-cgdk.jar gives this error no main manifest attribute, in java-cgdk.jar. Campiglio just SAMP, what to do?

You have in the JAR file manifest does not specify a class that runs by default. You either need to change the way of building the JAR, or the way you run. For example, you can add your file in the classpath and explicitly specify the startup class. Should be something like java -cp java-cgdk.jar Runner.

Nov 16, 2017 7:12:47 PM
dimir

dimir

СПбГЭТУ (ЛЭТИ)

SladeThe

SladeThe

Russian AI Cup Team

Powered by Yandex.Translate

You have in the JAR file manifest does not specify a class that runs by default. You either need to change the way of building the JAR, or the way you run. For example, you can add your file in the classpath and explicitly specify the startup class. Should be something like java -cp java-cgdk.jar Runner …

He was already in Telegram channel helped.

Nov 16, 2017 7:14:52 PM
BaR5uk

BaR5uk

Карачев

Powered by Yandex.Translate

I read the documentation, but something never found, as every tick of the game to know what units my strategy has and where they are. That is where they are clear how to learn: in object properties, but how to get the array of objects with all units?

Nov 18, 2017 2:04:25 AM
SladeThe

SladeThe

Russian AI Cup Team

BaR5uk

BaR5uk

Карачев

Powered by Yandex.Translate

I read the documentation, but something never found, as every tick of the game to know what units my strategy has and where they are. That is where they are clear how to learn: in object properties, but how to get the array of objects with all units?

To transfer such number of units each tick is too resource-intensive. Therefore, full information about the technology in the world is missing. In the array of new vehicles is transmitted only new equipment, vehicle updates — mutable field. You need to maintain a current list of equipment in the world, using these two arrays. In the “Quick start” is an example of how to do it. View method initializeTick.

Nov 18, 2017 2:11:34 AM