The gospel of NodeFly is to encourage monitoring your development from the beginning, and part of our mission is supporting and spreading the Node.js itself. As a result, we are always curious about fun, cool and innovative uses of Node.js.
We discovered Atomic Brawl, which describes itself as “a game of strategy, collection, and jack-assery, where you compete against others for the right to call yourself “’That Guy Who Is Good At That Game’”. Sounds fun enough to pique our curiosity.
We talked the creators of Atomic Brawl and heard some words and phrases we’re always open to hearing: laying a trap, tropes of Tolkienesque fantasy, and shadow classes. Read on and enter the Atomic Age.
NodeFly: With Atomic Brawl you’ve got, and I quote, a “competitive collectible tactics game.” Tell us a little about the game and playing experience.
Atomic Brawl: Atomic Brawl is a little difficult to describe in that you can do so simply as Chess, lots of pieces - or as verbose as calling it an “asynchronous multiplayer browser-based collectible strategy and tactics game”, but for those familiar with the games we would say it’s like Final Fantasy Tactics hooked up with Magic The Gathering and made a little online baby.
The core game experience is you managing an army battling against someone else with theirs, both sides attempting to destroy their opponent’s core. Game turns can be taken over the course of several days, whenever you have time; or if both players are active, in about 15 minutes. All games are playable in your browser without any download required. Furthermore, you can start a game in your browser, continue it on your mobile device, and seamlessly take turns on either throughout your day.
At launch we plan to have about 180 different cards that you can take into battle, each offering very dynamic interactions and interplay. Instead of constructing a game where the biggest number wins, Atomic Brawl attempts to create a flexible and dynamic game system where we could go wild with ideas and have cards carry through with very complex mechanism. For a simple example, you could lay a trap (which would be hidden to your opponent) that when triggered allowed you to control their Brawler; once done, because you have control, you could then use this card to attack their own units and once that wraps up play another card allowing you to sacrifice this card and gain life.
Finally the game is collectable. At start you have access to a limited number of cards. As you play you gain cards, and in-game currency allowing you to expand your collection and increase your strategic and tactical options.
NodeFly: Your blog provides a nice behind the scenes look at the development of the game. In addition to the fantasy element, there is also a quirky sense of humor. We definitely appreciate that at the NodeFly offices – can you tell us how that sense of humor helped shape the game?
Atomic: We felt like too often with tactics game, and potentially games in general, developers too often fall into the tried and true tropes of Tolkienesque fantasy, future war, or world war N - we feel this is brain numbingly boring. We wanted something more interesting, we thought if we could create a world that was similar to present day reality but quirky as heck that would be a more captivating and fun world to play around with. Drawing from the real world also gives us a broad range of ideas to pull from, as we’re really free to do nearly anything we want - regardless of how crazy it is. The main source of inspiration for this approach was a fantastic classic game called Earthbound (or Mother 2 for the hard-cores) which really showcased how you take the world we live in, add some crazy, and make it super compelling.
Atomic: Geeking is what we do best! We’ve been developing this game for an almost embarrassingly long time at this point. We started just over 2 years ago and have had quite a few twists and turns along the way.
Working our way from the client backwards, our client, as mentioned before, is completely browser based. We construct the client UI using pure HTML elements. The animations are all done using CSS3 state transitions. We’ve constructed an abstraction layer on top of all this to simplify working with this such that we could swap out a canvas based approach (as we did at one point) if we every decided to go down this road.
The client talks to the server using a combination of REST based services and Websockets. We utilize basic REST services for things like leaderboard retrieval, deck management, game creation, login, logout, etc. This is all implemented in what we call the metagame server, which is a Node.js based server utilizing Mongo on the backend for state management.
Websockets are then used to connect to, and communicate with, the game server. The game server is another Node.js server responsible for receiving game inputs from the browser, executing them, then returning the results to the client. In this sense the client is very “dumb” in that no logic is performed there, it simply relays to the user what input is allowable at any given time, submits what the user would like to try to do, and waits for the server to tell it what the result was. The browser also utilizes localstorage to cache data in order to reduce the dataset you need to retrieve when you connect to a game you’ve played before.
Finally, we also have 3 other Node.js server types to perform other functions. Firstly we have a “notification” server, which notifies users when there’s an action they can do on the site. Next we have a “matchmaking” server, which is responsible for finding games for any connected user and intelligently matching them based on the users skill (which is implemented using the glicko2 algorithm). And finally we have our “overseer”, which is responsible for spinning up new game servers when required. All servers communicate with each other using 0mq.
All of our server and client code is done in coffeescript. In doing so we share an incredible amount of code between both which is a huge win for software simplicity.
NodeFly: Any particular challenges using them?
Atomic: You don’t work on a project this long without challenges :) Some of our bigger challenges recently have been related to getting our servers running and processing games in a fast and memory efficient fashion.
The V8 interpreter is an incredible piece of software, but you can cause it undo stress if you’re not careful. Understanding how V8 uses shadow classes, allocates memory, and executes code has been very important in squeezing everything out we can. Once we started profiling and paying attention to these things we were able to pinpoint several places where we were able to reduce memory consumption by 2-3 times, even 10 times in some cases, and also reduce the processing time dramatically.
NodeFly: Right now you are still building. When are the floodgates opening? When do you expect Atomic Brawl to go public?
Atomic: At current we’re in closed beta with about ~150 users, who have helped dramatically to improve the quality the game. We have a few big ticket items remaining, and a lot of polish left to do. We will launch in the summer of 2013.
NodeFly: Who should check out this game?
Atomic: Everyone! All ages, genders, and experience levels! Some of our happiest players picked up the game after not playing games since childhood and they are loving it, although we have plenty of gamers as well. The breadth of appeal this game seems to have on people has surprised even us.
We’d like to thank Atomic Brawl for giving us a look at their addictive game and recommend you get ready to start playing by visiting their web site.
Know of any cool, creative and fun uses for Node.js that you think should be profiled? Email us at firstname.lastname@example.org and let us know. And in the meantime, search our blog for more NodeFly Buzz articles at http://blog.nodefly.com or use our dashboard at http://www.nodefly.com to monitor your own Node.js product!