I’m going to avoid the explanation and assume that you’ve heard of Pokémon Go. Since its release a couple weeks ago the mobile gaming app has been one of the main news features of the month. Writers discuss what it says about our culture, why it gained popularity so quickly, what other businesses can learn from it, and more.
For me it was exactly the type of game I was waiting for. Not only does it bring back nostalgic memories of the original card game, but the game is unique with a strong community around it.
Rather than repeat the other articles out there, I wanted to share how my curiosity led me to build a Pokémon tool to work with the Springthrough Slack messaging system.
Our Team and Pokémon
Our team quickly gained interest in the Pokémon game, and when we have things that we’re excited about we share them.
One of our newest tools for communication at the office is Slack. We use it for important business functions, but we also use it to socialize. For example, we have a channel just for lunch plans that you can almost always find someone interested in grabbing a burger, pizza, or sandwich with you. It actually helps us get into the habit of checking Slack regularly. (Perhaps something to note for companies trying to get their team to adopt a chat system). As you can imagine when Pokémon took off we didn’t hesitate to create a Slack channel to discuss the game.
We noticed that other engineers around the world took an interest in the Pokémon game as well. We’re interested in the sheer fun of it, but many of us have curious minds. We can’t help but test what else we can do with the game using our knowledge of how these systems work.
Understanding Pokémon
The online community around Pokémon has been critical to the game’s success. In Grand Rapids, a single Facebook event attracted thousands to Rosa Parks Circle to play the game together. Engineers around the world have been digging into the game – mining data to figure out as much as they can – and sharing the information online. They’ve found hidden rules, the maximum level of the game, and ways to attract more Pokémon.
One of these enthusiasts reverse-engineered the game (basically figuring out the code that runs the game). From there others translated the code into different programming languages and created a multitude of different APIs to help developers understand what was going on behind the scenes. With these APIs you can build tools to do things like find or catch the nearby Pokémon. It is the responsibility of anyone building a new tool to use it wisely, otherwise, you could cheat yourself out of the experience of the game.
My API with Slack
Looking through the data, I thought that I could find a way around a bug in the game. No matter where you are in relation to a Pokémon the screen showed that they were all the same distance away. Not so great when you are trying to hunt them. I wanted to find a better way of showing how far I was from any of the nearby Pokémon.
Glitch showing all Pokémon as 3 steps away.
Our office is basically on top of a PokéStop (technically located at our neighbor’s space, The Pyramid Scheme). Using that as a central point I built a tool to help us see the activity at the PokéStop and see other Pokémon activity around our location.
My Tool
I built a self-hosted, Windows service Web API using Owin as its middleware. The tool has an infinite loop that runs every three minutes, detects all of the Pokémon near our location, and then sends a message through our Slack channel. It provides information like
- Distance from the Pokémon
- Direction the Pokémon is in
- When the Pokémon will disappear
- Lures activated at The Pyramid Scheme’s PokéStop
I imported icons from the Pokémon library to show this information as emoticons in Slack, and if anyone clicks on an icon they are provided with more details on that Pokémon and exactly where it is using Google Maps.
The Pyramid Scheme PokéStop
To find the information for Pokémon lures I used a container object returned from the Pokémon API I was utilizing called Forts. This object had information on all of the PokéStops and Gyms. The problem was that none of the PokéStops had labels, just a generic id number and the latitude and longitude. So I built my tool to loop through all of the PokéStops returned from the API and compare them to the latitude and longitude of our office location. I found which PokéStop was the closest, the location at The Pyramid Scheme, and I saved it. Now every three minutes when the code runs it checks to see if a Pokémon lure has been activated at the Pyramid Scheme. If so, it will send a message to Slack with the lure, an icon, and the time of the expiration. Of course this could end up being an overload of information, so I built restrictions not to give alerts for common Pokémon and not to duplicate alerts for the same lure (so we don’t get notified every three minutes).
Sample notification of Slack message
Future Iterations
As we continue to use the tool I’ve already started planning new features that I can add. The running list includes
- Using a Slackbot to perform a manual search and spit out all of the Pokémon
- Using a Slackbot to update the list of Pokémon we want to ignore
- Adding additional Poke-stops to monitor (in addition to the stop next door)
With this project I’ve enjoyed thinking about something that engages the team in a new way and offers a unique experience. With anything that I build – for business or casual reasons – I try to remember that real people are remembering the experience as much as the tool itself. So far my Pokémon tool continues to generate discussion and more ideas from the team. We’re working together to build something cool.
Our Pokémon team: Team Mystic