Jakob's Blog coding for fun and growth

Gamedev #5: Version 0.2 Released

Finally, with the completion of the transition to a new web-oriented game engine, Paddlers version 0.2 is ready. In this short post, I summarize the changes and what they mean for the Paddlers browser game.

This milestone has been a lot of work, although it barely shows in the demo. For the past seven months, I implemented zero new features. Not that I am out of ideas, quite the contrary! I am rather unsatisfied with the game-play and the UI of Paddlers as-it-is and I am keen to improve that. However, I had to hold back. I needed to get two big technical changes done before adding more features on top of the already shaking pile of code.

Switching out the Game Engine

First, the game engine that I used so far, Quicksilver, entered maintenance-mode. I was torn between moving to another established game engine or just creating my own engine that is focused 100% on the web. I ended up going with the latter. Thus, Paddle, the game engine for Paddlers, was born.

A beta version of Paddle is now deployed with Paddlers 0.2 but it is too early to introduce it as an engine for other users than myself. But I am pleased to tell you that Paddlers 0.2 looks almost identical to 0.1.3, even though only a small part of the rendering code from Quicksilver has been integrated into Paddle.

While writing my own graphics backend for Paddle, I was able to fix a thing or two that bothered me previously. For example, before WebGL rendered exactly one pixel for each browser pixel. Depending on the pixel density of the device’s screen, this ended up looking quite pixelated. Now, in Paddle, I can control exactly what resolution I want. See below for a direct comparison before and after, using the same source image.

Image: Comparison between an image rendered in Paddlers version 0.1.3 against 0.2.0 Shocked face rendering compared between versions.

No More Stdweb

The other big problem was that Stdweb is dead. Quicksilver used Stdweb and so did I in the Paddlers frontend for many things, such as networking, threading, and text display. Moving over to wasm-bindgen took some time but it also brought new opportunities that make it completely worth it.

Already I use Mogwai to create interactive HTML components. For example, in the mailbox view of Paddlers, each mail in the mailbox is defined by a Mogwai component using RSX-macros, comparable to JSX used in certain JavaScript libraries.

Image: Screenshot from Paddlers where Letters are shown, which use Mogwai components. Screenshot of Paddlers 0.2.0 in the mailbox view

I hope to present a tighter integration of Mogwai in futures releases of Paddle. And the same should be possible with other existing web frontend libraries, potentially including JavaScript libraries.

Look Ahead for Paddlers

At last, I can move on and think about adding new (major and minor) features to Paddlers again. I hope that the next release, presumably 0.2.1, will contain not only fixes to bugs that I introduced with 0.2.0 but also finally brings out something that can be considered a game.

I am now trying to identify a minimal set of features that would make the game worthwhile playing. If I manage to keep this list short enough, it might be possible to pack them all in the next release.

However, Paddlers is primarily an experimental playground for me to do some hobby-research on how Rust and web-technologies can best be merged together. I will continue to explore and write articles about my experiences.

Next post in series: Gamedev #6: New features in 0.2.1

Technology Stack

Rust

The Rust programming languages had its first stable release in May 2015. Although it is in its core a systems programming language, it has been adopted rapidly in different environments. Many programmers love using it and the community is growing quickly.

WebAssembly

WebAssembly is a new web standard (1.0 since October 2017) that allows running bytecode in the browser. While it is possible to compile C/C++ and other languages to Wasm, right now the tooling for Rust is definitely the most advanced. Partly because both the Rust and the Wasm project originated at Mozilla and are actively pushed by them.