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
2answers
565 views

How do I separate testable game logic from my UI in Cocos2d-x?

I read some articles on why I should separate game logic and UI code: That makes it possible to test game logic code can be independently of the rest. However, I am having trouble implementing this in ...
5
votes
2answers
244 views

Is having a master builder object a bad idea?

I have wondered about using the following approach to creating Entity objects in a personal project. What I want is to be able to keep track of all Entity objects that get created, so whenever an ...
2
votes
1answer
129 views

How can I reuse animated meshes?

When creating meshes, I made a mesh class and then used that one as base model and redrew that same mesh for each instance of an object with that mesh. (For eaxmple, one rock mesh, many rock objects.) ...
0
votes
0answers
65 views

How can I position different size creatures in a group automaticly

I'm doing a game (in xna) on my free time, as I'm not in the game market, I'm pretty sure I'm missing something that would help me get this right. Think of Ogre Battle. A group of unit moves, and ...
3
votes
2answers
408 views

How should I design my classes in a game?

I'm stuck for ideas on classes in game programming. This is probably more of an opinion based question. I'm looking for information that is proving hard to find on the internet. Say I have a class ...
1
vote
2answers
746 views

Should game objects draw themselves? [duplicate]

Assuming you have classes like Player, Enemy, Map and Tile. The first approach to structuring rendering code would be to give each a render() method and let it draw itself: void render(){ ...
1
vote
0answers
74 views

Designing & Implementing a generic actions & communication system [closed]

I'm currently in the process of redesigning the action/communication/sound system of some small game. This part currently handles characters speech and emotes. The game itself allows for a lot of ...
15
votes
2answers
499 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 ...
2
votes
2answers
165 views

Why aren't resources such as Pixmap disposed on finalization in LibGDX?

I've been looking at the LibGDX framework, and certain classes such as Pixmap require to be disposed manually when you are no longer using them (call the dispose method). I'm wondering, since this is ...
6
votes
4answers
356 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 ...
1
vote
1answer
176 views

Making specific Enemy Classes

So I was just looking through an old game I had made for android, and was second guessing how I was sub-classing enemy for each particular enemy in my game. My enemy class had all kinds of ...
2
votes
3answers
1k views

Visitor-pattern vs inheritance for rendering

I have a game engine that currently uses inheritance to provide a generic interface to do rendering: class renderable { public: void render(); }; Each class calls the gl_* functions itself, ...
1
vote
1answer
278 views

Best practice child and parent script [closed]

What is the best practice coming to wher to place the code in this scenario. I have a gamobject called player. It has lots of child objects. One of them is sword. Like this: Player Body Head ...
16
votes
4answers
677 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 ...
1
vote
2answers
2k views

C# Design for Ability System

I'm a novice programmer but I have completed a pre-university in web prog so I am not a total noob. I'm using Unity, but this is just C# for now. This is my first big project and I need some ...
-1
votes
2answers
236 views

How to structure the code of a game? [closed]

I come from a web development background and want to learn game programming. To bridge the gap, I plan on creating a simple one-on-one fighting game in JavaScript. There’s two fighters on a stage, and ...
2
votes
2answers
123 views

Design problem with specific requirements (logical dependencies needed)

I started to write some code for a small 3D environment. This week I wanted to start with my entities and when I thought about it again, I stumbled across some unmet requirements. My design works fine ...
0
votes
1answer
376 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 ...
14
votes
3answers
664 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 ...
6
votes
4answers
431 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 ...
5
votes
4answers
877 views

Inheritance Hierarchy and Design — avoiding multiple inheritance

I am working on a 3D game, and need some advice about how to best design and structure my code so that I achieve what I'm going for without using bad practices like multiple inheritance. Basically ...
3
votes
2answers
3k views

C# Item system design approach, should I use abstract classes, interfaces or virutals?

I'm working on a Resident Evil 1/2/3/0/Remake type of game. Currently I've done a big part of the inventory system (here's a link if you wanna see my inventory, pretty outdated, added a lot of ...
3
votes
1answer
214 views

Whats the best way to expose current settings to your classes? [duplicate]

Just as the title states, whats the best way to expose current settings like resolution to my classes? (I know this might have been asked, but I couldn't find anything) I was thinking of the ...
1
vote
5answers
3k views

Entity System creating Components

Over every entity system I see implemented in C++, or even in Java/C# (e.g. the Artemis framework). I see components not allocated via a new operator (or something similar, e.g. std::make_shared). For ...
4
votes
2answers
355 views

Manage user input and diffentiate it between the player and the app

I hope the title makes sense. Basically, I am trying to figure out how the app will know I the input I am sending it is meant for the app and not the player, and vice-versa. (It is very similar to ...
2
votes
1answer
287 views

Where to put common System functionality in Entity-System Design?

I am working on an Entity System design based largely off of Adam Martin's design and Ray Wenderlich's Objective-C Implementation. I am working on the AI system using a state machine with a System ...
0
votes
1answer
285 views

Ideas wich design patterns apply in my school assignment [closed]

For a assignment for school i've to develop a game in Microsoft XNA 4. Let me first clear out that my intention of this post is NOT to give me codes. I want to figure out things by my self. The ...
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 ...
2
votes
1answer
398 views

What is the best design pattern to apply effects and abilities?

What would be the best design pattern to apply effects and abilities in a game. For example: I have a unit that has base stats like attack power, defense etc. The unit can hold several items that ...
4
votes
2answers
759 views

Game Editor plugin architecture

I'm creating 3D Game Editor for my own use. As rendering i took Ogre3D and MFC as UI. I faced with architecture problem. I am using Document/View architecture and for each Doc. i create new ...
1
vote
0answers
273 views

What is the right way to use a QStateMachine for a text adventure game? [closed]

I have seen a couple topics about this already but they were a bit vague for me so I decided to make this. I'm working on a little adventure game just for fun in Qt, its basically just text on the ...
16
votes
5answers
894 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 ...
8
votes
1answer
727 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 ...
14
votes
2answers
2k 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 ...
4
votes
2answers
1k views

Making character's skills and abilities as commands, good practice?

I am designing for a game that consist of characters who have unique offensive skills and other abilities such as building, repairing, etc. Players can control multiple of such characters. I'm ...
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 ...
8
votes
3answers
299 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= ...
1
vote
1answer
233 views

How can I refactor my code to use fewer singletons?

I started a component based, networked game (so far only working on the server). I know why singletons can be bad, but I can't think of another way to implement the same thing. So far I have: A ...
-1
votes
3answers
323 views

correct pattern to handle a lot of entities in a game

In my game I usually have every NPC / items etc being derived from a base class "entity". Then they all basically have a virtual method called "update" that I would class for each entity in my game at ...
1
vote
1answer
132 views

How to model / where to store relational data between classes

I'm trying to figure out the best design here, and I can see multiple approaches, but none that seems "right." There are three relevant classes here: Base, TradingPost, and Resource. Each Base has a ...
1
vote
2answers
1k views

References about Game Engine Architecture in AAA Games [closed]

Last weeks I focused on game engine architecture and learned a lot about different approaches like component based, data driven, and so on. I used them in test applications and understand their ...
1
vote
2answers
199 views

Which are the cons of using only non-member functions and POD?

I'm creating my own game engine. I've read these articles and this question about DOD and it was written to not use member functions and classes. I also heard some criticism to this idea. I can ...
3
votes
1answer
429 views

Settings object with singleton pattern

I need to build an object that will have only one instance because this Object is dedicated to the storage of vital settings for my application and I would like to avoid a misuse of this type or a ...
5
votes
1answer
275 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 ...
5
votes
3answers
1k views

How can be data oriented programming applied for GUI system?

I've just learned basics of Data oriented programming design, but I'm not very familiar with that yet. I've also read Pitfalls of Object Oriented Programming GCAP 09. It seems that data oriented ...
9
votes
1answer
1k 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, ...
2
votes
1answer
364 views

Techniques for separating game model from presentation

I am creating a simple 2D game using XNA. The elements that make up the game world are what i refer to as the "model". For instance, in a board game, i would have a GameBoard class that stores ...
3
votes
2answers
1k views

Monster's AI in an Action-RPG

I'm developing an action rpg with some University colleagues. We've gotton to the monsters' AI design and we would like to implement a sort of "utility-based AI" so we have a "thinker" that assigns a ...
-3
votes
1answer
542 views

The most popular pattern for game-related programming in C++ [closed]

As the title says, what are the most popular design solutions when creating a new game or a new game engine?
3
votes
2answers
748 views

Design pattern for creating multiple enemies

I'm currently attempting to implement a factory method pattern for creating multiple different enemies after loading data from a file. But I'm having second thoughts on what would be the best design ...