Game Design, Programming and running a one-man games business…

Deep Space Corruption

Soooo… there I am innocently watching an episode of star trek:deep space nine (I think it was called rapture), and ok, I’d had a single glass of wine…but…

There is this scene where kassidy yates, ex maquis supporter, and recently released from a six month prison sentence as a result, comes back to visit the station commander Captain Sisko, who is the ‘hero’ of the episode. She says she has nowhere to stay and he says ‘you can have your old quarters back, they are just as you left them. I have some pull with the station commander’.

What the hell?

sisko

So much for a wonderful utopian post-scarcity federation future. Why are the bajorans trusting these mobsters? One might reasonably assume that ideally the allocation of sleeping quarters on the most strategically (and quite possibly economically) important star bases in the galaxy would be taken very seriously, and allocated on a basis of need. But oh no. The station commander has reserved a suite for his ex-girlfriend and convicted terrorist.

Now replace ‘sisko’ with ‘berlusconi’ and ask how acceptable this sort of thing is. What next? the captain hosting bunga-bunga parties in the holosuites?

Something is rotten in the state of Bajor.

Saving and Loading

How I envy developers working on arcade games, or anything that has a very simple game ‘state’ that can be easily saved and loaded with no grief. For the game I am currently working on (announcement later this month), it’s a bit of a pain, because the actual game ‘state’ is horrendously involved, and every single byte of it has to be loaded and saved perfectly. The problem is mainly due to my tendency to code systems that have a huge number of objects that all have pointers to each other, in complex and arcane ways.

In theory, stitching everything back together after a load is fairly easy, but in practice, it’s a bit of a pain, and the REAL pain is to know that it has all worked perfectly. if 99% of the pointers are right, and 1 isn’t, then I have a horrible dangling bug somewhere…

My current process for preventing this is to have the game completely save out it’s state and load it’s state back in every turn (it’s a turn based game). At the moment, due to arcane debugging issues this is horribly slow, but eventually will be super fast. At least doing it this way means that during development I’ll spot any save/load inconsistencies really quickly.

I’m aching to get on with some GUI stuff to make it look nice, but I’ve learned the hard way that I have to put that off until the foundations work better. Better to have it stable now, rather than fix it later.

Sim City 4 rekindles my inner stats geek

I’ve got totally addicted to Sim City 4. The new version will have to be something very special to make me prefer it to this classic. I enjoyed it thoroughly upon release, but have recently rediscovered it’s charms. Weirdly, it’s performance on my PC is not great. I strongly suspect that this is because it is a game running on an assumption of single-core PC’s, in a single thread, or maybe running on an assumption of low polygon-throughput, given it’s interesting approach to hybrid 3D-2Dness. I would truly love to wade through it’s source code.

simcity

One of the things I find most interesting about SC4 is the extent to which it is sandbox and freeform driven. The player is given a toolkit for city building and left to get on with it. It really is a (pleasant) throwback to ‘make your own fun’ which I find thoroughly refreshing after playing so many modern games, which amount to a checklist of ordered tasks, and a booming voice saying ‘hit this key’ ‘now hit that key’ ‘well done, have 1,000 gold stars for hitting the key we just told you to hit’.

I hate that.

Sim City 4 has no achievements or high scores, or todo lists or much in the way of targets or quests, and I find myself remarkably capable of setting my own. My first city has floundered a bit financially due to my insistence on building an entire metropolis powered by wind turbines. (Annoyingly there are no economies of scale with them :(). My second city is achieving an almost OCD level of sadness with it’s ordered grid system and widespread use of monorails. I didn’t need a ‘wind energy badge’ or a ‘monorail achievement’ to encourage me to play or have fun in this way.

It’s also helping me to understand how some players get REALLY into optimizing their fleets and ship designs in Gratuitous Space Battles. You have no idea how much bulldozing and re-designing I’ve carried out to get the optimum layout for my monorail system :D

Stuck in a world of legacy code

I use the odd bit of code that has char* in it. There I’ve said it. It feels like a big confession. I bet some programmers just sprayed their coffee everywhere. I’m sorry. They say the first step is admitting that you have a problem.

I’m a very very productive game developer. I churn out a lot of very very big and ambitious games. One of the ways I manage that is that I don’t change my ways unless I can make a really good argument for doing so. I never learned what on earth .Net was, no I don’t mind it’s passing. I don’t really know C#. I have no idea what design patterns exist other than singleton. I have no idea what a UML diagram is (is that even a thing? I don’t know…)

You have no idea what a huge big deal it was for me to switch from directx7 to directx9. That took some doing*, and it’s why I still use DX, not OpenGL (which would make apple mac ports far easier and cheaper).

While I’m in confession mode, here are a few other howlers you might be amused by:

  • I manually type out for() loops without using for_each()
  • I use FILE* not the stream stuff
  • I use my own GUI library, and Input code, not third party stuff. In fact I wrote my own hash table code too. The only stuff I rely on is STL, and only partially use std::string

Scary huh?

Why am I such a luddite? Well it comes down to time. If I had regular bugs that I could attribute to passing around char* now and then rather than a std::string, then things would be different, but I know all the functions that handle chars better than I know STL, so I code much faster that way. I have a slight niggling doubt that for_each() is as fast as it should be. I can’t remember the iostream syntax, so I use FILE*, because frankly my file handling code was written years ago and still works fine, so why change?

I see a lot of coders jump on every code bandwagon, and learn new stuff all the time. They are constantly rewriting their whole engine, and constantly going back and changing the code they wrote a month ago. They rarely ship games, and very rarely ship large ones. To me, it always makes sense to make occasional big jumps, rather than constantly fight to keep up with the latest stuff. I have no idea what was in Directx8, it passed me by totally. I’ll maybe move to directx12 (more likely opengl).

It may make me seem old fashioned, but it’s incredibly productive.

*it’s not learning the API, but building a bug-free FAST engine that correctly encapsulates the API that takes time.