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

learn more… | top users | synonyms

2
votes
1answer
718 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
485 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 ...
3
votes
2answers
368 views

How can I improve this architecture?

In a roguelike I'm developing in Ruby, I started with a traditional object hierarchy where all game logic relevant to creatures were contained in the Creature class. Movement logic, for example: ...
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 ...
7
votes
2answers
935 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 ...
19
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 ...
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 ...
10
votes
2answers
571 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 ...
1
vote
2answers
529 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 ...
6
votes
4answers
844 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
1answer
415 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 ...
4
votes
3answers
686 views

Designing the main classes in a solar system simulation game in C++

If this is not the right place for this question, could you please direct me to a more suitable site/forum? I'm a beginner in game development (and in the use of this site). I've worked with C++ only ...
2
votes
4answers
643 views

How to code the animations of attacks in RPG game

I have an attack class that has the basics like damage and cost and works in the game. Originally I slapped it together to the the ai targeting algorithm so you choose your attack and you see the ...
2
votes
3answers
707 views

Design pattern on class level, how to do separation of concerns through mvc or alike?

Say i had a Monster class public class Monster { } Now this class has a set of properties like int health int speed int weaponDamage which details the core information about the monster. in ...
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 | +----------------------+ | ...
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 ...
11
votes
3answers
700 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: ...
2
votes
2answers
2k views

How do I get access to the SpriteBatch service in my Sprite class using XNA?

I have the following Sprite class (leaving out everything that doesn't pertain to my question): public class Sprite { public Texture2D Texture { get; set; } public Vector2 Position { get; ...
5
votes
3answers
4k views

What are some ways to separate game logic from animations and the draw loop?

I have only previously made flash games, using MovieClips and such to separate out my animations from my game logic. Now I am getting into trying my hand at making a game for Android, but the game ...
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
3answers
570 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 ...
-4
votes
2answers
881 views

Is this design a service locator design pattern?

I was reading what a service locator pattern is from this article, and now I'm just wondering if I merge service and locator classes is it still a service locator pattern or not? And if not, do you ...
3
votes
4answers
234 views

What are windows used for?

I have a very general question: In games, what use does the programming concept of a window have? Or, in other words, why do some game dev libraries offer interfaces through which to create multiple ...
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 ...
2
votes
2answers
367 views

How optimal do you think maintianing states in a sprite class?

Currently i'm working on a sprite system which will have frames which make animations. Usually a sprite contains current position, current frame number to be displayed in the running animation, ...
16
votes
2answers
6k 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, ...
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 ...
4
votes
0answers
537 views

MVC? patterns for game development? [duplicate]

Possible Duplicate: MVC-like compartmentalization in games? I am thinking of the best way to structure my project and was thought a MVC style pattern would be appropriate. Would be correct ...
7
votes
2answers
768 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 ...
3
votes
3answers
576 views

How to implment the database for event conditions and item bonuses for a browser based game

I am currently creating a browser based game, and was wondering what was the standard approach in making diverse conditions and status bonuses database wise. Currently considering two cases. Event ...
6
votes
3answers
2k views

Multiplayer / Networking options for a 2D game with physics

Summary: My 50% finished 2D sidescroller with Box2D as physics engine should have multiplayer support in the final version. However, the current code is just a singleplayer game. What should I do ...
4
votes
3answers
1k views

Reusable skill class structure

Pretty new to the whole game development scene, but I have experience in other branches of programming. Anyway, I was wondering what methods are used to implement a skill structure. I imagine a skill ...
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 ...
7
votes
1answer
414 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 ...
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 ...
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) ...
4
votes
2answers
860 views

Receiving user commands in a text based console game

I'm working on a little text based console game for a bit of fun and am starting work on the user commands entered into the console. Are there some good design patterns for deciding what to do with ...
5
votes
2answers
488 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 ...
4
votes
2answers
879 views

How to play many sounds at once in OpenAL

I'm developing an RTS game and I would like to add sounds to it. My choice has landed on OpenAL. I have plenty of units which from time to time make sounds: fSound.Play(sfx_shoot, location). Sounds ...
0
votes
3answers
799 views

Creating Level iPhone

I am thinking about a new game idea for the iPhone and presumably all the levels would have to be made programatically. So Im wondering what the best method to approach it? Say I have a game with a ...
1
vote
1answer
2k views

Where can I learn 2D game architecture [duplicate]

Possible Duplicate: Good resources for learning about game architecture? I know that game architecture can vary greatly, especially with the type of game being built, but I know that there ...
9
votes
3answers
667 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 ...
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 ...
5
votes
1answer
1k views

2d map: how to manage it?

i'm developing a 2d game (top down), and i'm a beginner. Now, i've to create a map, with object (to interact with) ... I don't know how to .. manage the problem ! Does anyone can help me ? What are ...
9
votes
3answers
772 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 ...
2
votes
3answers
431 views

Custom Rule-Based System for Action Recognition in a Game

I want to make objects in a side project interatible with each other. For this, I want to be able to create rules so "Collisions" (Interactions) can be recognised by testing the rules. The rules ...
18
votes
6answers
974 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 ...
79
votes
9answers
32k 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 ...
118
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 ...
25
votes
7answers
4k 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 ...