Linking Libraries in C++

(Disclaimer: I am not an experienced C++ developer, there might be inaccuracies in the following text. I will correct any mistakes I’ll find as I progress. This article is mainly targeting myself for future references).

For the last two years-or-so I’ve been reading up on C++. I’ve read books, done courses, watched about 20 hours of handmade hero and built a few small games/prototypes using open frameworks. Still the thing is that no one is talking about is how to include and use libraries into your project. Trying to figure out the project settings in Visual Studio by yourself is a complete nightmare, and most tutorials will just totally skip this step.

So a couple of nights ago I decided I wanted to try some C++ coding. I wanted to try something that would cross compile so I could develop on both my Linux and my Windows partition. I decided I wanted to use glfw to create a window with an OpenGL context in a cross platform manner. And I wanted to do it from code::blocks (since on Linux). It took two days until I got it running, so I decided to write down the steps I took to get it to work….

Continue reading

Profiling Out Of Memory Exception on Android devices

Last week at work we noticed a huge amount of OutOfMemoryExceptions being reported in the Android app that I work with through Crashlytics.

These exceptions are very tricky! They are very difficult to reproduce in a controlled environment, and can have a lot to do with hardware specs of specific devices as well as special conditions due to the usage of the phone (apps/background services etc) at the point of the crash. And not to mention that debugging memory is really hard.

If you ever find yourself in a situation where you have to start digging into the profiler, then I highly recomend that you watch this video from start to end before starting. It is an excellent tutorial which will explain concepts such as Dominator Tree, or the difference between Shallow and Retained Heap. Or just how to extract a memorydump from your device to analyze:

I actually found at least one huge memory issue, and two smaller ones, thanks to the tips from this video. Time well spent!

Ludum Dare 30 Post Mortem – Trapped Between Worlds

In this post I will talk a bit about the game I made for Ludum Dare 30, called Trapped Between Worlds. The idea I had when I started, what I think went right and what went wrong, and what I learned from it.
Here are the links to the game, and to the timelapse I recorded while making it.

The game (flash):
The timelapse:
Ludum Dare page:
Post about our meetup:
Steves’ soundtrack:

The event

If you (for some strange reason) don’t know what Ludum Dare is I’ll keep it really short: it’s a online event where people world wide gather to create a game on a given theme during 48 hours.

During these compos you most often work alone. Probably from your home. But in some places people organize meetups at a physical location, which is called a Real World Gathering. This time, me and a co-worker and fellow participant of LD, Nilstastic, decided to host such a meetup in our office here in Stockholm.

About 15-17 people showed up during the two day event, and I had a great time. However, coding under extreme pressure doesn’t give you a whole lot of time to socialize. Still, just hanging toghether with talented and creative people was a great deal of fun, and good both for helping each other out with code or ideas around the theme, and for boosting creativity.

A huge thanks to Isotop who allowed us to use the office (and buying us soda, snacks and pizza).

The idea

My initial idea was to make a 2d action platformer. I usually avoid platformers in jams with short time-span due to their complexity, but this time I had decided to go with an existing engine (Haxepunk) instead of building everything myself from scratch.

With the heavy burden of platforming removed from the equation I wanted to focus on gameplay and game design. My main goal was to include bosses (as many as possible) in the game, which is another thing I usually try do scope out when time is limited.

I decided to go with quite similar game style as Ripple Dot Zero, but more combat-heavy, and with the ability to upgrade your stats as you played the game.
Upgrading your stats would make it easier to defeat the bosses, and you could choose to upgrade according to your preferred play style. However, completing the game should be possible (but really really hard) even without any stat updates.

So, as you can see, I was aware from the start that I had greatly overscoped my project. I knew this perfecly well, but you gotta try to win! And to compensate I invested a great amount of time to learn and experiment with the open source engine Haxepunk.

What went right?

My first good choice was to team up with Steve (meaning I could not enter the main compo, but rather the jam, that runs at the same time but with some slightly modified rules).
Not only did Steve build an amazing 8-bit mega man-inspired soundtrack and help me with sound effects, but he helped me (probably a lot more than he realized) with scoping down the project when the time was about to run out.

I knew I wanted to do a platformer, and spent a lot of time familiarizing with Haxepunk. I even modified the engine a bit to better suite my needs. Without these preparations there is no way I would had been able to finish at all.

