Questions tagged [software-engineering]
Software engineering is the design and development of software as it applies to the game development field. Questions using this tag should be about theoretical concepts and practices as relates to the task of creating or designing software. This tag should not be used simply because a question involves programming or contains code.
645 questions
12
votes
1
answer
1k
views
Destroying the parent when all children are destroyed
I have a spell system where a the spell is a self-contained game object handling all the logic. When done, it destroys itself. This works great
Then I added a second game object handling animation, ...
0
votes
1
answer
309
views
How to implement something like Noita's spell system?
Does anyone have any insight or at least a guess as to how the spell system works in Noita?
The game is done in C++, and it has spells that can be modified with other spells and spell modifiers that ...
1
vote
1
answer
272
views
Creating composite transformation matrix to apply in vertex shader
What I'm puzzled about, is why most tutorials on graphics programming speak of creating a composition of transformation matrices - which are then applied in a single loop (to each vertex).
I did 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 ...
1
vote
0
answers
69
views
Common Methods to Restrict User Movement and Prevent Other Objects from Acting in Games
I am a web and mobile app programmer. Compared to web and mobile app source code, I haven't seen much game programming source code.
In web applications, all elements are essentially static (?), and ...
1
vote
1
answer
151
views
How to prioritize and display correct UI for multiple actions triggered by the same input?
In my Unity game, the "Interact" action is used for multiple tasks like opening doors and grabbing/dropping objects. However, there are scenarios where the player has an object in their ...
7
votes
3
answers
2k
views
How do you determine what order to process chained events/interactions?
I'm trying to write a top-down tactics RPG game in python, and run into the first major decision I can't make with my limited knowledge of RPG fundamentals.
In our game you create a team of characters ...
1
vote
1
answer
814
views
How to structure a complex inventory system in Unity?
My inventory needs to deal with different Item types. Item is my base class, which is extended by Armor, Weapon, Spell, Scroll and I might add more in the future.
All items have an interaction on ...
1
vote
1
answer
211
views
Correct way to manage managers and controllers in Unity
I am having a bit of a headache right now about my controllers:
Ive got a bunch of managers in my game, for example
A MasterController to manage most serious stuff like pausing or turning off input
...
1
vote
1
answer
104
views
What is the simplest way to enforce/remind people to set a variable in a subclass when the code is dynamic?
I have a base class for Abilities. This is a point and click game, therefore I have Click, Hold and Drag subclasses.
What I need to do is remind myself to set the player's AI state to Ability when it ...
3
votes
2
answers
1k
views
Decouple game entity from its owner when logic depends on it
In my real-time multiplayer game, there are multiple entities that are very interrelated and whose logic is very related to the player who owns them. I don't think I can decouple the classes from each ...
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
101
views
How to implement graphics API functions like setUniform on a cross-platform shader in VLang?
I've been working on a C++ game engine for a while, but I decided to scrap the project because doing it in C++, despite my best efforts, I could feel the technical dept building. As such, I switched ...
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...
...
1
vote
1
answer
320
views
How do programmers distribute their games from custom game engines?
I am currently reading tons of books about game engine, real time rendering, animation, physics... but I could not find any description of how game developers who built their game with their own game ...
1
vote
2
answers
450
views
How to implement C# methods that automatically get called in the game loop, like Unity's Update() etc.?
I've been working on my own game engine for some time, I ideally need a way to create global function implementations to make it easy to do things within the game loop.
Heres an example:
...
1
vote
1
answer
223
views
When should I call the physics simulation within the game loop?
I am thinking about where to call the physics simulation. The current situation is that I first update the entities and then the physics immediately before rendering. As you can see in the following ...
2
votes
1
answer
460
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, ...
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 ...
1
vote
0
answers
49
views
LibGdx switching between multiple UI panels
Let's say I have a game screen with a game world stage and UI stage. UI has a build button in the corner which should open a full screen build menu window/panel while hiding game world and the ...
1
vote
0
answers
151
views
When to use the same class for both client and server versions of an object, vs. when they should differ
I am learning about networking for game development and need some insight.
My knowledge of Unreal Engine is that it uses RPCs and replicated variables for actors. I also know that Unity has Networked ...
0
votes
1
answer
177
views
How to handle different components of the same entity having different indices?
I'm currently working on a little ECS project and a couple doubts came to my head when dealing with systems.
Let's say I have a model component, a position component and a scale component. Each ...
1
vote
1
answer
548
views
How to clean up list entries when objects are destroyed in Unity?
We are developing an economic sandbox somewhat similar to a mixture of The Guild and Kenshi.
In this game, both the player and the NPCs will often create and destroy (consume) various objects.
The ...
0
votes
3
answers
966
views
What is the best way to implement a scene manager?
I'm trying to create a scene manager system for a small framework I'm writing on top of SDL2. I have implemented a scene management system that works, but I am not sure if it is structured how it ...
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 ...
0
votes
0
answers
77
views
GameObject optimization in backpack behavior
I am trying to design the item part of my game. My original design was just to treat them as a gameobject and to give every item an item (or some derived) component,...
0
votes
0
answers
78
views
Sequencing interaction between rendering/animation and game logic in Poker game
I am building a two-player(CPU-User) Poker application with C++ and OpenGL. Currently the application just renders the graphics, keeps track of which button is pressed, value entered in textbox ...
0
votes
1
answer
246
views
Store and call multiple functions consecutively
I am looking to create a "stack" of functions that I can call at will. In my game, multiple events can trigger at the same time. These things should not be shown at the same time however, ...
1
vote
2
answers
197
views
Is it appropriate to design heroes as items in game development?
If you were to design a multi character game like "Genshin Impact", would you design the character(hero) as a item?
What is an item: in our game design, an item is an object within the game ...
0
votes
1
answer
1k
views
How to implement rogue-lite skill system
I am creating a roguelike/lite game where in a player has a freedom to learn a number of skills.
For example, I have a projectile skills and I can learn three different behaviours.
Behavior 1: shoot ...
2
votes
2
answers
280
views
Considerations when applying C++ Core Guidelines in game development
I'm curious about the impacts of applying the C++ Core Guidelines to game development.
When I try to discuss about this, and point out that we should check return values, or validate user data, or ...
0
votes
1
answer
304
views
Accepting user input in continous game loop
I have a game loop that simply iterates through every entity and calls entity.update()
...
3
votes
1
answer
1k
views
How to implement a function that normally returns a float, but can sometimes fail?
In Godot GDScript, I have a function that returns a float.
Inside the body of the function, I use the built-in method find, that ...
1
vote
1
answer
157
views
cyclic dependency error in roblox survival game
Description
In my game, I have have 3 module files: "PlayerList.lua", "PlayerData.lua" and "WorldData.lua".
PlayerList.lua = a list of PlayerData classes (requires ...
3
votes
1
answer
850
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 ...
1
vote
1
answer
160
views
Reduce coupling between various singletons
I'm working on a game that makes use of several singletons such as a game manager, audio manager, and a level loader. The game manager I created has references to the audio manager, level loader, and ...
2
votes
1
answer
78
views
How to organize game entities that are stored inside other entities?
In my GPS based game, there are certain structures the players can build that store units. For example, airbase structures store aircraft objects. Currently, the way I have this organized is the ...
0
votes
1
answer
364
views
Would it be okay to try to reverse engineer Spore as an experiment and publish the results on-line?
Game in question is Spore. I'm fascinated by space and this game has been my favorite for years.
Now, I would try to reverse engineer as much as I can as an experiment because I am interested in ...
0
votes
2
answers
972
views
Interactable actors should be implemented via components or inheritances?
I am new to game development and I am learning Unreal Engine right now.
When a player character APlayer wants to interact with other actors (such as ...
0
votes
1
answer
118
views
What is the expected software maintenance pattern when switching Unity versions?
What is the typical upkeep of a project made in Unity, specifically how often/how much the code needs to be updated/changed/added when a new Unity version is released and/or when your currently used ...
0
votes
1
answer
1k
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
6
answers
352
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 ...
0
votes
0
answers
59
views
Is it better to spawn an object after from same gameobject or handle the spawning in different gameobject?
So basically I am spawning the object lets say the enemy at random position on screen. Should I handle the spawning in a different gameobject or in enemy. So when enemy is destroyed it calls the ...
2
votes
1
answer
535
views
How to handle duplicate logic in a state machine for a platformer player?
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 ...
0
votes
1
answer
121
views
How to build a system for ammunition being fired out of cannons when player characters and crewmates can also be ammunition?
I'm currently working in Unity building a game inspired by the niche DS game, Dragon Quest Rocket Slime. It's a Zelda-like forced-perspective top-down game where the primary combat mode is you ...
1
vote
0
answers
61
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
0
answers
81
views
What is the best approach for achieving DI / testability in Unity development?
Sorry for the fairly open-ended question, but I'm hoping I can get some insight on how to tackle automated testing in Unity. I've been quite surprised to not find a "definitive" approach on ...
0
votes
1
answer
189
views
Is there a good practice for defining names programmatically?
In my use of Unity so far, I've been defining element names programmatically with classes like this:
...
0
votes
1
answer
418
views
Draw a graph as a world map in UI?
What's a good way to take a graph of nodes and draw it in your UI as a map?
I already have a graph and I'm happy with how it's generated. However, it doesn't have any positional data for the nodes -- ...
0
votes
1
answer
508
views
How do you use configuration files to describe the contents of an entity in an ECS-system?
One of the advantages that's often brought up when talking about ECS-systems is that they allow a higher degree of flexibility in regards to Data vs Code. Without the limitation of hard-coded types, ...