README

This is an introduction into how to play Hyxor. It's a real time abstract strategy game designed to be played by between eight to sixty four different computer programs in a single round. You start from one system and the goal of the game is to take over all systems on the board.

Currently you can participate by writing a program to connect to the game server via websocket. Game data is streamed every tick and moves can be sent over the same websocket. The bot should be packagable as a docker container and uploaded to a registry for inclusion into battle royale style rounds.

getting started

Right now, there are several levels that have been released to help prepare a bot for the full game. These levels are distributed as a docker container. Please download the container and run it on your local system to play.

There are some example repositories for bots as reference material. There is a python and javascript sample bot that might be useful as a starting point.

First login to the docker registry.

docker login registry.hyxor.com -u example-user

Download the demo container.

docker pull registry.hyxor.com/akama/dots

Run the docker container

docker run -p 9090:9090 -p 9091:9091 -e LEVEL=level_one registry.hyxor.com/akama/dots

The websocket server runs on port 9091. There is a visual website on port 9090 that can be used to monitor the progress of a game at any time. The server will run one game and then exit. It takes different arguments for the level by setting env variable LEVEL to level_zero, level_one, etc. To observe a sample game and see the game data plus messages being passed, you can also set LEVEL to demo to show a game without a player.

systems & fleets

The game is divided into systems and fleets. Systems spawn units for their owner and fleets move between systems. A system can have several fleets on it and change owners if only one fleet is on it. If a system has two or more fleets, they will fight until only one fleet exists. Each system starts with either a player or GRAY fleet on it that serves to defend it.

a system 386 owner: Chell economy: 1 fleets: Chell × 28 a fleet in transit 699 origin 547 goal Chell × 153 travel_time: 100 ticks_til: 90
fig. 1 — [COPY: caption]

orders

Orders come in the form of plain text at the moment. The format, discription and an example follow.

MOV - Move ships from one system to another.

MOV PlayerName OriginId DestinationId ShipCount

Example:

MOVverbPLAYERPlayerName0OriginId1DestinationId25ShipCount
PlayerNameName of player
OriginIdSystem id of the origin system to send from.
DestinationIdSystem id of the destination system
ShipCountHow many ships to send from the origin to the dest

UPG - Upgrade a system to produce more ships by pausing production

UPG PlayerName SystemId

Example:

UPGverbPLAYERPlayerName0SystemId
PlayerNameName of player
DestinationIdSystem id of the system to upgrade

game state

The websocket delivers gamestate, the two most significant types are the system and the fleet. A full game tick that is delivered over the wire is presented below.

{
    "tick": 1541,
    "players": [
        "GLaDOS",
        "Chell"
    ],
    "systems": [
        {
            "id": 386,
            "pos": {
                "x": -1537,
                "y": -3772
            },
            "economy": 1,
            "owner": "Chell",
            "fleets": [
                {
                    "owner": "Chell",
                    "count": 28
                }
            ],
            "upgrade_left": 0
        },
        {
            "id": 588,
            "pos": {
                "x": 2536,
                "y": -2247
            },
            "economy": 2,
            "owner": "GRAY",
            "fleets": [
                {
                    "owner": "GRAY",
                    "count": 7
                }
            ],
            "upgrade_left": 0
        },
        {
            "id": 80,
            "pos": {
                "x": -4742,
                "y": 1065
            },
            "economy": 1,
            "owner": "GRAY",
            "fleets": [
                {
                    "owner": "GRAY",
                    "count": 7
                }
            ],
            "upgrade_left": 0
        },
        {
            "id": 302,
            "pos": {
                "x": -3235,
                "y": -3659
            },
            "economy": 1,
            "owner": "GLaDOS",
            "fleets": [
                {
                    "owner": "GLaDOS",
                    "count": 50
                }
            ],
            "upgrade_left": 0
        },
        ...
    ],
    "fleets": [
        {
            "fleet": {
                "owner": "GLaDOS",
                "count": 84
            },
            "ticks_til": 112,
            "travel_time": 119,
            "goal": 100,
            "origin": 499
        },
        {
            "fleet": {
                "owner": "Chell",
                "count": 153
            },
            "ticks_til": 90,
            "travel_time": 100,
            "goal": 547,
            "origin": 699
        },
        ...
    ],
    "stats": {
        "ship_cnt": [
            [
                "GLaDOS",
                6551
            ],
            [
                "Chell",
                6286
            ]
        ],
        "system_cnt": [
            [
                "GLaDOS",
                94
            ],
            [
                "Chell",
                91
            ]
        ]
    }
}

assumptions

There are a couple things you can assume right now but might change in the future. The only data that the game delivers at the moment is a game update which is delivered once per tick. Orders that can't be completely fufilled by a planet will be partially filled. Orders that are incorrectly formatted will be dropped.