Halite Home

Introducing (unofficial) Halite single-player mode


I'd be interested to see how @timfoden's bot does in this challenge.


@cdurbin, 159, awesome! Is that a production bot, or purpose-built?

I should call out that the 10x10 map, it's a two-player map, so need to specify "-n 2" in the environment launch with the new Halite environment code.

I don't yet know how to identify good or interesting maps for 10x10. But you don't have to specify a seed, you can just specify 10x10, and let Halite pick the seed. I ran it a bunch of times (10x10 maps go fast), and looked at maps where the #frames was at one end or the other of the distribution.

The multiplayer-map feature leverages the easiest way to discover interesting maps, via watching your own replays. Doesn't help with 10x10, though. Maybe some 20x20's might be just as good. Got one?


Yeah, me too!


@cdurbin I'll host hlt files uploaded to https://nmalaguti.github.io/halite-visualizer/experimental.html. Just drag and drop an hlt file onto the page and it will give you a URL you can share. If you just want to share with the regular visualizer, just remove experimental.html from the URL.


The hlt file is at https://communityhalitereplays.s3.amazonaws.com/540599-123456789.hlt.gz (gzipped).


I'd be interested to see how @timfoden's bot does in this challenge.

Well I'm afraid I'm too lazy to build the new environment myself... but if the official halite.exe was updated so it'd just be a simple download perhaps I could manage it. :slight_smile:


Paging @Sydriax (I don't have a windows machine)


Thanks I posted my 159 frames one there.


Thanks, my production bot is at 161 on this map. To get to 159 I tweaked a parameter that causes me to take longer to issue my moves for a frame (in the 750 ms range towards the end).

So a sidebar on timeouts: I'd like that to be my production bot, but for some reason my timeout safeguards don't seem to work on the halite servers, which makes me really conservative with time taken. My production bot still times out too much on init in production, even though locally I can put a sleep for 60 minutes as my init function and my safeguard works to send an init before timing out. I'm using thunk-timeout from https://github.com/Raynes/clojail/blob/master/src/clojail/core.clj


@cdurbin nice one with the 159 frames! Best I can still do is 162 frames, guess I have to twiddle my bot some more.

However adjusting the heuristics a bit gave me 54 frames beating @erdman's record of 55 frames!


@timfoden @truell20 Compiled Halite for Windows x64 @ https://fkcd.ca/5O4/halite.exe. From https://github.com/HaliteChallenge/Halite/commit/057f38e79909e28156065450e5ad739d7e059f99.

@truell20 If you want to compile it yourself, you could run one of these VMs https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/.

I tried my own bot on -d "10 10" -n 2 -s 1886238180, best I've got (through randomness) is about 56 frames. Getting those last few frames in is increasingly difficult. Kudos to you @pepijno.


We've updated the official windows build (@Sydriax did so yesterday).


@timfoden @truell20 Compiled Halite for Windows x64 @ https://fkcd.ca/5O4/halite.exe

Thanks for that... but it appears to be a cygwin build... so has dependencies on cygwin dlls which I don't have (e.g. cygwin1.dll).


Sorry about that. It appears I ran the makefile instead of make.bat, which ended up compiling a non-static executable requiring cygwin1.dll. I wasn't able to get the make.bat to link on my computer due to the following errors

g++ -o2 -std=c++11 main.cpp core/Halite.cpp -I . networking/Networking.cpp -o halite.exe -static
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/libstdc++.a(cow-stdexcept.o): In function `std::logic_error::logic_error(std::logic_error const&)':
/usr/src/debug/gcc-5.4.0-1/libstdc++-v3/src/c++11/cow-stdexcept.cc:44: multiple definition of `std::logic_error::logic_error(std::logic_error const&)'
/tmp/ccBzuOPU.o:Halite.cpp:(.text$_ZNSt11logic_errorC2ERKS_[_ZNSt11logic_errorC2ERKS_]+0x0): first defined here
collect2: error: ld returned 1 exit status

However it appears that the latest .exe available at https://2016.halite.io/downloads/environment/halite.exe, https://2016.halite.io/downloads.php contains single player support, as suggested by @truell20 earlier post.


We've updated the official windows build (@Sydriax did so yesterday).

Thanks... I'll give it a go on the 2 setups, but I'm not expecting anything great... my bot seems to make good early progress compared to others, but that doesn't continue later in the game.

Edit: @truell20 BTW the download web page still says this build was from 2nd November, and the version number (--version) reported by the exe is still 1.0.1, the same as the old version.

... time passes ...

For the 10x10 one:
v23 does it in 55 steps: http://www.7sun.com/halite/v23-10x10-1481357859-1886238180.hlt
v22 does it in 56 steps: http://www.7sun.com/halite/v22-10x10-1481357883-1886238180.hlt
v20 does it in 54 steps: http://www.7sun.com/halite/v20-10x10-1481357893-1886238180.hlt
v19 does it in 55 steps: http://www.7sun.com/halite/v19-10x10-1481357899-1886238180.hlt
- OK this one seems to be on a par with the good entries by other bots... but it's a small arena.

For the 50x50 one:
v23 does it in 168 steps: http://www.7sun.com/halite/v23-50x50-1481359459-123456789.hlt
v22 does it in 170 steps: http://www.7sun.com/halite/v22-50x50-1481359515-123456789.hlt
v20 does it in 174 steps: http://www.7sun.com/halite/v20-50x50-1481359539-123456789.hlt
v19 does it in 171 steps: http://www.7sun.com/halite/v19-50x50-1481359559-123456789.hlt
- And this one is a bit off the pace. :slight_smile:

Edit: Corrected the URLs (copy-paste-edit error -- sorry about that)

Cheers, Tim.


Edit: @truell20 BTW the download web page still says this build was from 2nd November, and the version number (--version) reported by the exe is still 1.0.1, the same as the old version.

Good catch


I fixed a couple more bugs yesterday and made it to 156 frames on the 50 x 50 map.


I tested out my latest bot on this map, and it is now at 154. I tried a variation where I grabbed even the 0 production cells, and it was also 154 to my surprise.


It's been a long time since I've run the larger map with my bot. It now completes in 172 frames. I thought my final bot would be better than that! :frowning:

For the smaller map my last bot finished at 55 frames. I tested with the small map all the time when testing changes to my bot and never managed to get below 54 frames. I'm curious if any of the newer challengers around here managed to beat either 154 on the big map or 54 on the small one.


I guess the best strategy for the multiplayer game is probably not the best for the single-player mode.
For example, when a bot's production is on par with its enemies, it pays (quite a lot) to slightly slow down expansion and "hoard" strength. But this strategy certainly hurts the single-player mode performance.

Wish I realized this before spending quite some time running a policy gradient optimization of the single-player mode performance...


I'll (surely temporarily) take world record: here's an .hlt of the version before my final bot; it finishes the map in 151 frames:


Expansion is fairly "dumb" - each of my pieces does a search for 5-6 squares in every direction, and if everything belongs to me then just move towards the closest border. When near a border, weight the direction to go based on average production/strength, decayed by distance, over that same 5-6 block square. Directly diagonal squares contribute equally to the directions they're in. No Dijkstra's or A*. There's no conservation of energy for attacking, just some basic protection against cap loss & bad merges. It's definitely NOT ideal for battles, haha - I finished in 82nd place!