Adarakion Developer Diary: Issue 17

Hello again!

More from the weird and wonderful world that is game development in C++! Ill try not to be too technical again this week, however apologies if my aching head slips into programmer mode again!

I’m having some really good and some really mind boggling times with C++ at the moment. Its such a gloriously adaptable language, but also at the same time so far removed from anything I have been previously used to that sometimes it feels the whole compiler is working against me. It’s a language which requires you to have knowledge of a lot of the behind the scenes stuff (how it compiles/links etc.) as well as how to actually program the damn thing.

For example during this port I’m attempting to split up Project Blast! in to various “pieces” of code so that if I want to do work on the menu system for example, I can just open up that bit of code and its header and work away. An added bonus to using this method is that the compilation speed is increased as the compiler doesn’t go through every “piece” of code when building the project, only those which have changed since the last build. However by splitting up the code the scope of variables needs to be very carefully planned. What I mean by this is that ALL the variables don’t have to be visible to the entire program. For example my main menu program doesn’t need to be able to access the variable that tells the game which special weapon player 1 has picked. This makes perfect sense on paper, however I am more used to taking the attitude of making everything global so I don’t have to worry., which is VERY bad practise. As I am hoping to be doing this full time at some point in the future it is important to me that as I start this journey into the unknown, I do so on the right footing! This “trying to do things right” is having a knock on effect that not only do I have to ”C-er-ise” everything (hey, nice word that, Ill use that again!) but also look at the way my data is organised which really means that I need to effectively re-write chunks of the code (well, not re-write really, more re-organise).

So I have had a few headaches trying to come to terms with a new way of working, which in itself isn’t a problem it’s just like learning a new language – its great to learn some vocabulary but without a grasp of grammar you will “get by”, but very slowly and clumsily, and everyone will look at you strangely! Unfortunately just talking louder and slower doesn’t really cut the mustard here!

I am hoping that once I get a few more fundamental questions resolved the remaining bits of the port will go reasonably quickly – apart from my fight engine of course. That is easily my largest chunk of code and that in itself will take me a few weeks to port over, I’m sure of it. It’s also probably my most inefficient chunk of code, so I think Ill probably take the opportunity to re-factor that code whilst I am porting over – might as well try and learn something whilst I’m frantically altering my brackets to square brackets!

At the moment I’m stumbling over a few concepts to with chars and strings but I think Ill get there in the end – its great having contacts to chat stuff through with and give advise on where I’m going wrong, so I guess I am quite lucky in that respect.

I’ve also got some quite exciting developments in the pipeline which should really help with my gradual learning of the nuances of C++. But Ill keep these under my hat for a while – I need to keep some things back to write about here in the future!

Its probably the wrong time to start thinking about what next, but I’ve also been having lots of ideas of the type of game I want to do next – some are more ambitious than others, and a lot of what I can plan for really depends on how comfortable I feel working in the C environment. I don’t think I’ve ever been more excited about where Adarakion are heading.. Well, I have, but I suppose I’ve never felt as confident in our ability to produce the goods in the programming language of the professionals!!