Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
95 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

Development requires a certain level of Enginuity

This series of mine is going, layer by layer, to take you through building an engine - as you may have guessed, I'm christening it 'Enginuity' (shoot me when I'm done writing).

Here's the 'requirements' for the engine:

  • It has to be as cross-platform as possible (That is, 'desktop' platforms, not consoles - Windows 98+, Linux, and Mac OS X).
  • It should be reusable.
  • It should support cross-platform networking (that is, games on Linux can network with games on Windows, and so on).
  • It should be designed in such a way that it's simple to add new components or replace existing ones on a project-by-project basis.
  • It should run at adequate speeds on a Pentium 3 1.1ghz machine with 32mb GeForce 2 graphics card (that's our 'minimum spec,' or 'minimum technical requirements,' more or less. Much of the speed will depend on the game you run it with, though - a 3D shooter will obviously run slower than Tetris, even though they may be built on the same engine).
  • It should be designed in a way that is fairly simple to understand and teach (otherwise I might just as well be talking to myself here :)

It's going to be written in C++, and we're not going to work from scratch - we'll use SDL for graphics (and, thus, OpenGL), input, and timers; SDLNet for networking; and FMOD for sound (so if you want to see someone initialize DirectX/OpenGL for the nth time, go somewhere else - there's nothing achieved by reinventing the wheel). That should pretty much fulfill the cross-platform, networked, and minimum technical requirements parts of the spec; the rest is down to us.

Feel happy - you can tell people that you're going to 'achieve reusability through modularity in an object-oriented design.' (Not that you couldn't tell people that before, of course. Unless you had your mouth full or something. My point is.. actually, never mind).

No series of articles would ever be complete without source code, and rest assured that it will be provided in ample quantities. In fact, the source may cover even more than what I talk about - you'll get to see things that I toyed with before deciding not to discuss - like the bits left over from my attempt to build the engine as a DLL under Windows, and other (usually fairly irrelevant) things that may serve to confirm your fears that I don't know what the heck I'm talking about.

I cannot stress enough that an engine is a large, fairly complex topic, and newbies should not even think about approaching it until they're totally competent with the language (C++). Put it this way: If you can work out what a 'templated class that inherits from multiple virtual base classes and overloads the pointer-to-member operator' is, then you're ready. If not, then sorry, but you simply won't understand some of the code and design techniques I'm going to use in the series. You're welcome to glean what you can, but I'm not going to pitch to the lowest level here; if I spend all my time explaining language concepts, we won't get anything done.

What's the ultimate aim of this, then? I'm thinking that building a game engine isn't nearly as much fun unless you build a game on top as well (because, let's face it, general-purpose game engines are what you make when you're out of ideas for games). So what I'll try to do is, at opportune times, build simple games (we're talking *really* simple) on the engine in it's state at the time. You can almost think of them as milestones in the development process.

That's about all I've got to say for this article. Next week, I'll give you an overview the 'foundation layer' of the engine, and cover some of the most fundamental topics, such as error logging and memory management. In the meantime, you'll want to be reading up and downloading SDKs from the following places:

http://www.libsdl.org/ - Home of both SDL and SDLNet (SDLNet in the Libraries section).
http://www.fmod.org/ - The FMOD home page.
http://nehe.gamedev.net/ - The (in)famous NeHe OpenGL tutorials (newbie to pro in sixty minutes, or something like that)

Richard Fine (rfine at tbrf dot net)

  Page 2

  Printable version
  Discuss this article

The Series
  Part I
  Part II
  Part III
  Part IV
  Part V