I’m happy with how the bosses turned out.
There are two bosses, and I tried to keep them simple but still boss-y.
The big brown square in the forrest world is supposed to be an elk (but I had to scope out making the graphics for the antlers so I guess it’s a cow and not a bull). When I added the jumping behaviour to it and realized that it could actually stand in the tree crowns – like a totally badass kung fu elk – I couldn’t help but giggle out aloud. Awesome moment!

Overall, I think that the game is fun to play. Even though the controls are not perfect on a keyboard (they are with a controller though) the basic battle mechanics feels very solid, and could absolutely be imporoved into something really interesting.

I’m also quite satisfied with the final score.
Out of 1.045 jam entries I got on place 105 in the Audio category (thanks Steve!) and on place 153 in the Fun category. Overall the game placed 176.
I’m very happy with placing so high on Fun, and also the feedback I got from the other players was very positive.

What went wrong?

Running out of time
Even though I knew I overscoped (and planned for it) I ran out of time.
Even though jam entries has 72 hours to finish their game I still intended to finish my game within the usual 48 hours. But what I had after 48 hours was very far from being good enough to submit. I had to use 12 hours after work on monday to finish it up (with some precious help to prioritize from Steve).

Hunting bugs in the engine
Even though I had prepared a lot by experimenting with Haxepunk, it wasn’t enough. I ran into strange bugs and had to spend precious time making bug fixes in the engine code. Like mirroring a clipped image worked on c++ but not in flash (cliprect did not mirror). Or setting the background color worked in flash but not c++.

Vauge connection to the theme
The theme was “Connected Worlds”. I decided to build the game as levels, or “worlds” connected with lines and dots from a “hub world”. When you complete a world it’s connection will light up, and show you part of the location to the exit of the game.
It was a vauge take on the theme to begin with, and due to time constraints it became even less obvious.

I had an idea to use square rectangles as the main body and then paint details on it in layers.
It did not turn out as well as I had hoped. And also the actual levels looks very very boring, consisting of mostly just colored rectangles.
If I want to place better I have to put more effort into the graphics!

Developer difficulty
I wanted the game to be very difficult (but not impossible) to complete, even without any stat upgrades.
However I think I fell back on the old developer difficulty mode. The elk-boss is really mean (although there is a trick to defeat it super easy).

 Lessons learned…

What’s your purpose?
For me I enter the LD for one of two purposes. Either to learn (new tool, new language, or just practice making games) or to score high. This time I wanted to score high!
So what conclusions have I made from this? How could I have scored higher?

1. Know your tools!
You need to be very familiar with your tools and engine. You should try and build several games with them, learn their quirks and shortcuts.
For example I had not been experimenting with bitmap graphics in haxepunk before the compo, which led to a lot of wasted time and bug hunting when trying to flip the sprites as one example. Also, I had to do some dirty tricks to animate the sprites as I hadn’t studied anything about how to handle sprite animations.
So choose your tool/engine, and build an actual game with it. Not just short experiments. There are lots of gamejams at any given time. Spend a day or two and make a few simple games.

2. Difficulty and restarts!
I have done this mistake before, and it’s time to learn this lesson now.
It’s ok to make your game difficult as hell, but if you do: make sure it’s super fast coming back into the game again! Not more than one click! And a click on the keyboard is better than the mouse so you can get right back into the action fast!
In this game when you die (and you die a lot) you have to click past two splash screens, and then start all over from the tutorial level again. That’s cruel, and people will not stand dying more than a few times (in best case).

3. Graphics and design!
I believe the graphics will make people start playing your game, and the gameplay will keep them playing it.
But in this case I believe the quality of the graphics was just to low.
Also the overall design was too low, especially the level design. This is something I will have to keep working with.

4. Cross platform compatibility
Haxe is really great when it comes to cross platform output. Especially desktop and mobile.
However, it’s support for consoles is very limited – and I would soooo much love to play this game on my Playstation Vita.
That’s why I will change my tools until next time. I’m currently looking a lot on the Unity platform which also has great cross platform support. I’m also considering MonoGame, but for starters it will be Unity.

What’s next?

First of all, I have been working a bit more on the game.
I currently have a version running on windows/c++ target, and using an xbox controller as input (which is great).
I also started on new, deeper and nested worlds. With new enemy types and experimenting with behavior trees as AI. The project has however been put on hold as I’m planning to switch my tools.

