Game update

A few things I should clarify about my earlier post:

I'm writing this for fun. I don't expect this game will come to anything much at all. If it's fun and playable, I might release it and try and get it packaged for a few different distros. My main motivation in writing the game is for me to improve my own programming skills.

I'm using Qt4 and qDevelop, nothing else. Qt4 is simply the best cross-platform C++ library I've ever seen, and qDevelop is a nice cross platform IDE that does everything I want it to.

Right now I have collision detection going, although it needs a few tweaks for fast-moving objects (like bullets). My next step is to investigate The QtScript module. Basically I want to be able to write the AI routines for the game in ECMAScript, so I can change them without having to recompile the game. This should also make the game easily extensible, possibly by people who aren't hard-core programmers.


Will post another video when I get something worth showing!

Pet Project: game

Yep, I'm writing a small game. I'm usually rather tight-arsed about proper code design before you start writing code, but I've realized that a lot of the time this stops me writing any code at all.

For this project my general methodology is to write whatever comes to mind, and be prepared to throw away code that I think is too crap to last in the final build.

In fact, my design phase has been so minimalistic I don't even have a name for the game. For now, it's just called "game". It's going to be a land-cased top-down 2D shooter, with lots of weapons and cool stuff. Right now it can load a very simple level format from XML; you can control the player using the keyboard "WASD" keys, and fire the players rifle using the mouse. Bullets have collision detection.

Here's an early video that shows the game sans collision detection:



My next step will be to have predefined objects for a level (right now they're all just boxes). I might start with an immobile gun turret - that should let me get some AI going for the enemies, as well as some health stats for the player and enemies.

Eventually I want to make the game easily extensible using QtScript for enemy AI.

Working with Qt4 has made this project an absolute breeze - there's hardly any code in this project! When it gets a few more features I'll upload the source online.

Cheers,!

When source code control goes wrong

Question: when is source code control not source code control?


Answer: when your development model forces you to have working copies outside the source control environment.


This happened to me recently - I lost alot of work due to a bug in the source code control package we use. I had several weeks worth of changes checked out on my local hard disk. The development model at this company is such that I cannot check in my changes until they are finished and stable. I guess I've known that this is a bad idea from the start, but it took a catastrophic loss of data for me to find out.

So let this be a lesson to all of you - whatever source code control package you use (you DO use one, right?) make sure you're using it properly. That means:

  • Regular commits (at least daily, but I recommend hourly or even less).
  • Useful commit messages. If you're committing work often, you'll need to know what you've been working on.
  • Use branches to separate high-risk code, so you don't pollute the main source tree with your changes.
  • Keep release code and development code separate, yet easily accessible. Branches are a good way to go here as well.

As far as I'm concerned, branches are absolutely critical to a decent source control environment. Creating a branch should be dead easy. If I can't create a usable branch in less than 10 seconds, then I probably won't bother. Some tools (like vault for example) create branches by copying the part of the source tree you're branching to a new folder with a different name. The problem with this is that it breaks Visual Studio's SCC integration. In fact, *any* embedded reference to the code location within the code repository will be rendered useless for the new branched code. A much better method is to create true parallel branches - either as a separate instance of the repository, or using the same instance with tags.

Linus Torvalds has the right idea in this presentation on git. The things most important to programmers should be dead-easy to do. That's branching, merging, and tracking changes over time.

Twitter: I don't get it


So what's with this twitter business anyway? Why would I want to have a conversation with someone online? Maybe I'm missing something here, but what's the point?

Having said that, I'd love a silver bullet that makes me rich, popular, and famous - Merlin Mann seems to have seen the darker side to the spree of social networking websites that have graced our browser screens of late. Jeff Atwood asks us "how many online identities do we need?", and I have to agree with him. You may have noticed the LinkedIn link on this page - I use that simply because a lot of my former colleagues are present, and it's a useful tool to keep in touch.

However, I suspect that those exact reasons are at the very heart of most social networking sites. So why are there so many?

Perhaps it's vanity - everyone wants the world to know how many friends they have...

Qt programming contest


Qt Centre Programming Contest 2008
: collaboration, education, project management, automation, demo, plasmoid and newcomer


I may even enter myself!