Design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.

learn more… | top users | synonyms

111
votes
8answers
18k views

Why are MVC & TDD not employed more in game architecture?

I will preface this by saying I haven't looked a huge amount of game source, nor built much in the way of games. But coming from trying to employ 'enterprise' coding practices in web apps, looking at ...
74
votes
9answers
26k views

What are some programming design patterns that are useful in game development? [closed]

I have a few books on Design Patterns, and have read some articles, but cannot intuitively figure out which programming design patterns would be useful in game development. For example, I have a book ...
35
votes
5answers
3k views

How to avoid the GameManager god object?

I just read an answer to a question about structuring game code. It made me wonder about the ubiquitous GameManager class, and how it often becomes an issue in a production environment. Let me ...
25
votes
7answers
3k views

Do retail games use “inversion of control” and “dependency injection”?

Many of the more diligent software developers I know are moving to inversion of control and dependency injection to handle references to objects. Coming from a Flash games perspective I don't know all ...
20
votes
2answers
3k views

How to Interpolate between two game states?

What is the best pattern to create a system that all the objects positions to be interpolated between two update states? The update will always run at the same frequency, but I want to be able to ...
18
votes
6answers
945 views

What are the biggest pitfalls to consider when developing a new game?

I actually just started tracing (thanks David Young for the nomenclature correction) a couple of new web-based games for Facebook a few weeks ago and I have just been inundated with mental blocks and ...
18
votes
2answers
1k views

If “ResourceManager” classes are considered bad, what are the alternatives?

I'm hearing conflicting opinions such as: "Dedicated Manager classes are almost never the right engineering tool" "Dedicated Manager classes are (currently) the best way to survive a large project ...
18
votes
3answers
2k views

MVC-like compartmentalization in games? [on hold]

I was contemplating the design of a game (translating a boardgame to the computer, specifically, which I suppose is relevant in this case) and it occurred to me that it might make sense to build the ...
17
votes
4answers
3k views

“The Game Object” - and component-based design

I've been working on some hobby projects the last 3-4 years. Just simple 2d and 3d games. But lately I have started a bigger project. Soo in the last couple of months I've been trying to design a game ...
16
votes
5answers
861 views

Dictionary of common names for code objects [closed]

I'm looking for a common dictionary of terms (much like design patterns have a common language for how things interact) that are specific to games. For instance, if I'm making a game of pong with a ...
15
votes
2answers
5k views

Designing a component based game

