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
133 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
91 views
Design Patterns for client prediction in P2P games
I have a working P2P non real time (think Civ 5) multiplayer strategy game using deterministic lockstep for the game model, but lag can really cause inconvenience. To clarify, units don't move in real ...
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
0 answers
110 views
SDL2 Events how to avoid monolithic control statement?
I'm using SDL2 in my game engine and I'm trying to figure out how I can prevent having a monolithic control statement like this: ...
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... ...
0 votes
2 answers
660 views
What’s the benefit of breaking code down into other classes? [closed]
Sorry if this isn’t the proper spot to ask, but something I struggle to wrap my head around is the benefit of breaking down code into smaller pieces on the surface it seems to make sense I think you ...
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 ...
1 vote
3 answers
201 views
Unity Game Architecture
I'm working on a relatively simple game, but even simple games have a lot of moving parts, and I'm running into some architecture issues. Just to be clear, everything works fine, but it feels dirty, ...
2 votes
1 answer
450 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, ...
0 votes
2 answers
279 views
What happens with global/singleton objects when using ECS?
As I've been learning about ECS one thing that gets me confused are things like input which in my case has usually been some singleton that gets polled or in one project was event based where code can ...
1 vote
1 answer
389 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/...
1 vote
0 answers
212 views
Good practices for making a manager class?
I found this post for designing a camera system the post mentions having a manager where you could register and set different cameras such as debug, player, script, etc and I kind of like this ...
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 ...
1 vote
0 answers
79 views
How could I build components for a composable loot system like one in RuneScape without using OOP?
I looked at some entity component systems, and noticed that they sometimes list static polymorphism as a feature, and ECSs and data oriented programming seem to be touted as holy grail of modern game ...
0 votes
1 answer
342 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 ...