X

Train your own IRONMAN to compete – come with us on one of this year´s most maxed out bootcamps in Los Angeles!

HOW IT WORKS

The Competition

It is with great eager we are now releasing the spots for The Considition 2018 - Consid's yearly e-sports hackathon where you program your own IRONMAN to challenge other teams in a tournament with teams from all over Sweden. You compete in your choice of track profile designed by real races used by IRONMAN worldwide. Your team will be competing for a maxed out bootcamp - body and mind - with us to Los Angeles where tech & sport professionals will train you. Sounds like the best e-sports hackathon ever, huh? Join us for an unforgettable journey!

When and Where?

The competition concists in a training week followed by a final. The finals of the The Considition 2018 will be taking place October 25th at 5 PM local time. API access and training matches will open on the 18th of October at 5 PM. More information regarding the API, the training week and the finals will follow here as the API is opening.

You can participate in the hackathon from anywhere – the only thing you need to do is to sign up your team here. If you wish to compete from one of Consid’s offices in Sweden for the best experience and atmosphere, do not miss registering this in your application - limited spots, first come first served.

What..

The task at hand is to program an AI controlling an Ironman-runner! At its core, The Considition 2018 is a pathfinding problem – however, in addition to finding a viable path to the goal, there are multiple aspects that will affect your runner’s performance and that will have to be taken into account in order to reach it as quickly as possible – and, crucially, before your opponent(s) does, as you will be playing against one or several players during the tournament.

The API

The game is played using a REST-API. Thus, you can use any programming language capable of sending HTTP-requests you like, or even tools like CURL or Postman. The API-key you received when registering your team must be included in every request, either in the body/query parameters (as apiKey) or in the header (as x-api-key)– if you lose your API-key, please visit the “Teams”-page and click Recover ApiKey. The base path for the API is www.theconsidition.se/considition/ironman and it contains the following endpoints.

The following API-methods are avaliable:

GET

  • /games/{gameId}/{apiKey} - Retrieves the gamestate for a given ID
  • /games/{apiKey} - Retrieve gameIds for all active games for the given team (apiKey)

POST

  • /games/ - Creates a new game, returning the gameId
  • /games/{gameId}/join - Joins the specified game
  • /games/{gameId}/ready - Indicates that you are ready to start a game you've previously joined
  • /games/{gameId}/action/move - Attempt to move in a given speed with a given direction
  • /games/{gameId}/action/step - Attempt to take a step in a given direction
  • /games/{gameId}/action/rest - Rest for a turn
  • /games/{gameId}/action/usepowerup - Activates a specified powerup, provided you have it in your inventory
  • /games/{gameid}/action/droppowerup - Drops a specified powerup, provided you have it in your inventory

DELETE

  • /games/ - Ends all active games for your team

If you are using C#, Java, JavaScript or Python, you can use one of our starter-kits including premade API libraries containing the following methods:

  • setApiKey(apiKey)
  • initgame(maxPlayers, map, numberOfStreams, numberOfElevations, numberOfPowerUps)
  • getGame(gameId)
  • joinGame(gameId)
  • tryReadyUp(gameId)
  • makeMove(gameId, direction, speed)
  • step(gameId, direction)
  • rest(gameId)
  • usePowerup(gameId, powerupName)
  • dropPowerup(gameId, powerupName)
  • endPreviousGamesIfAny()

A detailed view of the routes, including form parameters and return values can be found in the Swagger UI.

Playing the game

The Considition 2018 is played in turns. After the game has been created, the players join with their unique API-key. The game starts by all players indicating that they are ready by sending a ready command. During each turn the players send a request containing a command to the API. The commands will be executed in the order they are received, and at the end of the turn, a updated gamestate is sent back to all players. As the gamestate differs from turn to turn, not only in terms of player positions but also in various dynamic aspects like weather, it’s important that your algorithm makes decisions based on the newest gamestate, and not the initial state you receive when a game is created.

The Gamestate object

After you and all other players have sent a command, you will receive a JSON-response containing several fields:

