Skip to main content

Questions tagged [design-patterns]

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

Filter by
Sorted by
Tagged with
0 votes
3 answers
148 views

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 ...
MrV's user avatar
  • 49
0 votes
0 answers
93 views

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 ...
Leon Frickenschmidt's user avatar
0 votes
0 answers
89 views

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 ...
Benzait Sofiane's user avatar
0 votes
0 answers
111 views

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: ...
Konjointed's user avatar
0 votes
1 answer
205 views

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... ...
Benzait Sofiane's user avatar
0 votes
2 answers
661 views

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 ...
Konjointed's user avatar
2 votes
1 answer
153 views

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 ...
evol1102's user avatar
1 vote
3 answers
203 views

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, ...
manwithcode's user avatar
2 votes
1 answer
455 views

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, ...
RobinHood's user avatar
0 votes
2 answers
283 views

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 ...
Konjointed's user avatar
1 vote
1 answer
392 views

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/...
Konjointed's user avatar
1 vote
0 answers
213 views

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 ...
Konjointed's user avatar
0 votes
0 answers
84 views

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 ...
Akshit Chaturvedi's user avatar
1 vote
0 answers
79 views

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 ...
shinyoi's user avatar
  • 11
0 votes
1 answer
346 views

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 ...
vandermies's user avatar
3 votes
2 answers
2k views

I am developing a game engine in C++ (for an idea of what kind of design I'm going for, think of ROBLOX, if you're familiar with that) and I need help with a problem I have. So basically, the objects ...
Bunabyte's user avatar
  • 331
1 vote
0 answers
689 views

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 ...
Bunabyte's user avatar
  • 331
12 votes
3 answers
5k views

How? I think I still don't properly understand how composition in Godot works. So, as far as I know, you 'compose' stuff in Godot, right? Like, if you want to make a rock you create a mesh node with ...
YoshGJ's user avatar
  • 535
2 votes
3 answers
896 views

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 ...
Cei's user avatar
  • 873
0 votes
2 answers
380 views

I'm very bad at math, ridiculously so. I'm making attributes that work as multipliers. 1 Agility means : animation speed * agility, ...
Cei's user avatar
  • 873
1 vote
1 answer
96 views

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 ...
Sock's user avatar
  • 11
0 votes
0 answers
209 views

I am working on a java 2d game. Keeping things short, I'd like to improve my current input handling. Basically the player can move up/down/left/right with WASD, perform an attack with mouse left click ...
magister's user avatar
1 vote
0 answers
362 views

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. ...
aallfik11's user avatar
2 votes
1 answer
706 views

I am designing a physics class library for Unity and would love to be able to hook and inject functionality into Unity's Rigidbody class, but it's my understanding ...
marcAKAmarc's user avatar
20 votes
2 answers
3k views

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 ...
Kevin's user avatar
  • 6,976
2 votes
1 answer
409 views

I've been using the new input system to simulate touch in my game, it works perfectly but only with the input manager(which is a singleton for the ease of use), when I add the PlayerMover script it ...
koogel's user avatar
  • 79
0 votes
0 answers
101 views

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 ...
user avatar
2 votes
1 answer
534 views

I'm trying to implement a platformer character using a finite state machine, but I have troubles understanding what kind of logic goes into a state and what logic goes into a main player class ...
Rinat Veliakhmedov's user avatar
1 vote
1 answer
615 views

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 ...
Kostej's user avatar
  • 43
0 votes
2 answers
820 views

Note: I have two Managers: First one creates 2d block upon click. The other one, upon click, grabs a block for dragging. The reason I need them to run in specific order is because newly created block ...
hungry91's user avatar
2 votes
1 answer
2k views

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 ...
JensB's user avatar
  • 157
1 vote
2 answers
415 views

I want to create a scripted dialogues/sequences between NPCs and/or PC during the game. I have a DSL to configure a PC's dialogue with one NPC, inspired by Inkle and Twine. Now, I need a dialogue ...
Victor Sergienko's user avatar
2 votes
2 answers
965 views

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 (...
Sam Bishop's user avatar
0 votes
1 answer
103 views

I have two scenes, The first one called "Boot" contains and ObjectPoller class that instantiates all GameObject in the game and disable them. I made it a singleton with "don't ...
Achie1's user avatar
  • 181
0 votes
1 answer
134 views

I'm developing a top-down shooter and I currently have a PhysicsSystem which operates on TransformComponents. Basically, it ...
Ryan Peschel's user avatar
2 votes
1 answer
921 views

I'm developing a 2D roguelike with an Entity Component System (ECS) and I've been struggling with this question a lot the past week. For example, let's say you have various effects that occur when an ...
Ryan Peschel's user avatar
1 vote
1 answer
126 views

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 ...
user1833028's user avatar
0 votes
1 answer
381 views

I'm developing a top-down 2D game in Javascript using an Entity-Component-System architecture and I'm struggling with the question of exactly how to implement temporary buffs / permanent passives. For ...
Ryan Peschel's user avatar
0 votes
1 answer
143 views

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 ...
Ryan Peschel's user avatar
2 votes
1 answer
227 views

Currently working on a small home project of developing our own game. The game basics are just a straightforward space game, currently without any collision detection/resolution, just movement with ...
Matti Kettu's user avatar
0 votes
0 answers
1k views

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 ...
downstroy's user avatar
  • 101
1 vote
0 answers
155 views

I know this is a controversial topic being discussed a lot , but I have not found a clear answer yet. So , there is a "Grid" in my game , which I implement it with an Array of GameObjects. ...
Thanos Loupas's user avatar
2 votes
2 answers
499 views

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! ...
Marie Cunnie's user avatar
3 votes
2 answers
374 views

We currently have the problem that our main class GameController is being pulled into every backend file in our game. We're wondering what are common solutions to this problem. Here's a bit more about ...
Jeffrey D'Eon's user avatar
0 votes
0 answers
218 views

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. ...
Chris's user avatar
  • 1
2 votes
0 answers
1k views

I'm making an idle game in the vein of Melvor Idle and I've run into a problem calculating the yield and consumption of resources while the user is away. For those who don't know, many idle games have ...
RoboticWater's user avatar
1 vote
2 answers
5k views

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 ...
Jay's user avatar
  • 287
0 votes
0 answers
53 views

I've been stuck doing this in a very inefficient way and really want to know if there's some design pattern that solves this because it seems like a pretty common problem to have. I have a system ...
Taceo's user avatar
  • 1
2 votes
1 answer
314 views

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 ...
ManoTech's user avatar
  • 157
0 votes
1 answer
116 views

I'm trying to implement a state pattern - having skated by with enums forever - and have hit a bit of a wall when it comes to it's implementation in my game. It's a grid based strategy game with an ...
Robert Lee's user avatar

1
2 3 4 5
7