To change gears from my last post, let’s talk about some game software design. The purpose of this article is to sort of underscore a certain way of thinking about software design; this probably won’t come as news to some of you, but for those of us who have been writing games since the DOS era it might get some gears turning.
When “application server” is said, what probably comes to mind in most developer’s heads is one of the following: web server, java application server (Tomcat, jBoss,etc.), or something similarly boring and business-related.
However, as technology progresses, it’s becoming increasingly popular to write your performance critical sections in a compiled language like C or C++ and then use a scripting language like Lua or Squirrel to implement the more flexible elements of your game system. For instance, Blizzard is fond of using Lua to power their user interfaces.
I’m actually very fond of this design for a number of reasons. The big one is re-use; you can make a basic “game application server” (which I will cover how to do in a series of posts) and then use it for anything from a single-player rogue-like to an MMO. That’s actually a strength of the application server model; it scales really well. A shortcoming is that it’s more complicated … but once you do the foundation work, you’ve done the foundation work. Seriously, I’ve used the same foundation for years and I just port it from game to game.
Additionally, it means you can be really flexible with your game logic. Makes it very easy to experiment with things like AI and game mechanics; these things will be written in the interpreted language of your choice, and then you can tweak away without having to recompile and with minimal worries of things like memory leaks. (Which you can still have, of course, but it’s less risky than writing pure C/C++).
So, over the next few weeks, I’m going to start posting some code and how-to’s of making your own game application server. And hopefully this will be of some use to somebody out there!
Images found on Ultima Aiera.