{ "code": 200, //Http status code "success": true, //Indicates that the request was successfull "gameState": { "gameId": "5c62ebb6-8739-4116-849c-fd11a28ebb3a", //Id of the current gamestate "gameStatus": "running", // Indicates if the game is currently running, waiting for players, or finished. "turn": 105, //The current turn "yourPlayer": { "xPos": 10, // Position on the x-axis "yPos": 12, // Position on the y-axis "status": "biking", // What your runner is currently doing. See below for possible statuses. "statusDuration": 0, // Indicates for how long you'll keep being stunned/exhausted "stamina": 30, // Making moves cost different amounts of stamina. In addition, dynamic factors like weather and powerups can affect how much stamina your player will need to perform a certain move. "powerupInventory": [ // A list containing names of powerups your player has collected that can be activated (or dropped) with the powerup-command "StaminaSale", "Flippers", "InvertStreams" ], "name": "Dave", // Your team name "playedTurns": 105, // The number of played turns "activePowerups": [ // A list of currently active powerups and for how long they will be active { "name": "Flippers", "duration": 4 } ] }, "otherPlayers": [ // Same as above but for your opponents { "xPos": 78, "yPos": 6, "status": "biking", "statusDuration": 0, "stamina": 0, "powerupInventory": [ "InvertStreams" ], "name": "Roger", "playedTurns": 105, "activePowerups": [] } ], "tileInfo": [ // The map is represented as a 2D-array consisting of 100x100 tiles which can contain any combination of Type, Weather, Powerup, Waterstream and Elevation. More info below [ { "type": "forest" }, ... // Loads of tiles , { "type": "forest", "weather: "rain" } ], [ ... // loads of tiles { "type": "road", "elevation": { "direction": "e", "amount": 28 } }, ... // more tiles , { "type": "road", "powerup": { "name": "Spikeshoes" } }, ... // lotsa tiles { "type": "water", "waterstream": { "direction": "s", "speed": 15 } }, ], ... // lots of rows of tiles (about 100 total) ] } }

Players statuses

  • Biking/Running/Swimming
  • Stunned: Some (erroneous) moves, such as running into trees, cause your player to get stunned forcing you to skip a turn.
  • Exhausted: Making a move that results in your players stamina going below zero will make you exhausted, forcing you to skip a turn.
  • Idle: This status is set after your player has recuperated from being stunned and is ready to make moves again.

Tileinfo

  • weather: If present, there is rain on the tile.
  • elevation(if road/trail): If present, this object contains
    • direction: Which direction the elevation faces
    • amount: How steep the incline is
  • waterstream(if water): If present, this object contains
    • direction: Which direction the stream flows in
    • speed: How strong the current is
  • powerup: If present, this field contains the name of a powerup located on this tile.

For detailed information on how elevation and waterstreams affect your runner, please see the “Elevation and waterstreams”-section

The commands

There are 5 commands you can issue to your runner during a game. All commands are performed by sending a POST-request with the appropriate body contents to /{gameId}/action/{commandname}. As stated above, all of your requests must contain your API-key, either in the body or in the header.

Step

This is one of the base commands you will – most likely – use to traverse the map. It takes a direction (east, west, north, or south) and moves your runner 1 tile in the given direction – more information on how your runner will move can be found in the movement system.

Parameters:

  • direction: e, w, n, s

Move

This is the base command you will – most likely – use to traverse the map. It takes a direction (east, west, north, or south) and speed and moves your runner a certain number of tiles in the given direction – more information on how your runner will move can be found in the movement system.

Parameters:

  • speed: fast/medium/slow
  • direction: e, w, n, s

Rest

Causes your runner to rest for one turn, restoring stamina at an accelerated rate. Use this command if your runner is exhausted or stunned to get the next turn, this wont give you any extra stamina.

Parameters: None

UsePowerup

Causes the runner to use one of the powerups in the Powerup-Inventory. If the powerup is instant, it’s effect is simply applied to the gamestate. If the powerup has a duration, it will be added to your active powerups, affecting your player in a specified way for a certain number of turns.

Parameters:

  • name: The name of the powerup you want to activate

DropPowerup

Causes the runner to drop one of the powerups in their Powerup-Inventory, the powerup is removed from the game.

Parameters:

  • name: The name of the powerup you want to drop

The movement system

When you issue a move-command to your player, the basic logic to calculate how far your runner will move is as follows:

  1. A set number of movement points is given to your runner, depending on which speed you choose.
  2. Every tile you move over will deduct a certain number of movement points. The base reduction is based on tile type (water, road, trail or grass).
  3. In addition, dynamic effects like weather and elevation/waterstreams can affect the number of movement points or stamina deducted – either negatively or positively.
  4. When your movement points reach 0, your runner will stop, and the move is over.
  5. If your runner runs out of stamina, your runner will stop and become exhausted, forcing you to skip turns until your stamina is regenerated.

If any of the tiles your runner moves over contains a powerup, it will be automatically picked up, provided you have space for it in your inventory.

You will not crash into any other player, you can stand on the same tile and inhabitate the same space. However request will be evaluated in the order they are recieved so the first person the send a request will reach the tile first and receive whatever powerup is in the tile. Speed is an important part of becoming an Ironman.

Movement point values gained per action : "Fast" -> 210, "Medium" -> 150, "Slow" -> 100.
Step always moves 1 tile.
Stamina : Max is 100, minimum is 0. Base regeneration is 20 per turn, 15 if under 60 stamina. Resting regenerates an additional 15 stamina.
All moves require a certain stamina cost to perform : "Fast" -> 50, "Medium" > 30, "Slow" -> 10, "Step" -> 15.

Note: If you have 40 stamina left, but choose to move fast you will only move relative to the amount of stamina. Which means that in this case you will only be able to utilize 80% of the movement points of the "Fast"-action before stopping and becoming exhausted.

You only calculate the tiles infront of you, the one you are standing on you do not need to consider.

If movement points for any reason are not a whole number they will always get rounded down.

Aspects to consider

There are many factors to consider when implementing your runner. Some parts of the map will be impassable, and other may contain rainy weather, negatively affecting your stamina. However, apart from simply avoiding certain areas your runner can gain advantages by picking up powerups and using them to improve your performance. Water streams and hills also need to be considered as they can be both beneficial and disadvantageous.

Tile types & Weather

  • Road, Trail, Grass, Water – These represent the different stages in an Ironman-race (Biking, Running, and Swimming respectively). Road deducts the least number of movement points per tile, trail deducts more, and water the most, meaning you will generally move farther biking than swimming. Grass behaves like trail, but it doesn’t contain elevations.
  • Forest, RockyWater – These tiles are impassable. Making a move that causes your player to end up on one of these tiles will stun your player, forcing you to skip a round.
  • Start, Win - These represent the tile you start on and the goal tile.
  • Rain - Moving over rainy tiles will deduct additional stamina

All tile types are lowercase in the API.

  • Watertiles decrement 45 movepoints when entered
  • Roadtiles decrement 31 movepoints when entered
  • Trailtiles decrement 40 movepoints when entered
  • Grasstiles decrement 50 movepoints when entered
  • Start- and Wintiles decrement 30 movepoints when entered

If you have more than 20 movepoints left when you try to enter an impassable tile (or go out of bounds) you will get stunned, otherwise you will just stop on your current tile.

If tile-cost can not be afforded, the tile wont be entered.

For each tile the player moves through that contains rain, an additional 7 stamina will be drained.

When entering the win tile your move will be over and you get a status saying you finished the race. The person to finish the race in the least turns wins!

Elevation and waterstreams

Elevation in a tile represents a hill. An elevation-object contains a direction and an amount, indicating how steep of an incline the hill has. The direction of the elevation indicates which way is uphill. Running/biking uphill is harder and can affect your move to be shorter than planned. Going downhill is easier and can make your move longer. Running perpendicular to the direction of the hill can make you slide down the hill.

Waterstreams are currents in the water. If you swim in the direction of the currents they might carry you further, but if you swim "upstream" your move could be shorter. Waterstreams can make you deviate from your desired path, i. e. swimming north over a series of streams flowing west will eventually push you one tile to the west.

Going with the stream

Elevations and waterstreams affect your movement in the same way when moving with or against its direction. Just add or subtract the speed/amount from your movepoints depending on whether you are going with or against the direction. Remember that going along a streams direction means you are carried by the stream. However going with the direction of a slope means you are going uphill, so add and subtract accordingly.

Deviation

Going perpendicular to to a stream/elevation is a bit more tricky, the stream/elevation will deviate you from your path and if you deviate enough you will be pushed a tile in the direction of a stream or the direction opposite of an elevation. The amount you can deviate depends on which tile-type you are on, for water you can deviate 15, for trail you can deviate 25, and for road you can deviate 40 before being pushed a tile.

For example, swimming fast north over some tiles with waterstreams that all have a direction "e" and a speed 6. When the player moves over the tiles the speed adds up to the deviation and on the third tile the player will have 18 deviation, and will be pushed east one tile. The player will keep moving north with their remaining move points and their current deviation will be 3 east (18 - 15 = 3).

The deviation will always reset for each move command (it wont carry over between turns)!

The direction of the force matters when calculating deviation, for example going over 2 waterstream tiles one with direction "e" and speed 10 and one with direction "w" and speed 8 means that you now have a deviation of 2 in direction "e". Only opposite directions negate each other.

Remember: Elevations applies deviation in the opposite direction!

The deviation for different tile types (water/road/trail) add up. But because the limits are different you need to calculate it a bit differently, the deviation transfers percentually. If you have been deviated 12 points from streams and in the same move go unto road, since your deviation from the streams was 80% (12/15) = 0,8) you now have 32 deviation on the road (0,8 x 40 = 32).

