Design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
4
votes
4answers
157 views
Better way of handling the relation between Bullet and Enemy
I was wondering how should I design this relation in terms of "better OOP"?
Should I have a Singleton EnemyManager which contains a list of enemies (EnemyList); then Bullets can access the EnemyList ...
0
votes
1answer
32 views
Where should I cast new bullets? [closed]
Should I
Cast new bullets from my Weapon class, which would test a flag when its updated that tells if mouse left is down, which is set by Input class
Cast new bullets from my Input class, which ...
14
votes
3answers
2k views
Separating Game Engine from game code in similar games, with versioning
I have a finished game, that I want to decline in other versions. These would be similar games, with more or less the same kind of design, but not always, basically things might change, sometimes ...
16
votes
2answers
2k views
How to design context menus based on whatever the object is?
I'm looking for a solution for a "Right Click Options" behaviour.
Basically any and every item in a game, when right clicked, can display a set of options based on whatever the object is.
Right ...
1
vote
1answer
54 views
Buttons implementation with regards to a basic Game Loop
As the title states I am creating a game with SFML being the only library used.
I am entirely unsure how to go about this.
I want the buttons to be activated by simple mouse clicks (when the mouse ...
0
votes
1answer
110 views
How to manage a vector of “Component” base class?
I'm trying to implement a component based design for a game i'm making. I decided to write it in c++ but i'm not very good at it. Coming from a java background I encountered a problem when trying to ...
1
vote
1answer
157 views
How can I handle invulnerability in an entity system?
I currently have an entity component system with messaging. The messages are delivered to each subscriber, but each subscriber gets their own copy, basically meaning that altering a message doesn't ...
0
votes
1answer
171 views
Handling AI with ECS in a turn based roguelike
I am trying to implement the Entity Component System pattern to use in a roguelike game. Right now, I have 3 systems. Input, AI, and Action. The input system basically is just a system used by the ...
1
vote
2answers
137 views
Design Pattern for card game objects
In my game, I will have more than 100 types of cards,
and before the actual game, player can select 6 of them and will be shown as 6 buttons on the scene.
The card have its own ID, card name, and a 3D ...
2
votes
0answers
113 views
How to develop and optimize the illusion of meaningful character development between the player and NPCs? [closed]
How to develop and optimize the illusion of meaningful character development between the player and NPCs?
It's very hard for a game developer to create unlimited dialogue options for just one NPC for ...
1
vote
0answers
54 views
Security-minded design patterns / paradigm for client/server application
I am working on a client/server application and am starting to take it from proof-of-concept to actual implementation. The client is an Android application and the server is in PHP. In similar ...
0
votes
1answer
47 views
Logical Dependencie Problem [closed]
I am working with Unity and C#, but my Problem is a more general programming problem. I am trying to keep things easy, but still make them global access able and easy to modify.
So I have a ...
0
votes
0answers
90 views
Quest/Dialog Tree XML template
I'm looking for a good XML template, so I can create my quests/dialogs easily.
It should be something which permits:
multi-staged quest/dialogs with branching.
ask user for some choice, to traverse ...
3
votes
1answer
202 views
Implementing The Command Pattern - Undo And Entity References
I am trying to implement a replay/undo system for a turn based strategy game I am currently working on. A sample move could go as follows:
1. A players select a pawn and gives it an attack command.
...
0
votes
0answers
74 views
Unity Input manager with chain of responsibility and delegates
I am working with unity and I am trying to build a better input system for my game.
In essence there would be a singleton class that is the input manager.
The player would subscribe to the manager ...
8
votes
2answers
182 views
Large scale iterative design
Typically in game development, linear development (waterfall model) is riddled with obstacles that drain the programmer's sanity (game turned out horrid, can't redesign). Enter iterative design. ...
1
vote
1answer
57 views
Observer pattern for clickable 2D Elements?
So i am currently thinking about the best way to handle and implement clickable 2D menu elements in a very simple DirectX Game.
I very much like the idea of having subscribers to a event where they ...
0
votes
1answer
48 views
Design Pattern for “Default Object”
I'm making a first person dungeon crawler like Eye of the Beholder.
During execution, I have a Map object. It contains Cell objects. Anc each Cell contains, at most, four Wall objects.
The Wall ...
1
vote
0answers
54 views
Update function - design patterns [closed]
I started reading about game development design patterns and from my experience there are 2 options for update methods. The first one receive from the game loop and delta time of this update and ...
-1
votes
1answer
294 views
Implementing FSM on multiple class UNITY3D
I am recently implementing design patterns on my project, while researching around I came across many advance techniques like HFSM ,Behaviour trees.
I did implemented behavior trees wherever required ...
4
votes
2answers
340 views
How should entities in a game reference each other?
I've been reading a lot about design patterns, but in using these patterns there's one question that I keep coming back to. How should my entities access information about each other?
Let's say I'm ...
1
vote
2answers
99 views
Position problems instantiating lasers at the sides of a space ship
I'm developing a demo of a 3D Space Ship game concept in Unity, just for learning purposes.
I have a cube representing my space ship in the scene, and a laser prefab that is instantiated at the 2 ...
-2
votes
1answer
150 views
Is Minecraft component-based or does it have class for every block? [closed]
I'm wondering if Minecraft has class for every type of block or blocks are just IDs in code.
EDIT
And what about data like transparency, resistance, hardness, tool, etc? Are they hardcoded or stored ...
0
votes
1answer
229 views
Organizing a Transform class to internally use quaternions
So, I'm interested in building a Transform class similar to the one used in Unity Engine, but in C++. My intent is for it to be user-friendly to change the position, rotation, and scale of a variable ...
1
vote
2answers
710 views
Elegant ways to handle rendering with DirectX 11
I'm looking for a design pattern that's going to help me to elegantly handle the rendering of my game objects.
Lots of game development guides talk about how to handle the game objects themselves, ...
21
votes
3answers
3k views
Command Ordering Architecture of Dwarf Fortress
What is the most elegant way to implement a command ordering system for AI? for example in dwarf fortress when you mark a forested area for wood cutting, the dwarfs then would do the following ...
0
votes
1answer
65 views
Application components dependancy and decoupling
In my client application I have two major components:
GameCore - wrapper that handles everything about running the actual game
NetworkClient - A layer that takes care of ...
2
votes
1answer
114 views
Design pattern for level editor modes?
In a level editor that supports multiple editing modes, written in an oop language, how would you go about switching from mode to mode, considering that data itself remains the same?
I am using a MVC ...
0
votes
2answers
154 views
Do I really need a render() method in the game loop if the view subscribes to the models?
For a game that I'm working on, we've followed the MVC paradigm. However, in classic MVC, the view subscribes to the model and when the model updates it informs the view. We've implemented this as an ...
5
votes
3answers
284 views
Decoupling AI from game logic
Imagine a game with different types of characters or "actors" which can perform actions like walking and shooting. They are implemented using the state pattern to reduce the amount of coupling: each ...
1
vote
1answer
142 views
Handling creation of entities on level creation
I'm currently working on a 2d physics based plat former, kinda in the style of super meat boy. In super meat boy, you have multiple levels and I want a similar sort of thing but is there a general way ...
1
vote
1answer
122 views
2D Collision : detection and design [duplicate]
So, listening to this very smart piece of advice, I've already completed a basic Tetris game. Moving on, I started a small breakout. But suddenly : a nightmare came. Collisions.
Since I've been ...
0
votes
0answers
50 views
Is there such thing as a design pattern for game character attributes? [duplicate]
I'm toying with the idea of a character based game. The characters, robots, monsters, heroes (and weapons I suppose) will all have various attributes as per a D&D game for example.
They player ...
2
votes
1answer
205 views
Is there a pattern for handling multiple game states?
I'm experimenting with writing a multiplayer game, almost from scratch (I'm using C++, OpenGL, ENet, and platform-specific APIs) with a client/server networking model where the server is ...
14
votes
4answers
3k views
Should a socket server and game server be separate processes?
Assume a simple standard client/server game. For the server, is it worthwhile to have a separate process that listens for connections and messages from clients and sends the data via local sockets or ...
0
votes
1answer
284 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
86 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
145 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
146 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
1answer
49 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 ...
2
votes
2answers
507 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
642 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
373 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 ...
2
votes
1answer
321 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
37 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
494 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
465 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
208 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
142 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
49 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 ...