Download: https://dl.dropboxusercontent.com/u/57961/CloudBots.zip
How to use
If you want to run one of your bots against one of the bots in the cloud, you just need to disable the timeout (the -t
option) and add the bot file of your choice to the competition.
Every request costs me a tiny tiny fraction of money (see AWS Lambda Pricing) so please be reasonable and don't run thousands of games. That being said, I'd need to play over 20,000 games in a month to cost more than like $10.00 so go nuts. I'll update if things get out of hand.
Each move requires a network request so bots will only be as fast as your latency to AWS US-East-1. Each request on the server usually takes less than 1s unless it needs to warm up (which can take about 10s). Many requests should take less than 100ms.
Installing
This requires you to have Node 7.x installed.
npm install
Running a bot
Make sure you're connected to the internet. Add node AliceBot.js
or node BridgetBot.js
to your list of bots.
Example:
./halite -t -d "35 35" "your bot here" "node AliceBot.js"
Bots
Alice
Stronger than Bridget. Might rank close to the top of Gold?
Bridget
In the OverkillBot lineage. Would maybe be Gold level?
Cathy
Was recently in the top 5 bots. Achieved rank 1.
Future
I'll probably add some more bots over time. Let me know if it would be helpful to add weaker bots.
How does it work?
I have included some JavaScript files that hit the appropriate endpoints for each of these bots.
const request = require('request');
const Networking = require('./networking');
const network = new Networking('AliceBot');
let moves = [];
network.on('map', (gameMap, id) => {
request({
url: 'https://k0zitn07h5.execute-api.us-east-1.amazonaws.com/prod/bots/bridget',
method: 'POST',
json: true,
body: {
id,
gameMap,
previousMoves: moves,
}
}, (error, response, body) => {
moves = body.moves;
network.sendMoves(moves);
});
});
The 2 bots currently available are at:
- https://k0zitn07h5.execute-api.us-east-1.amazonaws.com/prod/bots/alice
- https://k0zitn07h5.execute-api.us-east-1.amazonaws.com/prod/bots/bridget
- https://k0zitn07h5.execute-api.us-east-1.amazonaws.com/prod/bots/cathy
They expect a POST request with a JSON body of the format:
{
// my player id
"id": 2,
// the game map for this frame
"gameMap": {
"width": 20,
"height": 20,
// contents is a 2d array of sites
"contents": [
[
{
"owner": 0,
"strength": 51,
"production": 3
},
// ....
]
]
},
// the moves from the previous turn
// at the start of the game it should be an empty array
"previousMoves": []
}
And will respond with a list of moves:
{
"moves": [
{
"loc": {
"x": 10,
"y": 14
},
"dir": 2
}
]
}
Example:
// request.json is a file with the input body
curl -X POST -d @request.json 'https://k0zitn07h5.execute-api.us-east-1.amazonaws.com/prod/bots/alice'