Powerups

Powerups are special items that are randomly placed around the map. Your player automatically picks up powerups when you move over a tile with a powerup, provided that you have space for it. You can carry a maximum of 3 powerups. Once a power-up is picked up, you may activate it with the usepowerup-command or drop it with the droppowerup-command. Powerups are divided into 2 types: instant, which modify some part of the gamestate when triggered, and duration which apply an effect to your player for a certain number of turns. You can find a full list of the powerups available below.

Instant

  • RemoveCloud – Removes rain tiles around your players position. A 10x10 tile area with your player in the middle is cleared of bad weather.
  • RestoreStamina – Instantly sets your players stamina to full
  • InvertStreams – Inverts the direction of all waterstreams (South => North, East => West and vice versa) in a 50x50 tile area with your player in the middle.

Duration

  • Shoes, 10 turns – Trail tiles deduct 25% less movement points
  • Flippers, 10 turns – Water tiles deduct 25% less movement points
  • Cycletire, 10 turns – Road tiles deduct 25% less movement points
  • Umbrella, 25 turns – Your player is immune to the additional stamina deduction caused by rain tiles
  • Energyboost, 10 turns – You regain 10 more stamina per turn
  • Potion, 5 turns – You gain 50% more movement points
  • Helmet, 25 turns – You become immune to stuns
  • StaminaSale, 10 turns – You consume 40% less stamina
  • Spikeshoes, 10 turns – Ignore the effect of deviation on trail tiles (running)
  • Cyklop, 10 turns – Ignore the effect of deviation on water tiles (swimming)
  • BicycleHandlebar, 10 turns – Ignore the effect of deviation on road tiles (biking)

