Hacker News new | past | comments | ask | show | jobs | submit login
Generals.io Bot API: Build bots to play against humans (generals.io)
182 points by vzhou842 on Feb 3, 2017 | hide | past | favorite | 48 comments

Do bots watch ads?

For the last several weeks I've been an avid generals player. For awhile I was even ranked #7 on the FFA ladder. And I have to say that this is the second change in about a week that has left me confused about who generals is trying to appeal to. Maybe the bots will be fun for humans to play against but I doubt it. Maybe this will be a benign change and the quality of the bots that play generals on the non-bot servers won't improve much from what they are now. But either way why is an ad-supported game encouraging bots to try and take it over? What happens when the bots become so good and so prevalent that humans can't hope to compete? Why would anyone want to play?

Though I guess in the end I don't really care all that much as the recent changes to the movement scheme have really put me off the game. High level play used to be about feints and visibility, cutting off your opponents tendrils whilst building your own, pulling their forces away from your king while trying to find theirs. It really had a nice balance. Now, not so much.

I don't want to seem too sour. I had a lot of fun with generals [thanks devs] but now I'm in search of a new favorite game.


I think I'd like to point out two very important points you may be missing:

1. This was implemented directly to combat the prevalence of bots on the EU & NA servers (and the annoyance some players were facing when they were just playing AIs all the time), where you're now not allowed to bot on. Players have the option of choosing whether or not they wish to play against bots, but if they wish not to they can still play on the NA and EU servers.

2. We're supported by ads, but that doesn't mean we want to stop people enjoying the game in their own ways. We still have tens of thousands of players daily on the other servers, so a few tens of pounds on a bot server for people to compete in programming against one another doesn't seem too problematic.

And, to address your movement concern, it was a tough decision to make. But we wanted to allow everyone to enjoy the game, even people with lag or on mobile devices (where control is significantly harder). If you dislike the new movement settings, you are able to disable them in the options menu.

I've spent far too much of my life playing you're damn game, and now you just went ahead and ruined my weekend.

Thanks! Keep up the great work ;)

I debated whether to respond to your comment at all. Let me first say that I wish you all the best and hope for your continued success. However, some of what you said feels like you're asserting that "up" is in fact "down". So let me first establish my bona fides with this screenshot that was taken on the 25 of last month:


so you can believe me when I say that I was a pretty good player that spent a lot of time playing your game.

> This was implemented directly to combat the prevalence of bots on the EU & NA servers (and the annoyance some players were facing when they were just playing AIs all the time), where you're now not allowed to bot on. Players have the option of choosing whether or not they wish to play against bots, but if they wish not to they can still play on the NA and EU servers.

Respectfully, yours is not the first game to have these types of problems. People grief and cheat in every online game where it's possible. Creating bot-only servers will not curtail bot use on non-bot servers. It will instead give people who grief and cheat stronger bots that they can pull down from github or wherever and adapt to play on non-bot servers.

They only thing that will stop people from using bots in bot free zones are technological countermeasures. Captchas being the classic example of such technology.

> If you dislike the new movement settings, you are able to disable them in the options menu.

That fact that you suggest this as a way to address my concerns makes me wonder if you actually play your game outside of testing it to see if a new feature works.

When you changed the way players can move you not only changed how I play the game but how everyone else plays against me. Essentially, with this latest revision you've created a substantially different game. Using the option to limit how I move without it changing how my opponent's move would only serve to put me at a disadvantage. It would not roll back the clock to the make the game be like the old game I liked.

All of the tactical nuance that the game used to have was based on timing and multitasking. High level gameplay steamed from getting inside your opponent's head and trying to force them into mistakes. The key to doing that was to realize that if an opponent is trying one thing they most likely aren't doing something else. If you could get them to focus on the wrong thing you gained the advantage. In my opinion the old game had a great balance between strategy and execution. If you weren't good at both you couldn't win. The new control scheme throws that particular balance out window. It's hard to describe in words because it's a million little differences that add up to a whole but suffice it to say that games now to me feel less like a sword fight and more like people running at each other with pots on their heads.

Another avid player here, also ranked in the top 10 for a decent amount of time, now in the mid one hundreds.

I think the primary difference is now that moves can be infinitely queued, whereas in the past moving into an enemy's territory took time and concentration. Now, if I know where enemy cities are, I can order them to be attacked within a few seconds. Previously players were required to constantly expend time and concentration on each move, making multitasking and balancing a much more fine dance.