I'm writing a shooter (like 1942, classic 2D graphics) and I'd like to use a component based approch. So far I thought about the following design: Each game element (airship, projectile, powerup, ...
14
votes
5answers
554 views

How can I design lots of different attack types that can be combined?

I'm making a top down 2D game and I want to have a lot of different attack types. I'd like to make the attacks very flexible and combine-able the way The Binding of Isaac works. Here's a list of all ...
14
votes
3answers
592 views

How to represent projectiles in video game?

I'm making a simple fixed shooter game (similar to Galaga) as part of a presentation I'm doing. I'm wondering, what strategies/data structures would people use for tracking projectiles (like lasers ...
13
votes
6answers
4k views

Game Components, Game Managers and Object Properties

I'm trying to get my head around component based entity design. My first step was to create various components that could be added to an object. For every component type i had a manager, which would ...
13
votes
3answers
1k views

Avoiding singleton pattern for Event Scheduler?

I want to make an Event scheduler for my Game, I basically want to be able to schedule the triggering of a Game Event. This can be a one time trigger, or a periodic trigger (trigger event ...
13
votes
2answers
1k views

Design of a turn-based game where actions have side-effects

I am writing a computer version of the game Dominion. It is a turn-based card game where action cards, treasure cards, and victory point cards are accumulated into a player's personal deck. I have the ...
12
votes
2answers
376 views

Does game development have its own types of modeling?

In general computer science there are modeling "languages" (read: standardized diagramming techniques) such as UML 1,2, in databases there are things like ERD3, in business there are other types such ...
12
votes
3answers
686 views

Design patterns for rules systems?

As a quick fun project, I tried writing a solitaire game. But when getting to writing up the rules systems, I felt dirty, because my code felt completely unstructured and inextensible, mainly because ...
11
votes
12answers
2k views

Are there cases where globals/singletons are useful in game development?

I know that having global variables or singleton classes creates cases that can be difficult to test/manage and I have been busted in using those patterns in code but often times you gotta ship. So ...
11
votes
3answers
667 views

I want to get rid of my make-everything-static-and-global design pattern, but how?

I'm making a little dungeon crawler in space, and I'd like to hear some advice on how to make the backend of the engine nicer. Basically, currently everything is based on a crapload of managers: ...
10
votes
3answers
3k views

Custom allocators used in game development

I have been researching creating my own allocator methods (that will support things such as a memory pool and profiling), however, as I continue my research I have been looking for how this was done ...
10
votes
7answers
2k views

Seperation of drawing and logic in games

I'm a developer that's just now starting to mess around with game development. I'm a .Net guy, so I've messed with XNA and am now playing around with Cocos2d for the iPhone. My question really is more ...
10
votes
1answer
3k views

Designing a ResourceManager class

I've decided I want to write a central ResourceManager/ResourceCache class for my hobby game engine, but am having trouble designing a caching scheme. The idea is that the ResourceManager has a soft ...
9
votes
2answers
498 views

Correct way to abstract an XBox Controller

I've got a XBox360 controller which I'd like to use as input for an application. What I can't work out is the best-practice way to expose this via an interface. Behind the scenes, the class which ...
9
votes
3answers
717 views

Using “friend” classes in game development

Typically in C++ game development speed is valued over encapsulation, you therefore see a ton of publicly accessible class members which really shouldn't be public. I seem to find in most cases that ...
9
votes
1answer
412 views

Is it worthwhile to use particle pools in managed languages?

I was going to implement an object pool for my particle system in Java, then I found this on Wikipedia. To rephrase, it says that object pools aren't worth using in managed languages like Java and C#, ...
9
votes
3answers
645 views

What pattern is this, and should I do it?

I'm making a game in as3 using flash develop and flash cs5. Everything is object oriented. I was wondering, should I have one "gateway" class that has a property-reference to all instantiations of ...
9
votes
3answers
2k views

Creating Entity as an aggregation

I recently asked about how to separate entities from their behaviour and the main answer linked to this article: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ The ultimate concept ...
8
votes
3answers
271 views

How to have operations with character/items in binary with concrete operations?

I have the next problem. A item can have a lot of states: NORMAL = 0000000 DRY = 0000001 HOT = 0000010 BURNING = 0000100 WET = 0001000 COLD = 0010000 FROZEN = 0100000 POISONED= ...
7
votes
4answers
3k views

Per-Frame Function Calls versus Event Driven Messaging in Game Design

The traditional game design, as I know it, uses polymorphism and virtual functions to update game objects states. In other words, the same set of virtual functions are called in regular(ex: per-frame) ...
7
votes
1answer
527 views

Pattern for performing game actions

Is there a generally accepted pattern for performing various actions within a game? A way a player can perform actions and also that an AI might perform actions, such as move, attack, self-destruct, ...
7
votes
2answers
729 views

Capitalizing on JavaScript's prototypal inheritance

JavaScript has a class-free object system in which objects inherit properties directly from other objects. This is really powerful, but it is unfamiliar to classically trained programmers. If you ...
7
votes
2answers
798 views

Is Domain Driven Design good for games?

I've just read about Domain models and it enlightened me since I've been developing a game that has a class which only holds data (few behaviors/methods). I assigned the job of handling these classes ...
7
votes
1answer
458 views

Design of a camera system

Thinking about a common game, doesn't matter the type of the game, it's very likely that we need some camera type. For example: Debug camera: controlled by keyboard and mouse, with that we are able ...
7
votes
1answer
412 views

How can I selectively update XNA GameComponents?

I have a small 2D game I'm working on in XNA. So far, I have a player-controlled ship that operates on vector thrust and is terribly fun to spin around in circles. I've implemented this as a ...
7
votes
3answers
439 views

Profiling and containing memory per system

I have been interesting in profiling and keeping a managed memory pool for each subsystem, so I could get statistic on how much memory was being used in something such as sounds or graphics. However, ...
6
votes
4answers
753 views

Java collections and managing simultaneous operations / concurrency (java.util.ConcurrentModificationException)

Ok, so i have created my first "game" and it uses a lot of java's collections. for example, i have a bunch of monsters in a HashSet which sometimes gives me the fabled ...
6
votes
4answers
1k views

MVC or Components, or both?

I'm an experienced developer but recently I've been wanting to get into game programming but as you know game development is an entirely different beast from most other forms of programming (perhaps ...
6
votes
4answers
230 views

Should references between assets be handled by name or ID or something else?

How should content or asset items be referenced in their serialized form? For example, a material might need to reference several textures. The simplest way would be to use a path, relative to the ...
6
votes
4answers
1k views

How does an Engine like Source process entities?

[background information] On the Source engine (and it's antecessor, goldsrc, quake's) the game objects are divided on two types, world and entities. The world is the map geometry and the entities are ...
6
votes
1answer
181 views

Applicability of Business Architectures in XNA 4

I've done a lot of C# programming and the architecture we use of late is a MVC => PresentationService => Domain Service And/OR DataService => Repository with a UnitOfWork and a messaging bus. In web ...
6
votes
3answers
557 views

Trophies programming design pattern

What design pattern is best for implementing trophies in a game? I am not a games developer, but is it easy for each player's action to check and update conditions that satisfy 50-100 trophies at any ...
6
votes
4answers
2k views

Retrieving components from game objects (entities)

Using C# and XNA 4, I've made the decision to go for an entity-component based design for my game after reading such posts as this and this, but I'm now struggling to find how to retrieve components ...
6
votes
1answer
404 views

How should I approach architecting a data-driven shoot-em-up?

I'm venturing into Mobile/Tablet based development coming from the world of Web Applications. I want to write a game similar to 1942/43 video game from the 80's: ...similar in the sense that I have ...
6
votes
4answers
333 views

Passing data between engine layers

I am building a software system (game engine with networking support ) that is made up of (roughly) these layers: Game Layer Messaging Layer Networking Layer Game related data is passed to the ...
6
votes
1answer
448 views

Rule / validation design pattern

What design patterns can be used to create a rule / validation system for a game like chess (this is just a simple example, the actual game needs more difficult sets of rules) I've read several ...
6
votes
0answers
155 views

Is a responsive dimension game worth it? [closed]

I'm in the process of creating a Wario-Ware-like game that will be created for browsers first then likely ported to mobile. Here are the different ways I've considered setting up the dimensions of the ...
5
votes
4answers
995 views

Database structure for a trading cards video game (TCG)

Just started and after pondering with registered users' table everything came to a halt. So far I've got: +----------------------+ | tblUsers | +----------------------+ | ...
5
votes
2answers
378 views

Software engineering theory for hobbyist developers

In playing around with my hobby projects in various object oriented languages, I have realized that creating good class structure and program architecture is both crucial and not straightforward to ...
5
votes
1answer
246 views

Dynamic Components

I am attempting to design a component-based architecture that allows Components to be dynamically enabled and disabled, much like the system employed by Unity3D. For example, all Components are ...