Duration powerups stack multiplicatively if their effect is percentage based, such as StaminaSale). If they are straight stat based, like Energyboost, they stack additively.

Practice matches - creating and joining games

Before the official tournament, you are free – and encouraged – to start writing your AI and practice. To create your own game, send a HTTP POST to /games/ with a body containing:

  • maxPlayers: The number of players in the game. Set this to 1 if you want to practice by yourself, as games will not start until the specified number of players have joined and readied up
  • map: Which map you want to practice on. There are 4 maps to choose from – a standardmap which contains all 3 stages of an Ironman-race and a watermap, a roadmap, and a trailmap containing exclusively (apart from some impassable parts) those tile types allowing you to practice on one stage at a time.
  • (optional)numberOfElevations: The number of elevation series present on the map. Limit is 1000. Default is 10
  • (optional)numberOfStreams: The number of waterstream series present on the map. Limit is 1000. Default is 10
  • (optional)numberOfPowerups: The number of random powerups placed on the map. Limit is 1000. Default is 10
  • (optional)permittedApiKeys: A list of API-keys (as strings) that are permitted to join this game. Can be used if you only want a friend to be able to join your game. Leaving this blank will allow any player to join

When your game has been created, you will receive a JSON-object containing the gameId. To join the game, send a POST-request to /games/{gameId}/join with your api-key in the body or header.

