back

by sixhobbits·10y ago·view on hn ↗
I haven't tried this yet, but based on similar challenges I've participated I'm surprised by the fact that your bot moves by calling an http endpoint. Considering the 1 second move limit, I image it's difficult to time your moves right to guarantee that they arrive on time.
3 comments
I feel the same, I have participated in aichallenge.org before and everything was run server-side, we had a 1 second move limit too, I have not run any starter yet to try it out but seems like using HTTP will have big issues with timing, I would prefer something that connects to a socket and keeps the connection up, would reduce some of the latency of establishing a connection.

Some people created a tcp server for the Ants one that allowed that: https://github.com/berak/ants-tcp I don't remember much of the details, since it was nearly 5 years ago, but it was an awesome thing to participate in.

Does the server not respect `Connection: keep-alive` ?
If you have an HTTP session with keep-alive, it works well enough. I played Vindinium for a while and only very seldom experienced timeouts unrelated to my code.
Also having the code run on players' computers means there's no way to stop cheating by having a human player providing some of the intelligence.