Design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
1
vote
1answer
47 views
how to make client and server to develop independently?
Currently, all i want to do is rapid prototyping of Tower-Defense-Like game, which means that i just need write client code only,single player, play with AI system. but shortly afterwards, maybe it's ...
2
votes
5answers
127 views
Most efficient way of communication between “unfamiliar” game objects?
Title could look vague, so here's what I actually mean.
Three groups of people are walking in the city. These are Guards, Thieves and Citizens.
Something has happened in the city, Thief have stolen a ...
3
votes
1answer
105 views
Pattern for collision handling?
I am writing a game with Java. There are many different kinds of entities on the screen, like the player, NPCs, monsters, bullets, items, shiftable blocks and so on.
This question is not about ...
1
vote
2answers
95 views
Register Enemies in game development
I'm working on a game to learn the basic for game concepts. I end up with the following problem. I got a class called enemy, but now I want different types of enemies. These enemies extend from this ...
0
votes
1answer
57 views
Qt based C++ game structure : which class types to use here, and how to correctly structure the relationship between these objects
I am writing a C++ game using Qt. As this is the first time, I am trying to understand how the structure should be.
I have two objects derived from the type QGraphicsRectItem which appear as boxes on ...
0
votes
1answer
73 views
is mvc design pattern good for developing video games? [closed]
how mvc design structure works in game development and specially in unity game development.
I know what mvc is and how it works but in coding structure for game development specially in unity I don't ...
0
votes
1answer
94 views
Where do I handle my input in a basic game loop?
I recently had the occasion to work on a game during a gamejam at my college and it really got me into it so I've decided with a friend of mine to start something more polished. During the gamejam, I ...
0
votes
0answers
13 views
Compostions and mixins in JS
I got some trouble with compostions and mixin.
For examples, lets imagine that we have a AHero and Hero1 object.
All heroes can move, so AHero.move() is a thing.
And now, at a moment of the dev, I ...
3
votes
2answers
193 views
What do I need to consider before making any class singleton? [closed]
I am sure most of my classes like for rendering text, sprite, shapes are not going to need more than one instance. Is it adequate to consider only this fact that its only going to need one instance? ...
0
votes
1answer
64 views
A class for all levels or for each level an own class?
My Game become more complex with each new Level or Map that I design.
The game is an basic rpg game like Pokemon.
For now I have one class that organize all Maps but different maps have special ...
5
votes
1answer
123 views
Creating a player that can hold different items
I am making a game using Java, LibGDX and Box2D. What would be the best way to create a player that can hold:
no item
one item from group A
one item from group B
one item from both groups
Items from ...
3
votes
2answers
104 views
what are the techniques to deal with different world states, story state in metroidvanias
I am trying to figure out what is the best way to handle persistent changes in game world. Let me explain what I mean. Metroidvania games keep track of the player actions within a level, for example "...
5
votes
1answer
301 views
Understanding Entity Component System
I'm new in game development and I'm struggling to implement Entity Component System (ECS) properly, I have no idea whether I'm doing it right or completely wrong.
Basically, I try to implement ECS ...
0
votes
0answers
81 views
How can I implement a message based communication system well?
I am thinking about a game engine like this:
I am trying to implement a message based communication:
Every ReceiveMessage() method processes the Message or forwards it into the right direction based ...
0
votes
1answer
67 views
Implementation details of Command Pattern in conjunction with Entity Component System
I have implemented an ECS where more or less an Entity is just an ID, a Component is just a wrapper for data, and a System holds the logic on operating over different components.
There is an Engine ...
1
vote
1answer
71 views
Terrain and Path Architecture
I am trying to figure out how to not break the SOLID principles with a collection of classes I am writing.
Currently, I have two stacks of classes that cater for editing and rendering Terrain and ...
0
votes
1answer
85 views
Problem understanding finite state machine
I want to use the finite state machine for the ennemies AI in my game.
I implemented the pattern and it work fine for my first enemy (enemy A):
Enemy is in IdleState by default
When enemy see the ...
0
votes
0answers
118 views
Finite State Machine Input Handling
I'm working on a 2d Super Smash Bros like fighter in SFML/C++. As a game that handles a lot of inputs and states in a very detailed manner, I'm following the state pattern. So I have an abstract ...
1
vote
0answers
51 views
Pluggable modifiers to game engine
I'm currently working on a clone of an old turn-based strategy game "Stars!" and am looking for solutions to a challenge in game engine implementation.
The premise
The premise of the game is that ...
0
votes
0answers
63 views
Unity 5: How to handle stacks of “windows”
I'm having a hard time coming up with a clean and simple way of implementing a window manager of sorts. I have placed some limitations below:
Windows can never move and its positions are fixed at ...
3
votes
1answer
133 views
how to make weapon charge up behavior using composition
I am trying to design different weapon behaviors.
Right now, there are 3 different types of weapon behaviors that i would like to implement.
When not pressing anything, weapon fires at a ...
4
votes
2answers
177 views
Ideas/suggestions to implement an item combination system
I'm designing a game where there is a relatively small set of items. A single player holds an inventory of item slots. Each item slot contains a single item. The inventory allows you to use the item ...
0
votes
1answer
44 views
store definition of “blueprint” of object (e.g. mesh)? … in top header = bad compile time
In my game engine, here is my mesh factory :-
//GraphicFactory.h
class GraphicFactory{
enum blueprint{
TURRET_01,CUBE,GRASS //a lot of things
}
void initialize();
...
0
votes
1answer
79 views
Pointer deleted by object manager on next frame
I have a class named GameManager, which job is to manage GameObject allocation and deallocations. The thing is, every GameObject can interact with each other, so there's a possibility that a pointer ...
0
votes
0answers
19 views
Design - Physics body and Scene node
I'm designing my own 2d game engine. I've wrote the PhysicsBody class and currently it works for collisions only.
For scene partitioning I use QuadTree and is used for decrease the number of ...
5
votes
2answers
249 views
How to design a multi-step game menu system?
I am getting started with game programming. I am designing a game that starts by taking you through a series of menu screens. I am interested in learning how this is typically structured in ...
1
vote
1answer
104 views
What's an optimal procedure to create a connected cyclic grid of nodes and edges for A* pathfinding
like the title says, I'm trying to create a grid of nodes that hold edges or connections to each other so I can perform A* algorithm to have objects traverse across them as seen in your standard RTS.
...
3
votes
1answer
125 views
How can I facilitate communication between “attack” and “movement” components?
I'm currently programming in Unreal, but this is more of a component oriented design question.
I'm trying to follow a component driven aproach, and I have currently achieved creating a movement ...
12
votes
2answers
535 views
How do I avoid writing Manager classes?
I seem to keep reading it's a bad idea to use XxxManager style classes in game engine programming, yet even when I try to avoid their use I always end up with something that holds all the actors/...
0
votes
1answer
96 views
Adding network support
I am trying to implement a simple game "Bulls and cows" in c#.
It is a final project of my university course about design patterns.
The target of the game is simple - try to guess the opponent number.
...
2
votes
2answers
278 views
Entity System and “composite” entities
I'm new to the Entity Component System pattern and there's something I cannot figure out. Let's say I have the following entity:
Player: {
Components: [
Position: {
x: 0,
...
1
vote
1answer
111 views
Entity-components pattern and memory management
I indent to use a level-entity-components hierarchy in my c++ game engine where level is just a placeholder for entities. However, since I'd like to setup all the levels at once (and thus entities and ...
1
vote
1answer
95 views
Categorizing Projectiles in an arcade shooter (multiple inheritance?)
I have been working on a simple arcade shooter in Java in the vein of missile command/space invaders. I've made a base Projectile class and have been extending other Projectile types from it. This ...
0
votes
0answers
40 views
Platformer command queue - not sure how to proceed
While trying to figure out how to implement platform agnostic input handling for a platformer, I've discovered the command pattern and I liked the idea so I wanted to take it a step further.
I got ...
0
votes
1answer
50 views
design / data structures
I'm working on a game which I'm writing in Javascript and then porting to iOS/Android via phonegap/cordova.
For the most part, I understand how to code and how to get what I want to happen, BUT I ...
0
votes
2answers
209 views
Java RPG class implementation (design pattern ?)
For my school project I'm making a little NFC based game on Android.
The concept is simple, on each phone you create a character and you can fight with other people through NFC.
The character will ...
1
vote
1answer
99 views
Sprite quickly disappears after rendering
I'm currently making space invaders and I'm using the game loop pattern as described here. I have an entity class from which there is a spaceship derived class. The base entity class contains all of ...
0
votes
1answer
89 views
Efficient way to store entities in javascript
I am trying to design a game from strach with Javascript.
It's a 2D game (a kind of Zelda on old devices).
I am trying to find an efficient way to store my data because I know I will have to face ...
1
vote
1answer
165 views
How should I efficiently clear and redraw my canvas with lots of animated sprites?
My current solution is to clear the entire canvas and redraw all sprites on every requestFrame(). This works but feels inefficient:
I only need to clear the part of the canvas made invalid by ...
1
vote
5answers
467 views
Unity - Toolbox pattern is not safe
When I create a toolbox such is in this tutorial. How do I defend against breaking the pattern with multiple instances like this:
gameObject.AddComponent<Toolbox>();
gameObject.AddComponent<...
8
votes
8answers
13k views
In Unity, how do I correctly implement the singleton pattern?
I have seen several videos and tutorials for creating singleton objects in Unity, mainly for a GameManager, that appear to use different approaches to instantiating and validating a singleton.
Is ...
6
votes
0answers
140 views
Design patterns for live coding/script reloading [closed]
I would like to make C++/Lua combo and write scripts for a game with live script reloading. What design patterns should I be aware of so not to cause me unnecessary pain?
For example if I have a ...
1
vote
1answer
53 views
Flexible projectile system?
Projectiles need to accommodate timed, homing, linear, and arced behaviours and have single, cone, and splash effects on hit. What is a good pattern to accommodate these different behaviours that ...
0
votes
2answers
129 views
Behavior Tree with interrupted sequence
I'm reading up on Behavior Trees and would like to know how a good implementation for a scenario where the conditions can change or where a selector with a higher priority interrupts the current one.
...
1
vote
0answers
348 views
Tip on turn based game AI
I'm quite new in video game AI, and I'm trying to design an AI for a turn based game.
The rules are simple:
The battle field is represented by an NxM board.
The game is between two team, each team ...
0
votes
1answer
139 views
Where to store persistent player data?
I'm working on a 2d game, where the player can take damage and die. And upon death, player object gets destroyed.
However, some attributes of player shouldn't be affected by his death, such as lives, ...
3
votes
1answer
84 views
How to store renderer vertex / index data in scene graph objects?
I have a SceneNode class which contains a Mesh instance. The Mesh class stores client side information such as vertex and index arrays (before they're uploaded to the GPU). I also have an abstracted ...
3
votes
3answers
153 views
Is it a bad practice to add helper methods if the class is intended only for data? [closed]
For example, if I have something like:
class ItemData
{
public int cost;
public int level;
...
public List<ItemData> childItems;
}
And I'm aiming to separate ...
5
votes
5answers
198 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
35 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 ...