Finally, it’s time to start the game. This is done by sending a POST-request to /games/{gameid}/readyup, containing only your API-key. Once all joined players have readied up, the game will start, and you can start sending commands. Once the first player has readied up, the other players have 10 seconds to do the same, or the attempt to start the game will fail. Because of this, readying up in games with more than one player should be done in a loop where attempts to ready are made every few seconds until a successful response is received. Examples of this can be found in the starter kits.

Note that you can only have at most two active games at any given time, which is why there is an API endpoint to end all previous games if any (the first call to the API if using the starter-kits). The reason for this is that the system will still consider a game active even if your bot crashes for some reason, as it doesn't know if you will try to reconnect or just restart.

The visualizer(s)

You can use the visualizer, available on www.theconsidition.se/ironmanvisualizer?gameId={gameID}, to replay the game. The visualizer isn't realtime - it will only replay past states of a game. You can use the arrow keys to change the playback speed (and or direction) and the space bar to pause the replay. In addition, there is a debug visualizer on www.theconsidition.se/ironmandebugvisualizer?gameId={gameID}. This is very useful when coding your AI as it gives a graphical representation of the latest gamestate of any game, giving you a quick overview. It is also possible and probably more convenient when debugging to use apikey in the querystring www.theconsidition.se/ironmanvisualizer?apiKey={apiKey} or www.theconsidition.se/ironmandebugvisualizer?apiKey={apiKey}.

Final matches - The Grand Final

The final rounds will be taking place October 25th and follow the agenda at the agenda page. This is also where the highscore will appear that will follow each teams progress through the evening. From 18.30 and on, a new map will be released every 30 minutes for the next two and a half hours up to a total of 5 new maps. These maps can be played any number of times as only the best results on each map, for a specific team, will be used when computing the rank. All of these maps will have default settings when it comes to streams, elevations and powerups. Ranking will then be done as follows.

Ranking

The main ranking parameter will be the total number of maps completed followed by the following parameters - combining the best results of each finished map, in the following order:

  1. Total number of turns taken to reaching the finish line
  2. Total stamina left when reaching the finish line

If all of the above parameters add up to an equal result for two or more teams, the team who got the result first wins.

Final

At 21.00 sharp the API will close, at which point we will be having 4 finalists populating the top four highscore entries. At 21.30 these 4 teams will then compete on a new map, joining a game provided by us (gameId will appear under the agenda on the the agenda page), the grand final. In this game the top three competitors will be the three teams joining us in LA!

The following additional rules will also apply for the grand final:

  • Joining and readying for the game must be done within the 5 minutes time-slot
  • Each team has only 3 seconds to respond with a new request to the server after receiving the latest gamestate. If this requirement is not met the runner will do nothing for one round.

Any of the following scenarios will result in an immediate disqualification for the specific team:

  • Not issuing any commands to the API for the given game in 60 seconds
  • Not issuing any commands to the API for 20 turns

The winner of the match is the bot that finishes the race (reaches the goal) in the least number of turns. If two or more players finish on the same turn the one with most stamina left wins. If players also have the same amount of stamina left, the one that made their final move first wins. Disqualified players are sorted by who played the longest before being disqualified.

Finally..

Good luck & Have Fun!
If you find any potential bugs and/or run into issues of any kind, please refer to the the official slack channel or email and provide as much information as possible about the bug/issue and we will do our best to answer and/or fix it asap. Remember that this slack channel will be the main/official source of information and support, so dont miss to join it.

WHAT DO YOU WIN?

The top three winning teams will win a trip they will never forget. The destination is Los Angeles, California, where a boot camp for both body and mind will take place. During the trip we will stay in a house together close to everything the city has to offer. Time will be given to both physical training together with IRONMAN professionals as well as mental training with focus on AI technology led by skilled developers. The trip will take place on November 3rd to the 8th. More information about the trip will be released shortly. Important information: secure those days in your calendar asap!

REGISTRATION

Are you ready for a ground breaking e-sporting experience, and a trip you'll never forget? Register your team of max two people here. More information regarding the competition will be published on this website.