The new system tends to favor troop numbers above all, prioritizing strength over strategy. Before the update, if I had 2/3rds the troops of an average opponent by the time an 8v8 was down to a 1v1, I had about a 50% chance of winning. Now it's _maybe_ a 10% chance.

I don't play the game, but this is an interesting discussion to hear you players cover. Are you sure it's not emphasizing strength over APM and not strength over strategy? (The description you give makes it seem like that)

This is really what the argument boils down to. Whether being able to move only once at a time could really be considered strategy or just mechanical skill.

Personally, I feel that this falls under the category of mechanical skill, because you can play just as well with this movement style as you can in the previous style, it just requires less ability to click and press a key exactly every 500ms.

It sounds like techniques that brought you to the top aren't as successful with the new gameplay that the update introduced. My personal take is that the new update makes the game more accessible by relying less on mechanical skill.

You can still get in your opponents' head; all that effectively changed is that movement in opponent territory is faster.

I support the developers' decision to simplify the controls of the game. Although might break the strategies of a group of power users of the game, it's best for its growth in the long run.

I was never able to break top 60s in rank because of lag. I asked several players who could move much faster (it sometimes felt like they were cheating), and they said they were near NY, closer to the server. It was unfair that they dominated, but the update has leveled the playing field. Thanks devs!

Are you going to implement anti-bot measures on those servers?

Let's be honest, this is not possible.

Yeah but they could try and it would be fun to watch.

The point I was implicitly making is that setting up a new server for bots and declaring "no bots allowed" on the main servers is not quite enough.

We have some naive heuristics to try to detect bot movements (low ping, not many queued moves, moves every turn, etc) in the works, some of which are already implemented to try to reduce the numbers of bots on the main ladders. It's a tiny bit tricky to do however, most of the methods are still just going through testing.

We're hoping that people consider the reason we're trying to limit their access to the main ladders and do the honourable thing of keeping the bots in the bot ladder. It's slightly harder than just changing the URL, which we hope will help dissuade individuals.

Neural nets will behave pretty human like. Now that you've told everyone, we can start building bots that do these things.

(I wasn't using a bot if it wasn't clear.)

he could do some ML with the real bots to try and detect behaviors

I think everyone agrees (even if unconsciously) with your feelings. Most players had a defense advantage in movement speed before, but no longer. Reduced security and other implications favor large troops and rush strategies. Which leaves traditional strategies you mentioned less effective. The problem is, war, in the real world almost always has some kind of defensive advantage. So the cohesion of the General narrative was disrupted negatively as this core expectation is broken. My 2 cents even if non-specific, because I think this is the right perspective for highest-level analysis. I don't necessarily feel the new change is bad. But it changes game mechanics to favor play-styles where do not tell a cohesive story.

My example is just anecdotal. I used to play and, in just 300 moves was able to tell a full story. Of how I advanced, beat a certain enemy through an interesting battle. How I went into unknown territory and was surprised by what I found. There really was a cohesive narrative and nice story-telling in the previous version. This is what made the game fun, fundamentally. Mini stories of kingdoms locked in war, with interesting battles.

Now, the stories are not told well. Since I am queuing constantly, I am not even paying attention to where my general is most of the time. I am half-blind charging on my bull hoping I run over a general. And likewise, if I am on the defensive there is nothing to do but hope the huge army does not snake through and hit my general. The sense of a story was largely destroyed.

And that's why I think the game is less fun now, even if it is not so obvious why.

> the recent changes to the movement scheme

What was changed? I don't remember how the game worked when I first tried it.

We added the capability to queue moves through/into unknown territory. Before you had to keep on clicking & moving, clicking & moving.

I just want to say that I at least LOVE the new scheme!

Formerly, you could only queue moves in territory you owned. Now, you can queue anywhere.

It takes away a key advantage in obtaining territory.

This will be super interesting. I think this game makes very much sense as an intermediate frontier on the road to a StarCraft AI. Here are my reasons:

* The playing field is relatively limited, just a little larger than Go. This makes it much more approachable than StarCraft as you will not need a server farm to get started.

* It has a fog of war, so a bot needs to handle uncertainty and have a memory.

* It's controlled through a web API and allows total freedom for the bot implementation by that.

* There are very competitive humans players.

* There is already a very huge dump of replays to train on.

I really hope this will get traction and establish as an ongoing AI competition. Also it will be very interesting, when the first bots will be better than the top humans here.

https://halite.io is pretty similar if you'd like to play against bots only. Plus it has a great forum that has a few posts on creating a bot using ML.

