Questions tagged [architecture]
How code is structured. For questions on the internal design of a game engine.
1,385
questions
3
votes
2
answers
1k
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
60
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
86
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
65
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
59
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
0
answers
39
views
How can I display properties/attributes of an object in an editor?
I'm learning how to make a game engine using SDL and OpenGL and I'm using imgui for the engine editor UI and I'm trying to make a properties panel that displays the properties of the selected object. ...
0
votes
1
answer
123
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
24
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
63
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
388
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
85
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 ...
1
vote
1
answer
102
views
Creating a Renderer class using SFML
I currently have a Renderer class, which as in the example code, looks like this:
...
0
votes
0
answers
33
views
Source of truth for raising events in an Event-driven architecture?
I am developing a turn-based strategy game and am using Events to implement a "Buff" / "Debuff" system. The code is very OOP-y right now, not very ECS.
I am adding an event system ...
9
votes
3
answers
2k
views
What's the appropiate way to achieve composition in Godot?
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 ...
3
votes
2
answers
1k
views
What is the recommended way of storing large sets of organized, immutable data in Unity?
Since I'm making an RPG in Unity, I need a place to store all the possible moves/attacks in the game. These have the following properties:
there will be a very large number of them, in the hundreds ...
8
votes
3
answers
292
views
Should game data be encoded in configuration files, given that it will almost always contain logic?
Question inspired by the accepted answer to another question: Wondering if there is a more efficient way to store level data in my game?
The answer, by @Evorlor, says:
You should have the data for ...
0
votes
0
answers
72
views
How to organize widgets in Unreal Engine for multiplayer
I am a beginner UI programmer working with UMG.
My question: are there ways to organize widgets other than, you know, the master widget that holds the rest of the widgets?
WBP_Master -> (...
1
vote
1
answer
344
views
How to structure a dynamic turn based system?
I'm attempting to create a turn based battle system in Unity that is made up of dynamic events. Attacks may involve a lot of movement, animation, and often player input during the attack. The current ...
1
vote
1
answer
62
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 ...
0
votes
0
answers
114
views
Good design for player input handling in 2d game
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 ...
1
vote
1
answer
203
views
Factorio style conveyer belts, how to implement multiple speeds?
I've been reading this article by Factorio about optimisation (please read it to understand the context of this question): https://www.factorio.com/blog/post/fff-176
I have implemented this ...
1
vote
1
answer
232
views
What kind/type was the 3D terrain editor of Warcraft 3's World Editor? How it worked? [closed]
Warcraft III (WC3) had a lovely map editor that allowed for a whole lot of stuff, yes (this was the best result I could squeeze out of Google), but what to me stood out the most and what I played with ...
0
votes
1
answer
117
views
How do I implement data persistence?
I wonder how do I implement data persistence in 2d game. I am not using any engine, just pure Kotlin and OpenGL for rendering, so it is more of a software architecture question. The case:
Character ...
0
votes
2
answers
77
views
Modeling a naturally circular relationship between three classes
I have three classes Location, Item, Character.
Every ...
1
vote
0
answers
95
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
2
answers
260
views
Initializing Monobehaviour in Unity
I have three scritps and one plain C# class.
EnemyMonobehaviour, EnemyAttackMonobehaviour and UnitState plain class.
In enemyMono I have Initialize function that initializes unitState.
...
0
votes
1
answer
128
views
Software architecture advice for a Sokoban clone
I'm building a Sokoban clone, and I would like to try to get the architecture right for future extensions. Sokoban is a simple game, where the player has to move boxes around a grid and place them in ...
2
votes
0
answers
155
views
Application of modified MVVM paradigm
Let's assume a game development company uses a modified version of the MVVM paradigm that includes the notion of a Manager which handles manipulation of the Model.
So, the idea is
View - all frontend ...
0
votes
1
answer
133
views
Why do modern games take so long to reset the current level after failing?
While recently playing a game I kept failing at, I realized that I don't fully understand why I need to wait for the level to reset at all. Taking time to load a new level makes sense to me - assets ...
3
votes
1
answer
584
views
Characters ai code organization
I want to create a an ai with finely customizable character. The ai should be able to handle generic behaviors, like scheduled activity, shared across all character, but have specific override for ...
3
votes
1
answer
1k
views
Are Yields a Bad Code Practice in GDScript?
I understand that the title is a bit vague, but I'd like to get a better sense of where it is appropriate to use yield(). Up until recently I wasn't even aware of yield(), but now that I know it ...
0
votes
2
answers
98
views
Should dealing damage and healing be the same function called change hp or should they be sepparated into the functions of their own?
I'm making a simple game with sliders, where there is a damage over time function, the main focus of the player is to upkeep the player health as long as possible by clicking corresponding buttons. My ...
3
votes
1
answer
107
views
How do I design a "Chores" or "Errands" system?
I have a number of entities running around in my game, and I am running into a headache trying to design and implement a system for them to both generate and assign the tasks. More than anything else, ...
1
vote
1
answer
450
views
Is it possible to keep a prefab of a UI element with UI Toolkit?
I'm digging into Unity's new UI Toolkit, and so far I like it a lot; but there are a few things bugging me about it.
I have a dynamic list in my UI which keeps track of way point paths, and it changes ...
0
votes
0
answers
272
views
Message pump and D3D11 DXGI in separate threads
I have read:
https://learn.microsoft.com/en-us/windows/win32/direct3darticles/dxgi-best-practices#multithreading-and-dxgi
https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/d3d10-graphics-...
0
votes
1
answer
222
views
How would you implement card effects in a card game?
I'm making a card game right now and I am hesitating in how to design my cards.
Let me explain
I have a card that draws two cards from the deck when played. The way I'd code it is I'll create a class ...
2
votes
1
answer
379
views
Decoupling Components
I am working on my first Tower Defense game and I got stuck with architecture.
I found some past Q&A "Should the entity handle his own movement?", read about Entity Component approach, ...
0
votes
0
answers
70
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 ...
2
votes
6
answers
204
views
Modelling Two Way Relationship in Unity for Scriptable Objects
How does one model two-way relationships for scriptable objects?
Let's say we have a number of items in-game, and each item can be obtained by different conditions. Some may require you to complete a ...
1
vote
2
answers
264
views
Having one giant level instead of several levels separated by a loading screen
I'm making a metroidvania game. For what it's worth, I'm using Godot as the game engine, but I think my question applies for any engine.
If you look back at old games such as Super Metroid on SNES, ...
0
votes
0
answers
147
views
How do buildings in (Tile based) city builders/colony sims keep track of each other? [duplicate]
Like, how does a building in these games know if they're being powered? Or if they're within range of influence of a hospital or fire station, etc.
How would they know where to send an NPC or ...
2
votes
1
answer
1k
views
How to design an upgradeable skill system?
In my game skills can be leveled up to modify base stats like reducing cooldown by 20% and increasing fired projectile count by one. How would I architect the system so that each skill has its own ...
1
vote
1
answer
420
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 ...
3
votes
1
answer
158
views
Handling infinite combos
I'm working on a game where entities can be affected by 'statuses' that can have an effect in response to any entity event (lost_life, turn_began...).
I'm searching for good ways of handling this kind ...
1
vote
1
answer
64
views
How should I share the states amongst all the executions of a Behaviour Tree triggered from all ticks?
I'm still learning about Behaviour Trees and my understanding of the "blackboard" is essentially a state object. When passing the state object through the ticks to the function calls (which ...
1
vote
0
answers
49
views
Is it worth creating engines for simple projects? [closed]
I know, this question has already been answered in several places on the internet and the answer is NO.
But there are some points, I probably don't have the experience of half of you but I love C++ ...
0
votes
3
answers
230
views
How to prevent a huge backlog of physics calculations from freezing browser when tabbing out of browser game?
I'm developing a browser game and am using the timestep implementation from the famous Fix your timestep! article.
It works perfectly, but there is one problem. If you tab out of the tab and then come ...
3
votes
1
answer
292
views
Trunk Based Development: Prevent unreleased assets and features from being included in the build
Our team is currently working on a live service game (A game that will be updated regularly post-launch) and is using a trunk-based development strategy.
The trunk-based development strategy is great. ...