Lets Play Kick The Can!
Although Moogie is the current winner, if anyone can take his crown they are encouraged to do so
Kick the can is a children's game. Involving one defender, and multiple attackers. Today it is no longer such a game! Your job is to write a bot that plays it, to win, king-of-the-hill style!
https://en.wikipedia.org/wiki/Kick_the_can
There are some key differences in this game. The first key difference is that the game is multiplayer (5v5). The second key difference is that both sets of bots can kill and eliminate enemy players with both mines and thrown bombs! Bots can not see any mines (regardless of distance) or players at greater than five blocks away!
The map is a maze as follows.
This maze is procedurally generated by first creating a maze using a depth first recursive backtracking algorithm. And then placing the shown holes in (as well as make the maze more "imperfect". The maze is 65x65 blocks wide, and zero indexed. Thus the blue flag (can) is at 1,1 and the red flag (can) is at 63,63. Blue team spawns at 2,2 and 3,3 4,4 etc. red team spawns at 62,62 and 61,61, 60,60 etc. The blocks in cyan are bots on the blue team, and the blocks in magenta are red bots. The game is always five versus five. Each bot on the team will use your code (but may store other instance variables (or create local files) to keep track of state and differentiate roles.
Gameplay
Mines can be placed as you can see in gray. And bombs can be thrown a maximum distance of up to four blocks. These travel for up to four blocks through walls and other players killing only the enemies which stand in your way. After each step they have a 40% chance of falling away. So they have 100% chance of 1 range 60% at 2 range 36% at 3 range and 21.6% at three range Placing a mine or throwing a bomb takes one team ammo. This starts at 0 and can be increased by collecting the orange boxes. Note that four (4) of these ammo caches will be conveniently centered. The Bots are lined up in an array of two red and two blue. I.E RRRRRBBBBB. Gaurding the flag is permitted, but beware that being near the flag(i.e less than five blocks) results in slowness, and only allows movent. every three turns. The Arena picks a random starter for each turn. I.E The order can be RBBBBBRRRRR BBBBBRRRRR BBBRRRRRBB etc..
Objective
Program your five bots (each has the same class file) to successfully navigate the maze and touch the opposing can while being careful not to accidentally knock over ones own can, or step on a mine.
Programming
The arena and bot entries are currently in Java however a stdin/out wrapper exists for other languages.
The arena code will be made available but here is the relevant details.
Bot Class
public class YourUniqueBotName extends Bot{
public YourUniqueBotName(int x , int y, int team){
super(x,y,team);
//optional code
}
public Move move(){//todo implement this method
//it should output a Move();
//A move has two paramaters
//direction is from 0 - 3 as such
// 3
// 2-I-0
// 1
// a direction of 4 or higher means a no-op (i.e stay still)
//And a MoveType. This movetype can be
//MoveType.Throw
//MoveType.Mine
//MoveType.Defuse defuse any mine present in the direction given
//MoveType.Move
}
}
Key Methods Available
Note that using any techniques to modify or access data you should generally not have access to is not permitted and will result in disqualification.
Arena.getAmmo()[team];//returns the shared ammo cache of your team
Arena.getMap();//returns an integer[] representing the map. Be careful since all enemies more than 5 blocks away (straight line distance) and all mines are replaced with constant for spaces
//constants for each block type are provided such as Bot.space Bot.wall Bot.mine Bot.redTeam Bot.blueTeam Bot.redFlag Bot.blueFlag
Arena.getAliveBots();//returns the number of bots left
getX();//returns a zero indexed x coordinate you may directly look at (but not change X)
getY();//returns a zero indexed y coordinate (y would work to, but do not change y's value)
//Although some state variables are public please do not cheat by accessing modifying these
StdIn/Out wrapper Interface Specification
The interface consists of two modes: initialisation and running.
During initialisation mode, a single INIT frame is sent via stdout. This frame's specification is as follows:
INIT
{Team Membership Id}
{Game Map}
TINI
Where: {Team Membership Id} is an single character: R or B. B meaning blue team, R meaning red team.
{Game Map} is a series of rows of ascii characters representing one row of the map. The following ascii characters are valid: F = blue flag G = red flag O = open space W = wall
The game will then proceed to send game frames over stdout to each bot as so:
FRAME
{Ammo}
{Alive Bot Count}
{Bot X},{Bot Y}
{Local Map}
EMARF
Where:
{Ammo} is a string of digits, value will be 0 or greater {Alive Bot Count} is a string of digits, value will be 0 or greater {Box X} is a string of digits representing the X co-ordinate of the bot on the game map. Value will be 0 <= X < Map Width. {Box Y} is a string of digits representing the Y co-ordinate of the bot on the game map. Value will be 0 <= Y < Map Height. {Local Map} is a series of rows of ascii characters representing the whole map surrounding the bot. The following ascii characters are valid: F = blue flag G = red flag O = open space W = wall R = red team bot B = blue team bot M = mine A = ammo
The Controller expects that your bot will then output (to stdout) a single line response in the format:
{Action},{Direction}
Where:
{Action} is one of: Move Defuse Mine Throw
{Direction} is a single digit between 0 and 4 inclusive. (see direction information earlier)
NOTE: all strings will be delimited by \n End of Line character.This will be an elimination tournament. My sample bots will participate as fillers, but I will not award myself the win. In the event of a victory by one of my bots, the title goes to the second place member, and will continue until there is a bot which is not one of mine. Each match consists of 11 rounds of kick the can. If neither team has won a single match by then they both are eliminated. If there is a tie of non-zero score one tie breaker match will be played. If a tie remains both are eliminated. Later rounds may consist of more matches. The seeding of the tournament will be based on the number of upvotes as of 7/31/16 (date subject to change).
Each match lasts 4096 turns. A victory grants one point. A tie or loss grants zero points. Good luck!
Feel free to look at the code or critique it at this GitHub Repo.
https://github.com/rjhunjhunwala/BotCTF/blob/master/src/botctf/Arena.java
Note that I do not have interpreters for too many languages on my computer, and I may need volunteers to run the simulation on their computer. Or I can download the language interpreter. Please ensure that your bots.
- Respond in a reasonable amount of time (say 250 ms)
- Will not damage my host machine