
Battlesnake – Competitive Snake Games over HTTP - bvanvugt
http://play.battlesnake.io
======
pbhjpbhj
" Step 1

Write a program to play the game Snake

Step 2

Deploy using whatever technology you like

Step 3

Battle other snakes and compete in arenas!

"

Sounds cool, that title make it sound like yet another worms.io clone, but
this is programmatic gaming - I feel the title should include that, or "make a
snake bot to battle in a classic 'snake' arena".

~~~
bvanvugt
Yeah I like something like this: "Build a bot to play the classic game
'Snake'"

------
phoe-krk
I just realized that a multiplayer Snake is basically the TRON racing game
played on a discrete grid.

~~~
bvanvugt
Haha, yes! We actually had a "Tron Mode" at the tournament last year that just
flooded the board with food to replicate light cycles.

~~~
tills13
Wasn't there also a bounty snake with tail pinning on?

------
nullandvoid
Looks very cool!

I have a question - with AI nowadays that can dominate pretty much any board
game - is there any hope for anyone 'hand coding' a strategy here against
someone who just trains an AI model.

How does the problem space change in a game such as this where it may be 1v8
opponents vs a 1v1 game such as chess I wonder

~~~
bvanvugt
This is a super interesting question to us, and to be honest we're not sure of
the answer. Is it possible for a single ML snake to achieve 100% 1v1 win rate?
What about 1v7?

What we've learned so far is that playing against multiple snakes, especially
AI/ML driven snakes, adds an incredible amount of complexity to the game and
the top ranked snakes tend switch around quite a bit as players adjust to
attack/defend specific strategies.

If anyone has formal theory around this sort of problem, we'd love to
investigate further.

~~~
ggggtez
Sure, the answer is trivial: 100% perfect agent isn't possible. Just have an
AI play against itself. Since the game is simultaneous moves, there is no
"first move advantage" or anything, so it would play out exactly as a mirror
(give or take some random noise in the model). The only thing that would break
the symmetry is where food spawns, which also would just be a coin flip which
snake it would be close to.

In a 8 player game, it's a little different because there are 'side' and
'corner' positions. Obviously this isn't symmetric anymore, so if you played
many games, one position would make itself clearly superior. That likely
depends again, on the probability of food appearing in a snakes "zone of
control" which you could represent with a voronoi diagram.

My gut instinct is that a 'side' position would eventually be revealed to be
stronger because the snake has more options and freedom.

Of course, in a tournament setup, it's fully possible for an AI to have 100%
win rate just by random chance, because you are only playing a finite number
of games.

~~~
YokoZar
More than 2 players adds another level of complexity: alliances. Snake is a
bit like Risk in that it's possible to attack a specific player while
signalling intent.

We should expect any proper AI to read and understand the others and work out
who should be avoided or ganged up on. Rock-Paper-Scissors tournaments have
bots that use game moves to recognize eachother and then dump all their points
onto a single player -- something similar could happen in Snake as well.

------
0xBA5ED
This could be appropriately called Snakes on a Plane. Sorry, couldn't resist.

------
MattyRad
Does anyone have a list of competitive programming challenges like this?
Specifically where you're programming a board game against other algorithms.
Googling "competitive programming challenges" doesn't yield a lot of good
results.

I'm aware of [http://fruitbots.org/](http://fruitbots.org/), which I had a lot
of fun with.

~~~
squidpack
These are seasonal and for recruiting but you might be interested:
[https://halite.io/](https://halite.io/)
[https://terminal.c1games.com/](https://terminal.c1games.com/)

------
wyldfire
> Battlesnake Tournament March 2, 2019 || Victoria Conference Centre

What continent is this in? From the sound of things it's in a Commonwealth
country but that really doesn't narrow it down much ;)

~~~
dkelsey
Victoria BC Canada Eh?! :)

------
gschier
Just curious, what would be the best hosting option for beginners to use for
their snake API server?

~~~
tills13
Historically, they've recommended Heroku... however, their dynos have a cold-
start problem, causing your snake to sometimes timeout. I would recommend
using an AWS free-tier instance if you have the option.

~~~
cakebrewery
I remember that, they recommended a workaround last minute for it. Our snake
depended on simulations so we just spun up a beefy GCP instance for a short
period at the expense of a few cents.

~~~
tills13
hah! last year, for our bounty snake, we used a c4.2xlarge. Still, we could
only manage a depth of 6-7 before hitting the response-time limit.

------
mayli
Dunno if anyone still play/remember this version.

[http://www.hacker.org/worm/](http://www.hacker.org/worm/)

------
jaimex2
For those that clicked thinking there be an actual multiplayer snake game over
http:

slither.io

Be warned, this can ruin productivity in your day.

~~~
jsmeaton
We ran a hackday where we attempted to build a multiplayer snake over
websockets using Django channels. I don’t think I touched on it in the write
up, but websockets/tcp is the wrong choice for this kind of game.

Write up: [https://devblog.kogan.com/blog/kogame-django-
channels](https://devblog.kogan.com/blog/kogame-django-channels)

Game: [https://kogame-snek.herokuapp.com/](https://kogame-snek.herokuapp.com/)

Disclaimer: it’s not very good. It was a one day project.

~~~
davewasthere
I'm surprised that Websockets is the wrong choice. What would be the right
choice? WebRTC?

~~~
jsmeaton
Yes, UDP is needed, otherwise you get lockups. We incorrectly attributed
rendering delays to react rendering rather than TCP.

------
dkelsey
Looks better every year!!

------
snek
we need more snakes in programming

------
obilgic
Couldn't this be distributed?

