BTM – sales week 04 and porting

Posted on June 15, 2011

Hi everyone!

Today I’m going to skip the weekly “Blocks That Matter” sales report… what? You were expecting it? Okay, here is a very fast recap (with 2 days late!). Right after that, I will focus on the game port for the Windows/Mac/Linux versions.

> Media coverage

This week, I don’t think we got a lot of media coverage… since it was E3! Oh gosh, did you see Rayman’s Origins, From Dust, Journey, Sound Shapes, PixelJunk: Side Scroller? It was quite refreshing in a middle of all that ‘Modern War Shooter’ things.

> Sales

Anyway, here are the sales since the last report.

As you can see, the game sold massively in France and…not much elsewhere, due to a lack of marketing / media coverage.

It seems we’ve got some difficulties to appeal UK and US players!

Here are the numbers, day by day. As you get used to it, it’s not useful to remember you that the format is ‘sales / download (conversion rate)’!

– d23 (6/3/2011) : 61/ 280 (21.7%)
– d24 (6/4/2011) : 86 / 251 (34.2%)
– d25 (6/5/2011) : 99 / 285 (34.7%)
– d26 (6/6/2011) : 47 / 171 (27.4%)
– d27 (6/7/2011) : 33 / 83 (39.7%)
– d28 (6/8/2011) : 33 / 86 (38.3%)
– d29 (6/9/2011) : 28 / 77 (36.3%)
– d30 (6/10/2011) : 27 / 89 (30.3%)
– d31 (6/11/2011) : 37 / 93 (39.7%)
– d32 (6/12/2011) :39 / 84 (46.4%)

– total: 244 / 683 (35.7%)

– global: 1850 / 9558 (19.3%)

And here is the chart of the sales history (including previous numbers):

1.850 sales in one month is not that bad… but this is not what will allow us to eat. That’s why the PC version is really important for the SSS future. We are far away from the 251.355 sales of FortressCraft :]

> From players side

We got more emails from players that finished the game, and they are fairly happy with the experience. So thank you all for your comments, still warm and constructive!

We also got some mails from impatient players who wonder when and how the game will be released on computers, and how the porting is doing.
For the first question, I haven’t got concrete answer yet, but for the port thing, I can give you some info!

> Porting “Blocks That Matter”

BTM is available on Xbox Live Indie Game, so it was developed using C# language and Xna framework. Xna is a framework only running on Xbox or PC (windows only). All of these take advantage of the .NET Framework 4.0, a Microsoft technology.
Since we really want to consider Mac and Linux users, we decided to port the game to those platforms with a single version.

There were some choices to make. I came with 2 solutions, and will see what will give the best experience on the 3 platforms.

>> The ‘easy’ way

Some dev friends (Garry, Marc and Elisée) pointed me out “Mono Game”.

>>> Presentation

Mono Game is a cross-platform port of the Xna Framework that uses Mono instead of the .NET Framework.

So, what is Mono (quiclky)?

Mono is a cross-platform implementation of the .NET Framework (including compilers). It means that if you program using Mono, you will write exactly the same code that if you were using .NET Framework itself… but your code will run on all platforms Mono supports.

Mono only deals with .NET Class/Compiler/CLS, there is no binding for libraries useful to make games (like hardware accelerated rendering, audio, gamepad input, etc).
In order to have such libraries support, Mono Game use OpenTK. OpenTK allows a .NET (and Mono) wrapping of C libraries such as OpenGL (for rendering) and OpenAL (for audio).

>>> Why this is the easy way?

With the last complicated paragraph, you may wondering why the hell this is supposed to be the ‘easy’ way, because it involves a lot of frameworks and libraries so far!

In fact all of those libraries help you to keep your originally written C# code, all you have to do is compile against those libraries, the syntax of your code will be the same. Sexy isn’t it?

>>> What I got so far with Mono Game

The Mono Game actual port take me less than a week-end. I made some modifications on the Mono Game library (which is open source) to be able to run Blocks That Matter because the library didn’t handle XML file loading/parsing, no keyboard input (only touch screen support for iPhone/Android).
There is no audio support for now in Mono Game, you’ll have to write it by yourself by using OpenTK (thanks to OpenAL binding), and make some Xna classes implementation too.
Since the sound support was not crucial for a first test, I decided to give it a try with no sound support.

