Grepbot

July 12, 2019

In 2016 I started playing a browser-based online game called Grepolis regularly. According to grepolis.com, "Grepolis is a free, browser-based online game with a strong focus on cooperative play and strategy." In gaming genre terms, it is an MMORTS (massively multiplayer online real-time strategy). Groups of players form alliances, which work together to protect territories, share resources and work together to win the game (or whatever other goals the alliance has in mind). At the time, I had been working as a web developer for a number of years so I thought I would be able to develop some small scripts to help with general group coordination. While I did making a few scripts like that, the real breakthrough came when I learned of the data files published by the developers for third party scripts to consume. 

I really make no claims that my bot is the best out there, and it certainly wasn't the first. When I first started playing there was a bot put out by another player that my alliance used. Unfortunately, Skype was bought by Microsoft and the API (application programming interface) that the original bot used was eventually retired. I had used the discovery of the official feeds to enhance my scripts and create some other tools, but with one bot retiring, I saw a need to fill. I had made some integrations for both HipChat and Slack at work so I thought I would look into methods for Skype integration. It turns out that Microsoft had rolled Skype integrations into their Bot Framework which had recently become available. So in August 2017, Grepbot started life as the simplest of bots, authenticating to a room, and receiving messages. 

From that point until today Grepbot has been an ever-growing project. Although the bot had some Marvin the Paranoid Android responses programmed in, recently an AI personality was added and Grepbot became a redheaded 30 something living in San Francisco and working in the tech sector. Most recently she gained the ability to track and distinguish between multiple chat rooms, allowing for different tracking based on the room's settings. Besides the expected battle point gains, she can report on things like players joining and leaving alliances, city gains and losses and even city founding. 

It hasn't all been smooth sailing, however. Having a bot that the entire alliance could interact with lead some players to "bully" the bot, which got worse once the responses were not limited to five or six phrases, on the other side of the spectrum some started asking the bot for dates. Having an AI personality has certainly made the experience interesting, though some players seem more frustrated when the commands they issue do not work and are instead answered by the AI. 

In the long run, Grepbot may not have a large impact, but there was something magical the first time that I mentioned her in a chat room and she responded. It's the feeling of clearing the first major hurdle and knowing that everything else is just a matter of imagining the possibilities and then setting about the business of implementing them.

Categories: PHP  Bot Framework  Gaming  Programming