All Questions
Tagged with code-structure or architecture
1,421 questions
0
votes
0
answers
43
views
how to implement event system with SDL2?
I'm writing a C++ game engine using SDL2 and I have an SDL event loop, but I'm not really sure what I want to do with these events. I know that I'll have systems that will be interested in these ...
1
vote
0
answers
51
views
How can I integrate a library that expects backend events into my own event system?
I'm using SDL2 in my game engine and have created custom event types that use the data from SDL_Event. This works well within my own code, but it becomes ...
1
vote
3
answers
262
views
Handling status/effects on a turn based RPG game
I have managed to create a state machine for my game core, like on turn start, on turn end, and another one. Now lets talk about effect/status.
For generic effects such boosting stats for certain ...
1
vote
0
answers
124
views
Necessity of node-graph-based rendering in simple game engine
I'm working on a C++ game engine for my own projects. It's divided into two parts: one which handles basic functionality like logging, cross-platform abstractions, filesystem utilities, etc., and ...
0
votes
0
answers
71
views
Best way to structure code for a character dependent on its environment and vice versa
What is the neatest way in a strict OOP language (c++ say) to avoid the following circular dependency. Imagine I create a character class and a world class. A character requests data from the world to ...
1
vote
0
answers
152
views
ECS architecture in non-gaming scenario : best way to model relationships?
I'll preface the wall of text below by saying that I've next-to-no experience with game design/programming. But I've a situation that might be fairly interesting to folks here.
I'm currently working ...
0
votes
0
answers
116
views
Looking for a way to handle/define area of effect attacks in a 2D grid based game
I am working on a top down 2D grid based game, where as it is currently, units have a movement and an attack range. An example of this:
The blue squares are tiles the selected unit can move to, the ...
0
votes
2
answers
440
views
How to separate game engine from the game?
I've been doing some reading and watching videos about game engine architecture, and it seems that a key component of making a game engine is to have it seperate from the actual game. The Cherno ...
0
votes
1
answer
281
views
Game engine dev vs game programmer
I love rendering, coding game logic and implementing physics systems using libraries like SDL2, however, I also enjoy using those systems to design and put together games. Do my interest more align ...
1
vote
0
answers
43
views
How to Handle Intermediate State in Event-Sourced Game Architecture for Complex Command Logic
I'm building a turn-based game using an event-sourced-ish architecture. Here's the basic structure:
A dispatcher on the game engine receives commands from the client and routes them to command ...
0
votes
0
answers
177
views
How do modloaders get created?
This is a fairly general question but I was wondering how modders are able to create software that essentially make a game execute code that it shouldn't know anything about.
Some games are offering ...
0
votes
0
answers
98
views
For an isometric adventure game, what is a good way to store the objects in 3D?
I'm creating a game in C++ and raylib. This is a real-time isometric game, so it is technically 2D graphics, but the rooms have a 3D structure because there will be many blocks and other objects that ...
2
votes
1
answer
136
views
How to Handle Complex Side Effects and Event Sequencing in a Turn-Based Game Like XCOM?
I'm trying to make a turn-based game like XCOM, and I've run into an architectural problem that I haven't been able to solve for quite a long time.
In my game, logic is completely separated from ...
0
votes
0
answers
55
views
multiplayer game using express(for login, registration etc..) and socket.io(for game-actions) what is architecture and how to scale it horizontally?
Hey please sorry if I sound dumb and correct me!
So, I am building multiplayer game using react.js,express.js and socket.io and now really want to deploy after building so and also i want to make my ...
0
votes
0
answers
113
views
How to load shaders in a game engine asset loading system?
I am making an asset loading system for my game engine, which is written in C++, and the idea I had in mind is that for each asset there is a corresponding loader class. Although not entirely the same ...
1
vote
1
answer
190
views
Communicating between Components and systems: ScriptableObject vs MonoBehavior vs Events
could you please guide me or help with sane architecture basics in Unity?
I'm making a tower defense game and I'd like to have modular approach without using frameworks, so no ECS/DOTS/SOAP
I want to ...
0
votes
3
answers
332
views
Switching between turn-based and real-time with stateless state machine
I am working on a real-time rpg with a turn-based combat.
Currently I have standard state machines for a game state (real-time/combat) and for characters.
However I can't seem to find a decent way to ...
1
vote
0
answers
80
views
Restructure OOP Architecture for two classes that are currently circular dependent
I'm working on a simple 2D game using C++ and SFML.
In this game, I have a class WorkbenchBlock which inherits from class Block. ...
0
votes
1
answer
217
views
Need help on structuring my window class and game class
I'm trying to create a simple-ish game/engine/framework thing in C++, and I'm trying to come up with my own code instead of following a tutorial so I can learn to do it in a freer and more hands-on ...
0
votes
0
answers
55
views
Problems with compiling with llvm and gcc, while trying to link external libraries to EngineCore.lib and finally linking core to EngineEditor.exe
Help me I Cherno's followed game engine series and branched to add 3D capabilities. I am having issues while linking libraries, at first I just wanted to share Game Engine code with friends, but not ...
0
votes
0
answers
52
views
How to Prevent Subsystems from Responding to Events from Other Game States
I'm writing a game from scratch in C++, using the book Game Coding Complete as a guide. The engine in the book has an event manager which is used to communicate between the game's systems, such as ...
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
111
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
205
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
661
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 ...
0
votes
0
answers
41
views
How to make an authoritative server initialize 3 cards once 2 "Clients" join
I somewhat understand [Command], [ClientRpc], and [TargetRpc]. However, I am currently struggling to determine how to get my SetupInitialHand() method to run. When called from the same area that ...
1
vote
0
answers
87
views
How to avoid/reduce code duplication in asset loading/caching with templates?
I'm working on an asset manager for my game engine, and I'm a bit stumped on how to use templates (and potentially inheritance) to reduce some code duplication.
An asset requires 4 things: a container,...
0
votes
0
answers
175
views
C++ how to load different assets within an asset manager?
I'm in the process of redoing my asset/resource manager currently I have load functions scattered throughout my code for example LoadMeshFromFile(), LoadTextureFromFile(), LoadShaderFromFile(), etc, ...
1
vote
3
answers
203
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, ...
0
votes
1
answer
86
views
Broken graphics in a compiled Android application
Why is it that when I compile this application in Unity for Android, the graphics completely break (camera image output). Maybe I need to set something special in the Player settings? I'm using the ...
0
votes
1
answer
294
views
Sanity Check on my Idea for an Event System for game
So, I recently started making a small game from scratch, with no engine used(I'm a beginner at this) and I want to create an event system of my own. I want to check if my general idea for it is okay(...
0
votes
3
answers
249
views
Is there any reason not to use classes in C++?
I'm a bit conflicted when it comes to the use of classes currently, I use them all the time, but I realized through the KISS and YAGNI principles I can simplify things by not using them, but is there ...
2
votes
1
answer
236
views
Programming Singletons vs Static classes
I've been developping a 3D app for some time and I remember at some point I started to need to pass data arround in unrelated areas of the program, where it wouldn't make much sense to pass them ...
0
votes
1
answer
484
views
How to go about executing lua scripts in a ECS engine?
I'm trying to add scripting with lua to my C++ game engine, and I'm pretty stumped on how to tackle the executing/processing part. I started by creating a ...
0
votes
1
answer
174
views
How to structure this concept in ECS?
High level
At a high level, I'm looking to create a galaxy exploration-style game.
A number of points of interest will be selectable on the map (I'd like to aim for several hundred, but flexible and ...
2
votes
0
answers
100
views
How does non ECS parts work with ECS parts?
I incorporated ECS to my graphics engine and I have a problem with my Renderer needing the camera which is an entity and the process is a bit bizarre. Originally, I ...
1
vote
1
answer
392
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 ...
1
vote
1
answer
1k
views
How to use handles for asset management?
The way I've learned to implement an asset manager is having unordered maps for each asset type (textures, shaders, meshes, etc.), each with a string key and object value and then having methods ...
3
votes
2
answers
2k
views
In an object-oriented game engine, should there be seperate classes for objects with and without parents?
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 ...
0
votes
1
answer
703
views
Pygame code/file structure
I am currently working on a Pygame project and would like to seek your advice on best practices for organizing my code, particularly when it comes to creating additional scripts. I find myself ...
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 ...
0
votes
2
answers
122
views
Changing the type of an object in Unity
I'm new in coding from zero and I have some problems with architecture of classes (project mb?).
I have empty room that I need to add “equipment” to it later (change the type of room).
I already have ...
1
vote
0
answers
109
views
2D grid game server - interaction system/dynamic blocks
I'm building a Server-side engine for 2D sandbox game similar to Terraria or Starbound.
The language I use is Dart (similar to JavaScript or C#).
Currently I'm trying to figure out how to make a good ...
0
votes
1
answer
1k
views
How to design an EventBus(guided by the pub/sub pattern)
I'm working on my game engine, and was faced with the fact, that i don't know how properly design an event system. As a pattern i choose Pub/Sub with an event bus, but i don't know where i should '...
0
votes
0
answers
36
views
Logging high-level game events to external consumer
Is there any existing technology/framework/standard for publishing high-level game events to a consumer?
Example:
Imagine a game which can publish events like change of level, player joined, player ...
0
votes
0
answers
127
views
Data driven battle logic
Concept
I am designing turn-based boss battles and want each boss to have different behaviors and skills they perform during a battle. The boss is selected randomly and is identified by a unique ...
3
votes
1
answer
877
views
How are character controllers built upon complex gameplay systems?
I would like some industry advice. I feel like the starting part to every game I create is the character controller. My goal is to create a solid base character controller that I can expand upon for ...
1
vote
0
answers
351
views
Does anyone know any 'no-interface' game engines? [closed]
What I'm looking for:
I've been searching for a while now for any no-interface game engines (What I mean by that Is something like the Source Engine where other than than the level editor It's nothing ...
2
votes
1
answer
2k
views
Who 'owns' the components in an ECS?
Currently looking and reading about entity component systems, and just wanted to ask about who 'owns' or where the components are registered.
I would have thought that each entity has a collection of ...