Tag Archives: Programming

Look! An early, art free, screenshot

I’ve decided that it was high time to post a screen shot of what I’ve been working on for the past month, if only so I can look back on it months later and say – look how far we’ve come. It’s very much mostly programmer art (and indeed placeholders from directX) so far as I haven’t seriously put my artist had on since my first proof of concept tinkerings with GIMP and blender a few weeks back. It does show some of the features I’ve managed to hammer together so far such as the text rendering, basic UI and the general lighting/camera angle setup. Boom:

Love those D3D standard assets

I’m starting to push things in a dark fantasy direction with the hud image there, and the general blackness of everything but I think there is a long way to go before I really nail that aesthetic. Though, with nothing really going on, check out that frame rate!

General code optimisation on an indie budget is actually kind of tough. I haven’t yet found a good, free or nearly free, tool that’ll quickly do function timings yet. What I want is some of the functionality of a VTune like program for a sub fifty pound price.


Useful usable code for indie developers

Creating a game as one man army is a difficult task and its even harder if you aren’t going to use a complete off the shelf engine. I decided that I wasn’t going to purchase or license a complete game engine to build my mercenary strategy game. I’ve found in the past that the free, or affordably licensable engines, suffer from either being hard to bend to a purpose they were not designed for (and few engines are built with a tactical strategy game in mind) or so packed full of features that they become overly difficult to learn for what I feel are simple requirements. However, I also didn’t want to hand build everything from scratch as my time is not infinite.

I’ve settled on a strategy of pulling together a game engine from an amalgamation of open source freeware code, cheaply licensable libraries and, of course, my own frenzied key bashing. I thought that other people thinking of doing something similar might appreciate a list of the free bits and pieces of code I’ve been using and why. All code in this list is written in C or C++ :

DirectX 9

This is the current gold standard in the games industry and likely will be until the next generation of consoles. While the more modern iterations of DirectX have many high end features they just won’t work across the range of OS’s and graphics cards that I would like to target. DirectX is hugely well documented in purchasable tomes and across the internet I’m also very familiar with it personally from my industry game development work.You can get the directX 9 SDK direct from Microsoft, the latest one is here but to get any of the decent documentation and tutorials for version 9 you’ll need to dig backward and find an SDK before XNA or directx 10 existed.

Open Dynamics Engine

This is an open source physics library that’ll help you make a pile of boxes that you can knock about realistically. I’m currently not testing it in anger in my game but it certainly seem to work out ok for 2D Boy in World of Goo. The documentation is… not great and discussions about it online tend to become –very physicist– very quickly, nevertheless it wasn’t too tricky to set up the aforementioned pile of boxes and it can do double or single precision and will handle ray casting for you as well. The main page for it is here but I’d recommend also evaluating bullet which was used in the recent Trials HD if you are focusing on physics.

FreeType 2
This is the text rendering library – accept no substitutes. Its used widely in the professional game industry and in many distributions of linux and its handily simple to setup. You’ll be rendering font glyphs to grey scale bitmaps in no time. While researching FreeType I discovered that there are a whole mass of very specific patents covering font rendering techniques owned by Apple and Microsoft – the results of which you’ll be able to see if you grab a screenshot of this browser window and zoom in on it in paint. FreeType is available here. I recommend the tutorials under ‘Documentation’ on the website.

StackWalker

Some times you just need to spit out the callstack on a particularly troublesome bit of code but you can’t get a break point in. This little bit of code will help you do that – its helped me nail a tricky bug a couple of times. You can read a full explanation of it and download it here.

tinyxml

It’s an xml reader, one of many available but I like the simple, easy to integrate, ethos behind tiny xml. It’ll read from, and write to xml files for you – with minimal hassle. You can grab it here.

sigslot

Allows you to simply use an observer pattern like relationship between classes in C++. It’s invaluable for input handling and user interface messaging beating the windows message loop into a cocked hat. The broadcasting class has signals which can be sent out at any time and they are then received by the listeners through their ‘slot’ methods. The explanatory page is here.

irrKlang

An audio library thats easy to use? After negative experiences with DirectSound and Open Audio I was very pleasantly surprised by the simple interface on irrKlang. It costs a bit of money to license for commercial use but they have a special rate (£60) for indie games made by individuals sold cheaper than £18 (which I will be). It was used successfully in 2DBoy’s World of Goo as well. You can find irrKlang here.

Thats all I’m up to so far but I’d love to hear about positive experiences with any other C++ libraries/open source code in a game development environment.

Add your thoughts in the comments & you should follow me on twitter here.