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

learn more… | top users | synonyms

0
votes
1answer
39 views

Modeling object oriented snakes and ladders

I'm trying to create a basic clone of Snakes and Ladders using object oriented design. I'm struggling to model my objects and their relationships. For the time being I'm interested in moving players ...
0
votes
1answer
33 views

Class design for a risk-like game [closed]

I'm currently coding a AI for a risk-like game, but I'm not sure how I put even the base classes together. I've read a lot about game design patterns, entity component designs and such, but I've ...
0
votes
2answers
112 views

Avoiding singletons for puzzle system [closed]

Say for instance I have a puzzle with 3 switches that need to be in some configuration (say all on) in one room, that opens a door in another, with a load screen separating, so I can't link the ...
1
vote
1answer
104 views

Where to put graphic representation of game entity?

I am working on simple 3D version of Snake game. I created classes like snake and grid so far. My concern is, putting all render logic (draws cubes - to show snake, and lines to show the grid) in ...
0
votes
0answers
33 views

Advice for implementing gear/effects/abilities [duplicate]

I've been struggling with this for about a month now so I finally turn to the masters for advice. I'm working on a platformer/rpg game and I'm trying to implement gear/effects/abilities as the title ...
0
votes
1answer
34 views

Composition and passing pointers to parent, or work inside namespaces

My application right now has a Game class, which contains other classes that receive a Game pointer. Also these classes passes the Game* pointer to their subclasses. I do this to keep communication ...
1
vote
2answers
282 views

Entity Component System Coupling

Lately I've been working on a small personal project which is basically an Entity Component System framework with autoupdated Systems. While I have a pretty good idea on the way the framework should ...
1
vote
1answer
122 views

How should I structure the implementation of turn-based board game rules? [closed]

I'm trying to create a turn-based strategy game on a tilemap. I'm using design by component so far, but I can't find a nice way to fit components into the part I want to ask. I'm struggling with the ...
5
votes
1answer
205 views

City/Nation Builder - Unlocking game elements over time

Current Git (Needs more documentation) Current working prototype to play with (Git code is after a BIG refactor) Background: I'm making a javascript text city/nation builder along the lines of A ...
1
vote
1answer
215 views

How should I manage states in my game?

I can't understand what design pattern I can take advantage to build an intro screen, help screen, level select screen, game screen, game over screen, altogether. I can make one in AS3, but the code ...
0
votes
2answers
33 views

GameLogic Model as Property or Constants with lookup in other Models?

Basically imagine a game where the Player has a Weapon which has a BulletType/type of Bullet. Now Player, Weapon and Bullet are Models having properties and they would represent Instances in the ...
7
votes
1answer
412 views

User vs Player Model

A lot of the online games out there have this concept of "User" or "Profile", and the concept of "Player". The "User" has username, password, lifetime stats, ... etc. The player concept is per game ...
1
vote
1answer
181 views

How should I implement the “Observer” pattern with respect to a game world?

I'm thinking of ways to implement the Observer pattern in a game I'm developing at the moment. I can have a Game World (local map) with Game Objects (player, NPCs, monsters etc...) inside of it. Other ...
2
votes
1answer
114 views

Obstacle spawn constraints in Jetpack Joyride

Jetpack Joyride: https://www.youtube.com/watch?v=3KENMuzsras tl;dr What's the best way to add constraints to obstacle spawning (algorithms) or how to design obstacle spawning to allow constraints? ...
6
votes
2answers
125 views

Must all AI states be able to react to any event?

FSMs implemented with the State design pattern are a common way to design AI agents. I am familiar with the State design pattern and know how to implement it. How is this used in games to design AI ...
2
votes
0answers
42 views

Localization patterns [closed]

I want to disponabilize my game in various languages and for it I want to use industry standards, but it has been dificult to find any material on google. I am looking for patterns, conventions, file ...
2
votes
2answers
275 views

Which Design Patterns Should I consider for Quest Management? [closed]

I am working on an fantasy RPG and I would like to get some ideas about how I am implementing Quests. Quests in my game are very generic. The quest goal can be almost anything in the game. The goal ...
6
votes
0answers
199 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 ...
1
vote
1answer
60 views

When is messaging/observing preferable to 'built-in' functionality in game objects?

In working on a Python/Pygame project I recently came to an impasse which couldn't be solved elegantly via my previous methodology - using wrapping functions as an Observer pattern - and it was ...
1
vote
2answers
171 views

Data Locality and Polymorphism [closed]

I've been reading over the various chapters available at http://gameprogrammingpatterns.com, and in particular his chapter over Data Locality(http://gameprogrammingpatterns.com/data-locality.html) has ...
1
vote
2answers
381 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
230 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
118 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
60 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
381 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
355 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
63 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 ...
14
votes
2answers
461 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
111 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
287 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
159 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
707 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
179 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
623 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
573 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
204 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
119 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
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 ...
14
votes
3answers
635 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
368 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 ...
4
votes
4answers
560 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
2k 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
209 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
2k 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
285 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
277 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
0answers
118 views

inheritance and state machine with flyweight pattern

I everyone, i'm working on an indie game and i'm stuck with two problems I have many similar units on screen so i decided to implement the flightWeight pattern so there is intrinsic and extrinsic ...
0
votes
1answer
259 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
290 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 ...