Game Design Patterns

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
inbuninbu
Posts: 8
Joined: Mon Feb 05, 2007 12:12 am

Game Design Patterns

Post by inbuninbu »

This isn't particular to irrlicht, but to overall game development. I'm wondering if anyone has run across good/useful game design patterns/framworks/best practices for developing games in general, and for Irrlicht in particular.
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Patterns are by definition suitable for any application.

The usefulness of every pattern depends on your design. You may probably be interested in Abstact Factory if you plan to switch the type of a set of things (like maze - magic maze - forest maze - ...), while you may prefer Strategy Pattern for game states, Observer for any triggered comunication, or may use Singleton for every manager, etc.

I wouldn't recommend using them just because they're cool. Use them if need them, do not the design your system to fit any of them, but use patterns to bring your design to life. So, first, think which's the problem you want to solve, then check if any of the patterns is useful to solve it.
Warchief's Warboard 3D Now hotseat release
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

A big mistake in game development is trying to make a generalized game engine, rather than a specialized one. I read an article on gamesutra about using the Model/View/Controller pattern in game development. After playing around with it, it seemed like a very nice way to controlling it. Especially the part about controllers only providing information when asked, and doesn't actually change the game-state manually.
Scene node animators are good for keeping scene nodes locked to their game object counterparts, without coupling the game object to the graphical part of the game.

Not really a design pattern, but I thought it might be useful info.
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

I find when I write a new Irrlicht game/app I start straight away with a basic class framework that I can easily add to or upgrade later.

This makes making a game easier and if you get a layout like this that you prefer it can help give you a starting point as to what to do next.

The main file looks something like this:

Code: Select all

#include "MainHeader.h"
int main()
{
    CEngine* engine = new CEngine(/* config data if you want */)

    engine->run();
}
edit see here for an example:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=18649
pushpork
Post Reply