Reimplementing the Deal-O-Round game in Flutter - part 1

Sep 1, 2020

Earlier this year I mentioned  multiple times that I’ll reimplement a game in Flutter. In this blog post I’ll tell a little bit more about that game so I can draw a nice trend line while also paying tribute to the original project. In the next post I’ll focus on the Flutter reimplementation itself.

In 2014 we formed a team named "Bad Wolf" with some of my buddies and competed at the 59 Days of Code hackathon. We placed on the podium with an interesting card game, which had a hint of a Tetris feel and also a hint of slot machines. I still remember when we were brainstorming with Tim Yopp at the Bitwise Mural District building next to the pinball machine. At that early phase all bets were off and we were just trying to figure out which direction we wanted to go, what the game would look like exactly. Tim showed a deck which had round cards and we realized that it was unique enough that it could distinguish our game from other card games. We figured that the round cards in the game could be like poker chips. We started to mock the game logic progress on the screen by moving the cards on the floor step-by-step.

We already knew that we’d like gameplay where the cards would fall from the sky and fill up the board area similarly to how gemstones fill the playfield of Candy Crush / Bejeweled. In Tetris the elements fall from the sky towards the bottom as well, but our logic is closer to Candy Crush. In Bejeweled you need to match the same type of gems for the removal of those gems, while in Deal-O-Round the player would need to find poker hand combinations. It’s hard to find five-card hands, so three and four hand variations are allowed.

Mike Twohey helped in many areas, like the home screen design, background music, and I think he came up with the final name of "Deal-O-Round" which stuck. Vernon Burt was a great team member as well and he was planning the back-end where we’d allow competition within defined circles of players, basically adding a social media element to the project. Mike and Vernon designed and helped with the implementation of the level logic and a few other game areas.

I also still remember how I was submitting the first Play Store version and a few refinements well into the wee hours on the morning of the big closing convention day of the whole hackathon. What I loved about 59 Days of Code is that it wasn’t just a 24- or 48-hour dash, but throughout the 59 days participants could really put in time to develop an idea somewhat past an MVP (Minimum Viable Product) phase to a more mature state. Surely it required more dedication and time, but that pays off. During the two-month period the team had multiple meetings a week and we needed to check in with the hackathon jury several times: pitching our ideas, creating videos, and presenting our progress. At the Fresno Convention Center we had a booth with proper branded drapes and Mike also ordered branded casino chips with a QR code pointing to our website. People could test our game on Android demo devices at our booth.

I convinced the team to use the Google PlayN framework to implement the game. PlayN is a cross-platform game programming framework which is able to target Android, iOS and even the web (and a few more). I heard of it in-person at a Silicon Valley Devfest in the autumn of 2013. At that time some Google engineers were contributing to it and for a while it was backed by them. With PlayN you write your code in Java, so you not only get the benefits of a statically typed language but Java was also the de-facto standard for Android application development (Kotlin was picked up by Google many years after 2013). Our main target platform was Android so I knew PlayN would provide an extremely smooth path to the Google App Store. I was keeping an eye on PhoneGap (later rebranded as Apache Cordova), and Ionic would be a great choice if we had targeted the web as our primary platform, but I prefer statically typed languages over JavaScript. Several of us were also .NET skilled developers, so we also very well knew about Xamarin, which could have been an alternative, but I liked that PlayN would also provide a web port of the game. This is why you can play a demo version of the PlayN version on our website.

PlayN supports the web port leveraging GWT (Google Web Toolkit) technology which was already a popular way of providing a front end for Java web applications (even enterprise applications like OpenEMPI or SOMEPI). This also means that if the web platform is targeted, any imported Java libraries must also be GWT-supported (or translatable). The iOS port of PlayN is somewhat complicated.

An advantage of PlayN is that for menus and non-action views we could utilize the Triple Play framework: it provides traditional 2D widgets like text boxes, menus, rich text, and buttons. Therefore we would not have to paint these things on our own on a 2D game canvas. That can save a ton of time and design resources; one example of this is the Settings screen. Originally the home screen was also built with Triple Play, but later we used Mike’s design.

Finally, PlayN has adequate hardware acceleration support. The web port uses Box2D under the hood which has WebGL support, and theoretically Android as a straight native path should be fine as well. However, Tim Yopp showed how his old phone heated up during gameplay. I was shocked because although the phone was very outdated and not a flagship model, I didn’t think our game should have placed too much GPU or CPU load on the device to behave like that.

PlayN became an independent project from Google and due to other industry changes the multi-platform support is provided by the RoboVM project. Over the years React Native also emerged as a popular cross-platform alternative, but just as with Ionic or Cordova I’d consider that only if the game’s primary platform were the web. The new kid on the block is Flutter, and when web platform support appeared, I became dedicated to reimplementing Deal-O-Round—but more on that in my next blog post.

Comments loading...