Blowfish Rescue 1.0 Released

Just a small post to announce the release of my new video game: Blowfish Rescue. This is a 2d action/puzzle game using a fluid simulation solver. Most of the graphics are procedurally generated. The game is available for free on google play and iTune. Here is a promo video I did: In the following week I will open source the procedural generation code, as I think this is an interesting part of the code, and can probably be reused for other games....

2015 July 6

Procedural graphics generation in C

I introduce noc_turtle, a small MIT licence C library to create procedural graphics in plain C. I release it in the hope that some people will use it in their own project, and also to promote my video game Blowfish Rescue for which I wrote it. The library allows to write procedural rules directly in C, so it is very simple to embed it in a project and to mix it with custom code....

2015 June 12

Comparison of Doom 1, Quake, and Doom 3 entity references system

The architecture of a video game code is usually based around a list of entities that represent all the game elements: players, enemies, etc. The engine iterates over this list and call the appropriate methods to update or render the entities. Since game elements get constantly created and destroyed, the list is not static but need to be updated at each iteration. The problem is that some entities keep references to others....

2015 April 29

10 C99 tricks

Here are ten interesting patterns and tricks I sometime use in my C code, some are well known, some not so much. I am sure all of them work with clang and gcc (after fixing the evetual typos). I didn’t try with MSVC, but except for no 1 and 5, I think it should also work. [edit]: Here is a link to the hacker news thread. [edit]: Maybe the title is a bit misleading, this is not strictly about C99....

2015 February 13

Procedural colors for video games

Recently I have been spending a lot of time thinking about how to use procedural colors in my -still unnamed- incoming video game. [edit]: The game is done now, it is called Blowfish Rescue, and you can play it for free on Android of iOS. This is a problem that I am sure many other indie game developers have been thinking about, and there are not so many resources about it online, so I though I would share my experience so far on the subject....

2014 October 6

Named parameters in C

C99 introduced the concept of designated initializers, that allows to initialize a structure using the name of the fields, like this: struct MyStruct {int x; float y;}; struct MyStruct a = { .x = 10, .y = 3.6, }; Here is a C macro that extends this syntax to function calls. I present it as a curiosity, and I really wouldn’t advise anybody to actually use it in a project (except maybe for very special cases, like for example emulating the interface of a language that accepts named arguments)....

2014 July 14

C++ patterns using plain C

So that’s it, you read this article, and this post, and this, and this, and you spent too many time trying to debug 8 pages long compilation error messages, and you also spent hours trying to follow your code path involving operator overloading, copy constructors, and virtual class methods called from constructors or whatnot. You have had enough of it. Yout think it’s time for you to stop using C++ altogether and return to simple, frank, easy to debug, plain, C....

2014 June 22

Automatic object factory in C++

Unlike other object oriented languages like java, C++ does not have much support for introspection. So for example it is not possible to request the list of subclasses of a given class. In this post I am going to talk about a little trick that I found very useful when dealing with a lot of subclasses of a single base class. This is typically what we see in video game, where we have a base Object class that represents any kind of object in the game, and then one subclass for each type of object, like the player, enemies, etc....

2014 June 15

How our ads based game makes more revenue than our paid version

For more than one year, our game voxel invaders was present on google play as both a free demo version and a full paid version. Recently we decided to remove the demo version and replace it with a free full version with ads. To make it simple, we just updated our demo package with a new package incorporating the admob SDK. In order to boost the new version, we also cooperated with app of the day (previously known as appturbo) to make a promotion of the game....

2014 June 2

How to deal with spaghetti legacy code

At least three times in my career as a programmer, I had to work on huge, complicated code written by other people. In one case I was specifically hired to replace the original maintainer who -as I later learned- left the company from a burnout caused by the frustration of having to maintain his own code. Inheriting legacy code is common, and few people enjoy it. Here I put down a few ideas that I think might help to deal with the situation....

2014 April 7