I had such a good time this Ludum Dare that I immidiately afterwards wanted more!
My goal is to participate in the procjam (, and I really look forward to the next Ludum Dare competition.

We have not decided if we should have another Real World Gathering or not at this time. But it’s absolutely a possibility.

In any case! More games. And more jams!
If you think it sounds interesting you should join too!

Some great press coverage on Ripple Dot Zero

On June 28, 2013, me and Simon finally released our long running hobby project Ripple Dot Zero, and soon after it began to spread across the internet. We were of course hoping to get some attention for the game, but we were completely overwhelmed by the response we recieved from press and fans.

Here are a selected number of reviews and comments. And I have to say: getting responses like this really warms my heart!

Destructoid: Free PC game Ripple Dot Zero is Sonic mixed with Strider

US GAMER: Ripple Dot Zero Totally Just Made My Day

Indie statik: Trip Back to Gushers and Bubsy: Ripple Dot Zero 16-bit action platforming nostalgia nailed – Ripple Dot Zero

This forum thread was created on Neogaf:

Ripple was also featured on Nitromes weekly “pixel love”, and after a while a fan-made wiki appeared:

A huge thanks to everyone who has showed your support to us in articles, social media, video playthroughs and email. It means the world to us.

Big Bad Wolf wins Game Of The Year Award

Last night, at the annual EGR Operator Awards (EGR is the world’s acknowledged leaders in business-to-business information provision for the online gaming industry) Quickspin scored big by winning  the prestigious Game Of The Year with the game Big Bad Wolf.

It’s also worth noting that our game had some really fierce competition. Among the other nominated games you’ll find titles such as Elements: The Awakening by Net Entertainment and MONOPOLY Plus by IGT (the links are to their youtube trailers).

So I’m very happy for Quickspin to win this award, and I’m also very proud myself since I took a very active role in the development of this game. As Lead Developer I designed the overall system for the game, implemented the “swooping reels” feature and lead the team during the production phase as Scrum Master.

So my huge congratulations to Quickspin, and to the entire Big Bad Wolf Team.

Here are some links about the event:……

Ripple Dot Zero gets a release date!

(Edit: Ripple Dot Zero is live and playable on

If you missed the announcement-trailer you have to check it out immediately! Yes now! Do it!

In game screenshot from Ripple Dot Zero

Today is a big day for me. Today we announce the official release date for Ripple Dot Zero, my long ever-lasting game project together with Simon (you can find more Ripple info on our Pixeltruss-blog), but right now I just want to share my personal view.

A super early brainstorming sketch for our - back then - yet unnamed game

I wrote the very first line of code for this project in February 2008, that was for our custom made level editor, and started working on the game engine shortly thereafter. That is more than five years ago!!!

At first we were aiming for a much smaller game, but the editor turned out to be very powerful and Simon started doing more and more impressive and complex levels.

Me and Simon had a very good setup from the beginning. We were both using Subversion for version control. Simon would sit in his home, work on a new level in our level editor (which we named Saled). When he was done he would check it in to subversion and call me up, telling me about his new level – and usually add “wouldn’t it be cool if we had this and that feature, I’ve already made the graphics and added it to the level”.
At this point I would check out the new level from subversion, try it out, write the code for the new feature and check it in to subversion. All Simon needed to do now was to check out the engine again and his feature was in place – fully playable.

This is how it went on and on. Slowly growing the game world as we progressed. Constantly inspiring each other with new features, game engine tweaks and graphics.

But now its finally time, its the end of an era. And by June 28, 2013 I hope you will enjoy this game as much as we enjoyed making it.

Kind regards


Supernova is a Slot Machine from Quickspin, where you can multiply any wins you get with the amount specified in the two right-most reels (by most you can get x10 + x10).

The game gets pretty intense if you get really high wins (as this video below shows).

For the most part of this project I was the only developer. I was also Scrum master. One of the two artists working on this game together with me was actually Simon, who made all graphics and level design for Ripple Dot Zero and Metro Siberia.

Big Bad Wolf

Big bad wolf is a slot game with a nice twist. If you get a win, all symbols involved in that win will be removed, and new symbols will fall down – meaning that a win can trigger another win, chaining together huge combos (like bejeweled).

I was lead developer (and scrum master) on this game, which was produced by Quickspin.