Inspired by the over-the-top stage lighting and pyrotechnics used during e-sport events, [Hans Peter] set out to develop a scaled-down version (minus the flames) for his personal Counter-Strike: Global Offensive sessions. It might seem like pulling something like this off would involve hacking the game engine, but as it turns out, Valve was kind enough to implement a game state API that made it relatively easy.
According to the documentation, the CS:GO client can be configured to send out state information to a HTTP server at regular intervals. It even provided example code for implementing a simple state server in Node.js, which [Hans] adapted for this project by adding some conditional statements that analyze the status of the current game.
These functions fire off serial commands to the attached Arduino, which in turn controls the WS2812B LEDs. The Arduino code takes the information provided by the HTTP server and breaks that down into various lighting routines for different conditions such as wins and losses. But things really kick into gear when a bomb is active.
[Hans] wanted to synchronize the flashing LEDs with the beeping sound the bomb makes in the game, but the API doesn’t provide granular enough data. So he recorded the audio of the bomb arming sequence, used Audacity to precisely time the beeps, and implemented the sequence in his Arduino code. In the video after the break you can see that the synchronization isn’t perfect, but it’s certainly close enough to get the point across in the heat of battle.
With the special place that Counter-Strike occupies in the hearts of hackers and gamers alike, it’s little surprise people are still finding unique ways to experience the game.
>wanted to synchronize the flashing LEDs with the beeping sound the bomb makes in the game
May be processing the audio signal for synchronization – the envelope corresponds to each beep directly from PC audio.
A beep has a very distinct spectrum that should stand out on a Spectrum plot – a FFT of the audio can extract that.
Yes, it’s actually not a bad idea. The problem is that if you move away from the boms the sound fades. Eventually you won’t be able to hear it at all. I wanted a solution that worked all over the map (and even I the player died)
I was also amazed that the beeping isn’t just linear. I tried that first but the blinks was way off..
You could still do both, use the audio sync if available. If it is too far to hear, then synchronization wouldn’t be an issue. :P
This is a really cool project! Talk about increasing game immersion. I have a similar hardware project for another Valve game, Left 4 Dead 2, that keeps track of how many zombies you’ve killed and displays it on a real-life trophy. The Steam API didn’t work quite as well for this one, though. https://www.youtube.com/watch?v=8G3mvy-2taM
Shortly after Valve released the game state API, they turned down the accuracy of the bomb timer (which was REALLY perfectly synchronized, I played with the API and some Hues when it got released) since it could have been used for cheating . You would have been replacing game sense (“how much time do I have left to defuse the bomb?”) with automation.
I think RGB is a new trend. I covered so many topics on RGB and there are plenty of new products coming in the market.