Questions tagged [design-patterns]
Design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
338 questions
0
votes
3
answers
137
views
How do big open worlds handle Object Pooling?
Object pools are great. They are fun to make, save you a lot of memory and fps.
But as my projects grow in size and complexity it gets harder and harder to work with them. If you only have a couple of ...
0
votes
0
answers
89
views
Command Pattern or/and Event Handling porgramming paradigm?
I have created a dynamic library that contains all the tools I want my game executable to have. Additionally, I want to create a world editor/tools for my engine to be more user-friendly.
I'm ...
0
votes
1
answer
202
views
Singletons as presented in Game Engine Architecture by Jason Gregory
I am reading the amazing Game Engine Architecture 3rd edition by Jason Gregory, but I have trouble understanding the singleton part, more particularly the part dealing with subsystem start/shutdown...
...
2
votes
1
answer
153
views
Skill Class design : How to deal with multiple criteria
I'm planning to make a Class for RPG game's character skill.
But the problem is that the skills need to be classified by multiple criteria.
Below are the criteria for skills.
Independent / dependent
...
2
votes
1
answer
451
views
What design pattern should I use for adding functionality
I am making a tile based roguelike game with different objects in the world, like Doors, Security Cameras, Storage Shelves.
With that, there are objects that have an inventory, can detect the player, ...
1
vote
1
answer
390
views
What is a "controller"?
I'm in the process of refactoring my camera code the goal is to try and simplify things using a struct instead of a class or at the very least try something new since I always jump straight to classes/...
0
votes
0
answers
84
views
Architecture and design patterns for components
I was working on a physics-based plug-in/ extension for Unity water which would essentially be another component in Unity water.
The goal of this extension would be to integrate interactive physics ...
0
votes
1
answer
344
views
Implement Singleton that loads before Awake
I would have liked to comment on this answer, but I don't have enough reputation so I had to open this new one. The issue with it (and with the rest of the answers) is that it doesn't work well if ...
1
vote
0
answers
689
views
Why does ROBLOX use an object-oriented system rather than an entity component system? [closed]
I decided I would develop a game engine in c++, so I was thinking about different ways of handling objects. I also have experience with ROBLOX, so I know that it uses an object-oriented design as ...
2
votes
3
answers
892
views
Is there some psychological reason for why most game's UI is always the same colors?
Shooter games : Either Blue/teal/azure or other shades of blue and transparent or gray and transparent
MMO games : Either blue and transparent or shades of Brown+Gold or a very dark red, so dark it's ...
1
vote
1
answer
96
views
Designing a system for delivery
I'm writing a game where deliveries are made to specific people. These people act in different ways depending on what the delivery is. At times one character might ask the player to make a delivery to ...
1
vote
0
answers
362
views
Am I doing something wrong in my ECS architecture if I must choose between coupling or copying code?
I'm developing a somewhat simple, small roguelike game as my university project. Early into development I heard about Enity-Component-System and decided to go with that as my game's architecture. ...
20
votes
2
answers
3k
views
Development pattern for interactive in-game tutorials
Interactive in-game tutorials often interrupt game flow and override standard behavior in a way that can be difficult to implement cleanly.
For example, imagine we have an action game and we want a ...
0
votes
0
answers
101
views
What class should access my database?
I would like to code a turn-based RPG, and I decided to use a database to store all skills in the game. Now I have to decide as well which class can see this database, and how classes pass around ...
1
vote
1
answer
614
views
Implementing ability system with ability parameters
I am trying to implement an ability system in Unity for a game similar to XCOM (turn based, team consists multiple of units, grid based). Every unit have X action points per turn.
I would like to do ...
2
votes
1
answer
2k
views
What should be an entity/component, and what shouldn't?
I've recently been reading the book Game Programming Patterns by Bob Nystrom, and one chapter I've found a bit hard to grip is the chapter about the Component pattern.
In the example he uses (which ...
2
votes
2
answers
963
views
How to handle "identity" of unit/building types within an RTS context?
TL; DR: How do I give unit and building types a unique "identity" without turning my codebase into a mess?
I've been reading the genius Game Programing Patterns and it's made me very (...
0
votes
1
answer
131
views
How to design a system that allows for custom equations of movement?
I'm developing a top-down shooter and I currently have a PhysicsSystem which operates on TransformComponents. Basically, it ...
1
vote
1
answer
122
views
How do I solve a problem where sometimes recursion is untenably vast and sometimes it is not?
I am writing a programming language of my own. (I've done two Turing complete ones in the past, but this time I'm trying to actually be useful.)
Now, one thing that should be especially easy with ...
0
votes
1
answer
141
views
Should abilities have their state and functionality separated?
I'm developing a top-down game using Javascript and Canvas in an ECS architecture.
I'm wondering, which of these is better from a design / elegance point of view?
Method 1: Combining the ability ...
0
votes
0
answers
1k
views
How to implement special abilities in turn based card game (and in games in general)?
I am wondering how games like dota, or Magic Arena implements their hero/ card special ability system, and more specifically how do they "Hook" their special ability triggers to the game ...
2
votes
2
answers
498
views
how to structure game logic for user interfaces of different nature (gui, tui, cli)?
I would like to implement a simple game logic engine that is agnostic to the rendering system, but I don't know how to do that, really... so I would like to have advise and know the state of the art!
...
0
votes
0
answers
218
views
The Command pattern and multiple inputs per frame?
I'm reading Game Programming Patterns by Robert Nystrom. As a test I've implemented the command pattern, but a little farther in he changes it to return commands, rather than instantly executing them.
...
1
vote
2
answers
5k
views
Is it bad form to use singletons in unity [closed]
I've heard a lot of people say singletons are bad practice and an 'anti-pattern',
like here,
this answer
this article
and here.
However, a lot of the reasons I've read about seem to be to do with ...
2
votes
1
answer
314
views
How to program (architecturally/organize) a set of customizable changes to a game?
The floor of my game (tower defense) is composed by a set of cubes. I wish to change these on some of the waves. I have a list of the changes that need to be made on each wave in a floorController ...