Background

It was early August of 2016. I’ve still had been playing Dota 2 a whole lot and TI 6 was coming up. I’ve gotten a Raspberry Pi , but haven’t found a great use for it. I’ve never actually done a project with it before, and had very limited experience with electronics all together.

A good idea is very inspirational though. Tournament final was in around 2 weeks, but I set a goal for myself to watch the final games with the map adding to the atmosphere.

Design: electronics

Since my electronics knowledge was limited to controlling GPIO, I’ve decided that’s exactly what I was gonna do. Each tower will have a pin corresponding to it that I could turn on or off.

People familiar with Dota or LoL might be doing some counting in their head. Yes, there is a lot more towers than there is GPIO ports. Clearly, what was needed was a port extender. I got 2 MCP23017 s, each of which has 16 inputs, totalling 32! Perfect for the job. Spoiler alert I forgot 4 towers next to the throne, 2 on each side, and didn’t find out until sharing this creation on reddit .

It took me a while to find out how to work with these, as no library had good support for them. After reading their spec and implementing the protocol I felt like I was Tony Stark, building the costume from the scraps in the cave. There were some similarities to working in a cave; I had no knowledge of soldering and had the cheapest iron I got from Walmart; no working surface except a piece of cardboard on the table (to not ruin the table). It didn’t matter, because I had a deadline that wouldn’t be extended for me.

Design: software

I knew pybottle at the time from a previous project, so that was the brain of the operation.

Actually gathering the data for the towers proved to be the most tedious and complicated part of the project however. There were no API’s at the time providing real-time data. Reading memory was beyong my skill level, but also had the potential of getting me banned because of VAC.

So in the spirit of doing the most obvious thing I did the following:

Detected start of the game by detecting start screen’s pixels

Took a screenshot of a part of the screen

Manually checked each a pixel inside of each tower to be the correct color

Sent the data to the server

Updated the LEDs

Of course this had issues:

Latency

Player icons would block towers making it look like they fell

Dependency onto my current resolution

Only in-game viewer support, because Twitch streams might lose colors in compression

Dependency on the layout

Conclusion

In general, there were a lot of issues with the project. Electronics were treading the limits for Raspberry Pi’s supported current like maniacs. My script had to be manually started before the game, and the next GUI update broke it. But for some period of time - around a year or so - it added a great deal of atmosphere to every match I played.

Photos