Welcome to this year's Informatica challenge. During the challenge, you'll compete with your fellow students to determine who can create the strongest Artificial Intelligence (AI) agent for a two player game, which we've developed, specifically for this challenge.

This page contains all the information to get you going: how the challenge is organized, how the game works, some pointers to get you started, and how to make a submission.

Best of luck!
–Pieter Van Molle, Ozan Çatal, Elias De Coninck & Gilles Vandewiele

Challenge organization

When creating an account, you'll receive an initial rating of 0. By playing games against other students, your rating will update, based on the outcome of the game, and the rating of your opponent. Every 30 minutes, you'll be matched against a similarly rated student.

Participation is NOT obligatory. Though, we encourage you to participate, as this challenge gives you the opportunity to sharpen your problem solving and programming skills on a real-world problem. To add some additional incentive, the students with the highest rating at the end of the challenge will receive a prize. Respectively, the top three students will receive:

  1. A Fnac coupon of €50
  2. A Fnac coupon of €25
  3. A Fnac coupon of €10

Besides the top three, three additional students will be picked from the leaderboard at random, who will receive a participation prize (a Fnac coupon of €10).

Note: this challenge is designed specifically for students following the "Informatica" course, by prof. Bart Dhoedt. Therefore, only students enrolled in this course are eligible to the monetary rewards.

Deadline

The challenge will end on 10/12 23:59.

The game: Hexatron

Hexatron is a two player game, where each player controls a different color agent, in a hexagonal grid. At every turn, both agents can rotate (120°, 60° or 0°, clockwise or counterclockwise), before moving forward a single space. Behind them, they leave an impenatrable trail. The goal is to outlive your opponent, by

Example replay

The following image contains a replay for an example game. The darker colored spaces represent the starting position for both agents. The orientation (after rotating), is given by the arrows. In this case, the blue agent lost, by crashing into the trail of the yellow agent. Note that the actual playing field will be bigger than the one shown here.

Moving

An agent moves by first rotating, and then moving forward. There are five possible rotations, relative to the current orientation of the agent: 120° counterclockwise, 60° counterclockwise, 0° (no rotation), 60° clockwise, and 120° clockwise, represented by the actions -2, -1, 0, 1, and 2. The following figure shows an agent oriented northeast. Highlighted are the spaces he can reach, along with the action required to reach them.

The following code snippet shows how you can find the compass points for each move, given your agent's orientation:

orientations = ['NW', 'NE', 'E', 'SE', 'SW', 'W']
current_orientation = orientations.index('NE')
print([orientations[current_orientation + action] for action in range(-2, 3)])
# Prints `['W', 'NW', 'NE', 'E', 'SE']`

Playing field representation

The hexagonal grid is contained within a square array. An example is given by the following figure. Within each hexagon are the Y -and X-coordinates of that hexagon in the array.

Note that the top-left corner and the bottom-right corner of the array contain unreachable spaces. You'll have to take this into account in your move generation algorithm!

Getting started

Some pointers to get you up and running for your first agent can be found below:

Often, a combination of heuristics/rules of thumb can also create strong agents. Some suggestions include:

Making a submission

A valid submission consists of a single Python .py file, which must comply to the following conditions:

The following items are forbidden:

Generating a move

The generate_move function should have the following definition:

def generate_move(board, positions, orientations)

The arguments to this function are:

The function must return:

IMPORTANT: When the time required for generate_move exceeds one second or when an exception occurs in generate_move, the corresponding player loses the game instantly!

Example

An example of a valid submission (an agent that generates a random move), is the following:

import numpy as np


def generate_move(board, positions, orientations):
  move = get_random_move()
  return move


def get_random_move():
  return np.random.randint(-2, 3)

Offline help files

To further assist you in the development of your agent, we're providing a ZIP-file, containing a series of Python files to evaluate your agent on your local system. The ZIP-file can be downloaded here, and contains (among others) the following files:

Changelog

13/11 12/11 09/11 08/11