At tonari, we love Rust.
We love it so much we’ve built our entire technology stack on it, from the image processing software that handles our high-throughput video pipeline, to the firmware powering our little control panels and rotary encoders. And you know what they say — when you’re in love, you want to tell the world.
That’s why we organized 2022’s edition of the Tokyo Rust Game Hack event! This gathering, which we also hosted in 2019, is a great excuse to meet Tokyo based rust developers for a fun night of pizza, beer, and… Gaming? Developing? Gameveloping? This isn’t your typical game jam; read on to find out why.
Opening our doors
Despite the weight of the last three years, it’s clear the community’s spirit hasn’t fully rusted out (har har). Soon after opening the doors to Straylight — the non-profit maker space from where tonari mainly operates — we were taken aback by the energy of our attendees. We weren’t quite sure what to expect, so we were super grateful to receive a stream of enthusiastic, chatty guests from all corners of the world.
We could write an entire article about every guest’s workflow and background; let’s just say that some of the setups they brought were pretty unusual. Once we got introductions and drinks out of the way, it was time for…
The Bombercrab Challenge 💥💣🦀
So what was the Bombercrab Challenge? As we hinted at before, it was neither a game jam nor a game proper, but something squarely in between. If you’ve played Bomberman in the past you already know the basics: characters move around in a grid, dropping bombs that explode in a cross pattern, with the objective of taking every other player out or, in our case, to survive the longest in the “hill” area of the map.
The twist, and what made the game attractive to our rustacean guests, is that they didn’t get to control their characters with an arcade stick or a controller. Instead, the character’s brains were written in Rust and uploaded live any time, even mid-match! Setting up the environment through our template was a matter of minutes; replacing the
team_name methods was enough to make a character ready to go.
The Bevy + WebAssembly magic required to make this happen is worth its own blog post, but suffice to say it was a very interesting challenge with a lot of subtle questions to consider. We’ll explore the inner workings in detail another time; today we’re here to talk about our participants’ inventiveness. Hang tight, because there was a lot of it.
An interesting aspect of this challenge is that it wasn’t limited to physical attendees; the game was streamed on twitch (click for the VOD), where remote players could participate in the same round. Shortly after kickoff and solving a couple minor technical hitches, the first character entered the arena, to great success!
Eh… Maybe not so much. Characters had to make do with a very limited view of their surroundings, so it would take some time for characters to avoid being hit by their own bombs, let alone their opponent’s. In other words, we’d be seeing the image below for quite some time. Thankfully the evening had barely started, and pizza came just in time to ease everyone into some deeply focused hacking.
Something that surprised us is how analytically most players approached the challenge at first. Rather than jumping directly into coding their strategy, several people spent their first hour poking and prodding at the inner mechanisms of the game. In this phase, we saw a few characters with suspicious names show up — perhaps testing the robustness of our string validation — and a few others crash and burn as they, deliberately or not, tripped the limitations we had set in place for the character AIs. No infinite loops taking the game hostage!
Speaking of names, a few keen players noticed that player names could be used as a very primitive way to debug and introspect on the character’s behaviour, since the structure of the game otherwise allowed few ways to understand why the characters were failing to do what players intended. At this point of the game, mysterious numbers starting appearing on top of characters, their meaning each team’s guarded secret. For some, it helped them know the vision range of their characters, for others the value of their own internal variables.
A quick trip to Finland
While the game supported a constant rotation of maps in an alternating pattern — a simple, classic map followed by a more inventive one — it soon became clear that we had been a bit… optimistic with the size and difficulty of the special rounds. The poor bombermen had little to work with, given their limited, slowly expanding view of the immediate surroundings. While our attendees would end up surprising us even in the hardest maps, we needed to do something quickly to make the special rounds remotely winnable.
Thanks to the wonders of open source, team
moimoi contributed with a map cleverly shaped like the flag of their home country, which soon turned into one of the most fun — and definitely one of the bloodiest — arenas thanks to its brutal simplicity.
It was in the first round of the Finland map that we saw our first victor emerge. Congratulations to
wholesometypes on Twitch) for taking the first of what would be many victories. It was certainly no fluke due to the map’s size:
sometypes would quickly become a menace in the following rounds.
With the ice broken and this first victory as a motivator, characters got smarter, preferring picking up powerups to walking into bombs, replacing their aimless wall-walks with a more orderly trek towards the hill area. More victories were had, many by
sometypes, who supplemented their initial peaceful strategy with more active evasive maneuvers, and soon also by
Mark from team
Polyglatte, who found a great niche in the Castle map, and
Hidari-Kun from team
Reiwa, who was the last one standing after a particularly bloody round.
Congratulations to everyone who managed to find glory on their way to the hill!
Ashkan’s mad spiral run
No event about hacking would be complete without an insane, out of the box approach that breaks all expectations. While everyone refined their bomber AIs, an unassuming character that seemed to do little but spawn with slightly different names (
Cshkan…) was cooking something very, very unique.
You see, one of the rules of the event allowed players to upload a new character AI any time, even within a round. The intention behind this rule was to allow participants to correct mistakes in their logic without having to wait for the next round to start. However, Ashkan saw something else in that rule. What about if, instead of uploading a new character infrequently, he uploaded a new character for each turn?
By simplifying his character to do a single thing at a time, and building a real time controller app that uploaded a variant of the character on every keypress, Ashkan managed to manually play bomberman, ducking and weaving past the AI driven characters. How exactly this was achieved involves magic too dark to include in this blog post, but let’s just mention it involved a hex editor on a raw
It’s difficult to describe the energy in the room when the fully manual character made a crazy run to the center of what so far had seemed an unassailable fortress: the
Spiral map. Everyone cheered as the character with an ever-morphing name inched its way to the finish line, under an intense time crunch, punctuated by a few close calls with its own bombs.
The ensuing victory, even though comparatively small in its 17 points, was one of the most exciting of the night, and remains the only one on that particular map. A run for the ages!
Game over… play again?
As the evening drew to an end, the discussion moved on to ways to improve and iterate on the game, something that our attendees have followed up with pull requests. It’s amazing to see the energy they brought to the event carry on after it; the spirit to give back is what keeps open source alive, and what gives us the motivation to come up with the next gathering. We already have ideas on how to tweak the formula, so make sure you keep an eye on the usual channels!
Thanks everyone that helped make this event a great success! If you missed it, don’t worry; we’ll strive to continue to make events accessible to outside participants. If you’d like to host a game event yourself, our game code is fully open source, and we welcome contributions.
If you’re a Rust developer in Tokyo and you’d like to get in touch, don’t be shy and send us a message to email@example.com. We’ll be happy to let you know when the next event is happening. And if you'd like to generally follow our progress at tonari, please consider signing up for our monthly newsletter.
See you at the next Tokyo Rust Game Hack! 👾