Here is what I got in few hours:

The rendering is a bit ‘laggy’ and this is not entirely due to the Fraps capturing. Even without Fraps, I get some very bad frametime (more than 33ms, since our game loop threshold the deltatime, knowing that a 60fps game take 16ms to deal with a frame).

I must investigate to see where is the bottleneck… maybe it’s in Mono Game… or maybe it’s simply in Mono.
I don’t think it’s in the game code since the game was running well with the Xna/C#/.Net implementation, even on my crappy Mac Mini (running on Windows).

>>> Pros Mono Game

– Easy to maintain all the version (console, Win, Mac, Linux) since it’s the same codebase
– Not really much code to provide for the game to run with Mono Game
– Not really a port, more an ‘emulation style running’

>>> Cons Mono Game

– Very bad performances for now
– Not so easy to deploy on Linux (many dependencies)
– Not really a port, more an ‘emulation style running’ -(yep, that’s a cons too)

>> The ‘hard’ way

Here is the ‘hard’ way, not the ‘real hard’ one. It consists of porting the game code in Java, including an equivalent of the Xna Framework, and the functionalities brought by the .Net Framework.

>>> Presentation

Java is a programming language and has the particularity to be thought to ease the multiplatform deploying since it rely on Virtual Machines to run a bytecode.

Since Java is not meant to display hardware accelerated stuff, neither to play complex audio effects, a special feature allows Java to use some C or C++ libraries. It’s called JNI, and with it, some libraries like OpenGL (rendering) or OpenAL (audio) can be wrapped and manipulated from Java code.

That’s what I use through a ready to use library called LWJGL. This library eases the creation of many things (create window, OpenGL context, etc) and wraps useful library gaming oriented.

>>> Why this is the ‘hard’ way?

It’s the ‘hard’ way mainly because you have to rewrite some code (sometimes a lot), because Java and C# do not act the same way. Hopefully the two languages got some similarities: they both use a managed memory system, and propose a strong Object oriented programming.

Since C# is some kind of Microsoft response to Java, the two languages share the same DNA, and it’s not rare to see some troubling similarities in the classes from the Java Classes Library and .NET.

Here is a function that says if an upgrader can open or not when the player collects a new piece.

These codes are very similar, sometimes it’s worst than that. Let’s say it’s a regular porting case.

>>> What I got so far with Java

Every cinematics and levels are loading. The inputs (keyboard and gamepad) are handled, the sounds are not implemented yet. Here what I get after between 2 and 3 weeks of porting the thing:

As you can see, the framerate is much better than the one obtained with Mono Game (running on the same machine with the same capture tools for the same time).

There are still some stuff that are not very well implemented (like the font that are all fucked up, and the tetrobot eye positioning).
As for the Mono Game version, I didn’t implemented the sounds yet (even if part of the code have been ported).

>>> Pros Java

– performances are here for this little game
– sometimes really near from C# in term of code syntax
– in browser applet could be envisaged (to promote a level, or a demo)
– deploying on various platform with the same performance results (see image below)

>>> Cons Java

– sometimes really far from C# in term of code syntax
– have to rewrite (or copy/past and adapt) a lot of code

>> What would be the ‘real hard’ way?

The real ‘hard way’ port would have been rewrite the whole game in C++. But this mean that the rewrite would have been longer than Java, since C++ has nothing to do with C# or Java (except they are all Object oriented languages).

>> What’s next?

I think I will concentrate my efforts on the Java version since it’s the one with the best performances and easier deploying.

The next step for me is to get the sounds working. Then correct the little bugs here and there, replace the placeholder font handling and make some Java optimization (because there is a room for optimization, my Java is quite rusty sometimes). And of course, including new functionalities for the PC versions. Yep, that’s a lot of work! But you, PC gamers, deserve a decent version of the game too!

And I think we will need some volunteers to run a test sample on their machine (we already got some volunteers, but we will soon ask for more!).

See you next time!