Repainting the Framework

David Shaw, 1:29 am 23rd July 2009
Posted under: Blog Babble

A brief update on what I’ve been up to in the last few weeks:

I’ve been having trouble getting started, what with all the various options transfixing me and being cause for much procrastination, so I spend a bit of time reviewing my plan and getting my priorities straight. I think I was aiming too hard to make things near perfect, which is too hard in my current position, hence cause for anguish and feet dragging. Many people suggest it’s better and quicker to throw something together and then refine it, and I think they’re right – at the least, it gets me over the road block of getting things started.

Another issue is that I’m trying to run a few different projects at once, and I’ve been putting off some hard decisions for all of them. I’m reaching the point where I have to pull the trigger for some of them, and I’ve been putting that off for a bit too long. This is a nice timely reminder to myself that if you have to decide between two reasonable options, both decent but hard to tell which is better, havering indecisively between the two is actually taking the third, worse option. Your choices are actually A) good option B) good, different option and C) do nothing but build up stress between making the wrong choice between A and B. Memo to self: if in that situation, just flip a coin and go with A or B; don’t pick C by default.

Programming-wise, I’ve put Python aside for a while. I don’t know why, but I’m finding it hard to go beyond simple demos. It could just be that I’ve thought of the C family of languages as my game programming language for so long I’ve hard-wired it in there.

Instead, I’m in the process of resurrecting the code I was using for my hobby games a couple of years ago and reworking it into a new framework. I’m keeping the original framework name of “Diagonal”, because I like it, although I’ll give different version names to each iteration (the current one is “Scalene”). My main aim at the moment is to get the framework working while also refresh my memory as to how the system is put together and refreshing my programming skills, all in one swoop. Looking through the code at first glance it isn’t actually that bad.. I guess after several iterations I’d ironed out most of the kinks.

I’m also converting the framework from C++ to C, which is I admit a fairly retrograde action. I’ve never been that comfortable with C++, sticking mainly towards the C side of things in my own code save for a classes and the odd template. In my current framework code, I don’t actually use the C++ features that often. There’s very few classes and I rarely had the need to use the standard library. The bulk of memory management is handled within critical modules which guard it jealously. Really, the biggest thing I lose is namespaces, which is a bit of a bummer but I can live with. In return, I’m hoping to avoid all those pesky annoyances I’ve had working with C++ code, such as easier debugging, profiling and no error messages that go for fifteen pages due to compound templates.

The other justification for a lower level language like C is that I am planning soon to integrate my framework with a scripting language of choice. Admittedly that can be done with C++ and many other languages as well, but I like the contrast between scripting languages and C. Lua and Python are the two choices I’ve flagged, and while I’m stronger in Python I’m leaning towards Lua; I find its simplicity to be appealing, and it’s been designed for embedding. Python is going to be my tool language.

All this said, things are going a bit too slowly for my tastes, and I’m a bit worried. It’s taking me a while to switch from postgraduate algorithm prototyper to game engineer/programmer, remembering some aspects of C, how to use Xcode etc. I do have a few years of my own code to crib off, so I know that what I have should fundamentally work as a starting point. If I don’t have a screenshot of a basic prototype up by the end of the month, then something must have gone seriously wrong.



1 comment for “Repainting the Framework”

  1. Paul Evans says:

    Keep at it, I’m sure you have some fantastic games burried in your head somewhere :-)


Leave a Reply