People who know me on Facebook may be aware that I recently took a break from Icefall to focus on networking code.

I plan for networking to form an important part of Icefall’s gameplay: the game itself is not realtime multiplayer, however I plan for an ‘Auction House’, scoreboards/leaderboards/server-firsts, player-to-player mail, and other online community-type features.

BUT I have never worked with any networking code of any complexity before, and I determined that trying to ‘learn while I go’ during the Icefall development process would not be the best idea. Hence, Citadel!

Citadel is a ‘tower-defense’ game. For those unfamiliar with the concept, essentially an endless wave of bad guys (in this case, tanks, jets, armoured cars, and trikes) try to get to and destroy your tower. Your job is to build a system of defensive towers to prevent them from doing that. The towers themselves automatically aim and fire, the strategy lies in placing the right towers and walls in the right places to do as much damage to the invaders as possible.

Each wave of invaders is tougher than the last, and eventually they will overwhelm your defenses. However, each invader you kill will give you some credits to spend on additional defense, and you receive more credits for tougher invaders. So the object is to last as long as possible, try to save money for the strongest towers (the Tesla Coil), and ultimately get a big score.

As far as tower-defense games go, Citadel currently isn’t that sophisticated (it’s a beta version, after all!) and doesn’t have upgradable towers or multiple game types or anything like that, but it does have a unique feature that I couldn’t find in any other Tower Defense games anywhere: it can do multiplayer. Get a friend on a LAN, or over the internet (hook up a voice-chat program like MSN or Ventrilo!) and you can join forces to get the highest scores. It’s competitive co-operative: you share the same base and it’s game over when an invader reaches it, but who does the most damage to the creates gets the most credits for the kill, and the most score at the end.

NOTE: The invaders MUST ALWAYS HAVE *some way* to get through. Even if they have to go ridiculously long ways around crazily long mazes and queue up single file, it is against the rules of tower defense games to block them off completely. If you do that, it’s immediately game over!

Try the demo! If you don’t like it, that’s fine – but if it works (especially the networking part), or if it doesn’t work and you tell me about it and I work with you to make it work, then you’re helping me to make sure Icefall’s online components are awesome when they come out!

The Citadel Main Menu

The Citadel Main Menu

Early into a Citadel game

Early into a Citadel game

Download the beta demo here and let me know in the comments what you think, if it works, or (more importantly!) if it doesn’t work, or (MOST importantly!) what your high score is 🙂


As a general rule, I like to write all of the code used by my games/programs myself. Not because I think I am the best programmer in the world, but because – for me – one of the main reasons I program is to learn more about how software functions on the very lowest levels, and if I used extensive 3rd party code (like Unreal Engine for my game, for example) a lot of that stuff that I *want* to learn about would be abstracted away, or worse: still present but obscured and intermingled with the 3rd party code itself.

Coincidentally, this is the same reason I don’t use managed languages like C#. I quite like knowing about things that managed code wants to hide! The increase in development time is not that important to me, I have no external deadlines to meet.

However, there are points beyond which it’s not practical for me to write the code myself, because it’s either A) incredibly complex, B) boring, C) proprietary, or D) so ubiquitous that it really doesn’t need reinventing. e.g.: writing code to decode an MP3 file into raw audio. I could *potentially* do this, but as it belongs to all four categories, I’m really comfortable with not doing it myself!

Currently in my Freepascal development I am using three 3rd Party Code libraries every day. And they are all excellent, both in terms of features and being easy enough that I can ‘plug them in’ to my own lx7 game engine with very little work. Here they are:

DirectX – by Clootie

No, not DirectX itself (that deserves a whole separate subject!), but a port of all the headers/structures/glue code necessary to use DirectX in Freepascal. This gives me low level access to every function and interface used by DirectX itself, and the port is so perfect I was able to build my own graphics engine on top of Direct3D just by studying the (C++) DirectX SDK. Nothing is missing! Everything works! You probably won’t appreciate how rare this is if you normally use C++.


BASS is an Audio Library that makes it *dead easy* to play sound and music files of many different types. BASSfpc is the FPC port of this. BASS handles MP3s, WAVs, OGGs, and about a million other sound types, and it does it efficiently and with the bare minimum of code needed (literally about 4 lines of code to init the library and start playing an MP3!).


The newest addition to my Libs folder. LNet provides a set of classes to implement networking, at the very lowest level, without adding any additional features or complexity. That’s exactly what I needed, because I want to add my own features and complexity! There are many many network libraries out there, but (for Freepascal at least) LNet definately gets my vote, for being simple, class-based, and extremely elegant.