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

learn more… | top users | synonyms

117
votes
8answers
23k views

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

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 ...
79
votes
9answers
31k 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 ...
18
votes
3answers
2k views

MVC-like compartmentalization in games? [closed]

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 ...
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 ...
20
votes
2answers
4k 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 ...
10
votes
2answers
567 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 ...
35
votes
5answers
4k 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 ...
19
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 ...
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
1answer
4k 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 ...
6
votes
4answers
3k 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 ...
1
vote
2answers
525 views

3D game: is a spatial index necessary?

I'm working on a 3D space simulation game in C++. I've read that in many cases games use spatial indexing (hashing) that allows to quickly detect collisions, find out what entities to draw and so ...
7
votes
4answers
4k 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) ...
16
votes
5answers
878 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 ...
7
votes
3answers
456 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, ...
7
votes
2answers
766 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 ...
5
votes
2answers
2k views

Component based game engine and dependencies - singletons [closed]

I am thinking about how to create component based game engine. I understand that all things should be very similar as in Data Oriented Design (each object is a collection of various structures as ...
5
votes
4answers
1k 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 | +----------------------+ | ...
6
votes
4answers
288 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 ...
5
votes
2answers
487 views

Seperating entities from their actions or behaviours

I'm having a go at creating a very simple text based game and am wondering what the standard design patterns are when it comes to entities (characters, sentient scenery) and the actions those entities ...
2
votes
1answer
699 views

What threading strategy does a game like Transport Tycoon use?

Transport Tycoon is a simulation game where you control a transport company, place railroad tracks and trains, airports, bus depots, boats etc. Now the game is about 15 years old and I remember ...
7
votes
1answer
589 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 ...
0
votes
1answer
292 views

iOS with cocos2d to MVC or not to MVC?

I am working with cocos2d. All my objects are declared on the CCLayer that I'm using, I have the logic of the game there and all the CCSprites. Should I put the CCSprite for the player and all it's ...
0
votes
1answer
813 views

In some games, we just let the main() loop be the Player object or Table object?

I was thinking that let's say if there is a game of Blackjack or MasterMind, then we should have a class called Dealer or ComputerPal, which is how the computer interact with us (as a dealer for ...