Halite also looks interesting, but I think with generals bot-makers will have much more possibilities, because there are no limitations for your implementation. The game mechanics might also a little more challenging in generals, especially the fog of war makes a huge difference imo.

You'd be surprised how many implementation options there are in halite. People have come up with starter packages for just about every language you would ever want to use.

agreed, halite is a well run challenge. The site gives a shoutout to halite: http://dev.generals.io/faq

Unfortunately, the halite challenge is almost over and they will shutdown the site afterwards.

This is very interesting and I'd love to play with it. As a player though, the thought of being matched against a bot sucks in the sense that it makes the game less enjoyable. I enjoy winning (mostly losing) against flesh and bone humans. I wonder if the folks of generals.io would implement a different "league" where bots are somehow not allowed.

That is already there :) Only one of the three servers allows bots.

Fix the paragraph on the Bot API page... "Your bot will be self-hosted, meaning you don't upload anything to your servers (we never see your code)."

Oooh, nice catch! Made the fix, will be updated next time we release.

EDIT: Well, I tried, Vzhou beat me to fixing it.

This is going to add a great new dimension to the game, especially in terms of being able to 2v2 with a bot for a partner.

This might revive my interest in Generals, as I found it a mixture of boring and excitingly stressful when I played by hand.

However, because Generals is an RTS, bots might have a pretty steep advantage (although movements take a good bit of time, so it's not as bad as it could be). Does anybody know how bad this is in real play?

Although we haven't had many bots on bot.generals.io yet (early days), my experience of playing against bots on the main leagues show that although we had several dozen bots built, all of them were no match for a competent human being. The only one that comes close is called "Sora AI", but that AI can be easily beaten by anyone in the top fifty odd.

I'd be interested to see if a bot will be able to always defeat players, waiting for what will happen with this latest release.

The bots were all pretty incompetent, but it was INFURIATING to play against a dumb bot that does nothing but attack you.

Unlike a player, where you have a decent chance to juke their stack and cap them (and then have a great chance to win), many dumb bot implementations would just aggressively trade 1:1, basically guaranteeing that you're both screwed.

I got up to rank #3 on the FFA US server, and spawning next to Simple Bot would mess me up more than spawning next to an 80+ (back when it topped out at ~86).

That, and the terrible latency handling (if your internet is acting up a tiny but, you basically have no chance to win), was what made me stop playing eventually.

Well, then I'm glad I think we've fixed both of these issues! Bots now can only play on one server, so people have the choice of playing against them.

Also we've significantly reduced the impact of lag by allowing you to queue up moves, even in enemy territory. Although all real-time games need a certain amount of reliability in your internet connection to work, I think we've recently reduced it significantly. Although, of course, any suggestions you have for improvement would still be useful!

No, that's perfect. Certainly there's always going to be a limit to lag compensation, but it was very frustrating when you could no longer double move, but your opponent could.

Everyone is server-capped at 2 moves per second, and bots will also be subject to networking conditions (ping, lag spikes) just as players are since bots are hosted by their creators.

Yeah but you can also host your bot in a datacentre which doesnt have the same reliability issues as residential internet.

I think the move rate is capped at two per second, so even bots will have limitations in their movement speed.

This is great, I'm glad the developers are officially supporting this now. I had started building a simple bot before this was released https://github.com/pfista/generals

Are all game replays since inception stored in a database? It would be great if you could release one grand zip file to the public that could then be hosted on S3. Even a subset of say all games of the top 200 FFA players would make an interesting training data set!

Already released! You can see the page explaining it here:


It contains 200,000 games of varying levels, so should hopefully make good training data.

One thing that's missing is a tool to reconstruct a bot's input at a particular turn from the replays (they don't have fog of war).

I know this could be a bit of a big ask because obviously it would be too easy to clone the website, but is there any chance of a headless game server that would let us do adversarial training?

I started making a bot last night but it keep getting disconnected in the first 10ish rounds. Anyone else see this and resolve it?

Could you give us some details on this? Like which web socket library you used, the technology you used, etc?

If you copy & paste the example bot verbatim, does that work for over 10 rounds? As far as I know we've got tens of bots working at the moment and I haven't heard this strange problem from anyone else.

I don't have the code handy at the moment but I was using ruby with this socket.io gem 'socket.io-client-simple'

I was able to connect, join a game, send chat messages, just couldn't stay connected.

I basically just converted the JS tutorial on the site to ruby style.

Awesome stuff. I think a bot server is a logical choice and a good one. It will be neat to see what people can come up with.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact