Categories
Game Development

Game architecture design

I’m at the point where I need to design the high level architecture for my game. What classes will there be? What operations will they perform? How will they relate to other classes? The problem is that my answer is usually “I don’t know” or “I don’t know very well.” I can roughly say that […]

I’m at the point where I need to design the high level architecture for my game. What classes will there be? What operations will they perform? How will they relate to other classes?

The problem is that my answer is usually “I don’t know” or “I don’t know very well.” I can roughly say that “It’s an MMOG game so it will have a client and a server.” That’s true, except it’s not very useful information. For example, it’s wrong to say I have “a server” because for scalablility I plan to use server clustering. And what is a client? There is a game client for sure, but there are or may be remote administration clients or logging clients as well.

So I can’t really design the whole game architecture on paper right out. The human mind just can’t explore every possible detail in advance. So how about extreme programming? In XP you have a shipping product pretty much every week. And you build on that project from week to week. This isn’t a bad approach and it’s certainly better for motivation. At the same time you can’t totally ignore high level goals. If I were to do that using a simple minded approach I would hardcode it to have just one server, which means eventually I will have to go back and change code I’ve already written, wasting time. Changing old work that already works tends to be harder and more buggy than writing work the right way to begin with too.

So what’s the solution? For me, it’s an extension of the design principle I already use, which is “Don’t make decisions that have exceptions.” In this case it’s more like “Don’t make decisions I’m not absolutely sure of.” That’s a good starting point because it gives me code to work from. Some things I’m sure of:

  1. I’ll need the ability to enter text into windows for chatting.
  2. There will be at least 3 systems – a game client, a game router, and a game server
  3. For ease of testing I want to be able to run a server locally in the background from a client.
  4. I don’t want to include most of the server code when I release clients

So this actually gives me something to work from right away. I can create 3 classes, I can design those classes for code exclusion, and I can write a chatting system in the game.

Based on those modules I can think more about the problem and design other modules.

The positive results of this system are first that I don’t get paralyzed trying to think of what to do. Second, I’m unlikely to waste or redo work. Third, and most importantly, it forces me to carefully think about my systems and not gloss over details.

This is what works for me. Feel free to post your own ideas.

One reply on “Game architecture design”

I think that’s a pretty good method, I try to use the same principles as you, although I have never done a really big project like Raknet.

Are you going to merge Rakengine with this MMO project of yourself? or is Rakengine going to be a MMO engine? 😉

Leave a Reply

Your email address will not be published. Required fields are marked *