https://github.com/stonet2000/dimensions-halite3
https://github.com/stonet2000/dimensions-halite3
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stonet2000/dimensions-halite3
- Owner: StoneT2000
- Created: 2020-03-31T21:15:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T17:25:55.000Z (about 3 years ago)
- Last Synced: 2025-02-05T13:52:55.987Z (11 months ago)
- Language: TypeScript
- Size: 2.27 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dimensions - Halite 3 Design
This is a typescript implementation of the [Halite 3 AI competition](https://halite.io) using the [Dimensions AI competition framework](https://github.com/stonet2000/dimensions). This simulates the original Halite 3 game quite closely, including features such as inspiration, mining, dropoffs and more!
You can run most bots that adhere to the [Halite 3 starter kits](https://github.com/HaliteChallenge/Halite-III/tree/master/starter_kits). At the moment, C++, C bots don't really work due to no support for CMake and Make at the moment. Out of the box, Java, Python, Javascript / Typescript, PHP, Go should work, as long as a `install.sh` file isn't used. More will be added as Dimensions supports more options.
To start, first install it
```
npm install dimensions-ai @dimensions-ai/designs-halite3
```
To run a single match, run
```js
const Dimension = require('dimensions-ai');
const Halite3Design = require('@dimensions-ai/designs-halite3').default;
let halite3Design = new Halite3Design('Halite 3 Design');
let halite3Dimension = Dimension.create(halite3Design, {
name: 'Halite 3',
loggingLevel: Dimension.Logger.LEVEL.DETAIL
});
let starterBotJS = './starter-kits/js/MyBot.js';
let starterBotPY = './starter-kits/python/MyBot.py';
halite3Dimension.runMatch(
[starterBotJS, starterBotPY],
{
name: 'my-halite-match',
loggingLevel: Dimension.Logger.LEVEL.INFO,
replayDirectory: './replays',
}
).then((res) => {
console.log(res);
});
```
To run a trueskill ranked leaderboard like tournament, akin to the actual Halite 3 tournament, run
```js
let Tournament = Dimension.Tournament;
let simpleBots = ["pathToBot.js", "pathToSomeOtherBot.java", "anotherBot.cpp", "anotherOne.py"];
let halite3League = halite3Dimension.createTournament(simpleBots, {
type: Tournament.Type.LADDER, // specify ladder/leaderboard tournament
rankSystem: Tournament.RankSystem.TRUESKILL, // specify to use trueskill for ranking
loggingLevel: Dimension.Logger.LEVEL.INFO,
defaultMatchConfigs: {
replayDirectory: './replays',
loggingLevel: Dimension.Logger.LEVEL.ERROR,
},
agentsPerMatch: [2, 4], // specify that only 2 or 4 players can compete at the same time
resultHandler: Halite3Design.trueskillResultHandler // use the trueskill result handler
});
halite3League.run();
```
For full details on how to run custom matches and tournaments, make sure to check out https://github.com/stonet2000/dimensions for details on how to run them.
Replays are automatically saved to the root folder. You can specify the `replayDirectory` field to give a directory to store replays in. To watch them, you can upload them to the online Halite 3 client at [https://2018.halite.io/watch-games](https://2018.halite.io/watch-games)
There are only a few features left out (that I know of at least). Error logs are not saved anywhere at this time, they are only printed to console if you set logging to a level of `Logger.LEVEL.WARN` or higher
I'm open to any contributions if you would like to fix/add something to this! Just open an issue or a PR