Start simple

Event the simplest game becomes rapidly hundred of lines, dozen of functions and multiple files.

So by starting with a simple project, to learn the basic principles of the games, game loop, entity management…

Prototype then clean

To implement a new feature, I like to start to implement it with the basic algorithm and not so clean code.

When the feature works, the I look how to clean the code, refactor it.

No memory allocation/free in the main loop

Having memory allocation/free in the main loop can give huge leaks that will rapidly become segfaults. Furthermore allocating the data at the init of the game or the level often simplify the code.

Compute the data offline

To handle the rotation, I started with a rotate function, but after some experimentation his behavior felled strange. By looking at the rotation documentation I found that the implementation is complex, because of the size of the shapes (2×2, 1×4, etc).

So finally I implemented the rotation by storing the possible rotations in an array manually.

Move the complexity at the init

After the multiples cleanups, all the data transformations and creations that have to be done at run time are made at the init. All the SDL_texture for all the possible rotations are computed at init.

Beautiful does not mean complex

At first I started by looking how to implement gradients to draw the blocks. But I switched to colored block with carefully chosen colors and the result is good.

This month was another bad month, especially because I was preparing a big running race and made lots of commutes.

But I have not done nothing, I have started the GTK+ integration in order to provide an user friendly interface. For March, I plan to finish the GTK+ integration and to finally make a first usable version.

As I said in the previous post, one of my resolutions of this year is to make 1 project per month. Today we are in February, and one month happened since the beginning of the challenge, so a project should have been finished.

First, since the beginning of January I’ve lost my motivation on my side project, I’m have not done any developments since December. I see this as a pause, I was really exhausted about programming and I only re-start to develop right now.

Second, I planned to finish my previous project and after some hindsight, I found that these project are too big. So I will split them in smaller ones.

So the February plan, is to split these projects into smaller finished ones, and to publish them.

New years are always subjects to new good resolutions. And like many people I have a lost of sides projects in mind. Following a news on HN (link) and a post on (1PPM Challenge). I decided also to try to make one project per month.

This for multiple reasons. First, to limit the time on project, when a project becomes too long my motivation tend to lower. Second, to force me to limit the scope of my project to make a minimal viable product. Third, not only to code, but also to market my products by making a beautiful page and speak about it on websites.

My first project is to finish and make a product from a side project started the last years: IOMind.

Recently a post on gamedev by an intern an NVidia discussed about the fact than most AAA games have a bad use of OpenGL, and the driver team changes the driver to allow better game performances. It also speek about the fact than thousand of lines are dedicated to deal with the hardware abstraction layer.

But the new Vulkan API will certainly not be ported on old devices. The fragmentation between the version of OpenGL (most games used OpenGL 3 because Opengl 4 is not supported by lot of devices).

Initially the Raspberry pi was launched as a ARM 11 running at 700MHz. This is equivalent to an old Intel Pentium 3 processor.
Compared to other boards like the BeagleBoard that have a ARM Cortex A8 core and a DSP processor, it is a low performance board.

First improvement

The first improvement in the global performances was with the announcement of the recompilation of the packages of the raspbian distribution with hardware floating point support.
This is not an hardware performance improvement, but it is an improvement on the use of the hardware. The gain was visible in the applications that uses intensively the floating point arithmetics, for example the graphics.

Then the hardware improvement

A few day ago they announced an update on the firmware that allows to run the raspberry pi at 1GHz without loosing the guaranty or reducing the lifetime.
The gain is up to 52% faster on integer, 64% faster on floating point and 55% faster on memory.

What next?

So a widely used and intensively supported product like the raspberry pi can give good surprises after the launch, like the distribution that have evolved, the performances, etc.
This for free without changing your board!

So what we can expect for the next improvement?
Maybe the support of GPU acceleration with OpenCL? Hum, the GPU firmware is very closed, and the manufacturer seems to don’t be ready for OpenCL. But the amount of user may put some pressure on them.
A new version of the distribution recompiled with support of the SIMD to improve the global performances? I don’t know if this can increase the performances, but for sure the power consumption.

This new editor that make some improvement in this kind of tools shows the code in a novel manner, functions are showed separately, file are just a method to store file.

Another new feature is the instant show the function informations.

The major feature is the ability to prototype the application IN the editor. but this kind of feature seems to be possible only for languages supported by JIT (Just In Time) compilation like Lisp derived or Javascript.