Questions tagged [architecture]

How code is structured. For questions on the internal design of a game engine.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

What do you do with SDL2 events?

I have the typical/basic event loop for SDL2 and I'm a little confused on what to do with them or how to handle them or I guess more specifically how should I get the data from these events (e.g ...
Konjointed's user avatar
0 votes
2 answers
609 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 ...
Konjointed's user avatar
0 votes
0 answers
29 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 ...
SmileyTheMimic's user avatar
1 vote
0 answers
61 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,...
Konjointed's user avatar
0 votes
0 answers
44 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, ...
Konjointed's user avatar
1 vote
3 answers
95 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, ...
manwithcode's user avatar
0 votes
1 answer
43 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 ...
Stiven's user avatar
  • 11
0 votes
1 answer
75 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(...
HavocKid's user avatar
0 votes
3 answers
132 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 ...
Konjointed's user avatar
2 votes
1 answer
142 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 ...
Gyoo's user avatar
  • 176
0 votes
0 answers
23 views

Workaround to bind templated functions to lua?

I'm trying to add Lua for scripting to my C++ game engine, which is based on ECS, and I have a rough idea of what I want to do (is it good? probably not) but trying to actually execute it has been ...
Konjointed's user avatar
0 votes
1 answer
72 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 ...
Konjointed's user avatar
0 votes
0 answers
72 views

How to implement events with ECS?

I'm transitioning over to an ECS architecture for a small C++ graphics engine I'm working on and I'm a bit stumped on how to tackle events. One solution I came across was from this Reddit post ...
Konjointed's user avatar
0 votes
1 answer
49 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 ...
Basic's user avatar
  • 1,267
2 votes
0 answers
49 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 ...
Konjointed's user avatar
1 vote
1 answer
109 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/...
Konjointed's user avatar
0 votes
0 answers
56 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 ...
Akshit Chaturvedi's user avatar
1 vote
1 answer
136 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 ...
Konjointed's user avatar
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 ...
AcinonX's user avatar
  • 311
0 votes
1 answer
178 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 ...
anathrax's user avatar
1 vote
0 answers
206 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 ...
AcinonX's user avatar
  • 311
0 votes
2 answers
68 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 ...
Макс Беляев's user avatar
1 vote
0 answers
69 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 ...
Zekfad's user avatar
  • 11
0 votes
0 answers
60 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. ...
Konjointed's user avatar
0 votes
1 answer
277 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 '...
qulop's user avatar
  • 3
0 votes
0 answers
25 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 ...
occulus's user avatar
  • 101
0 votes
0 answers
70 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 ...
VoidTwo's user avatar
  • 103
3 votes
1 answer
443 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 ...
Jacob Edie's user avatar
1 vote
0 answers
128 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 ...
Fichko's user avatar
  • 19
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 ...
Juzzbott's user avatar
  • 123
1 vote
1 answer
138 views

Creating a Renderer class using SFML

I currently have a Renderer class, which as in the example code, looks like this: ...
BOOM's user avatar
  • 11
0 votes
0 answers
39 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 ...
David Notrael's user avatar
9 votes
3 answers
3k 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 ...
YoshGJ's user avatar
  • 495
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 ...
Labba's user avatar
  • 133
8 votes
3 answers
404 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 ...
gaazkam's user avatar
  • 937
0 votes
0 answers
89 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 -> (...
anime username's user avatar
1 vote
1 answer
596 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 ...
blue's user avatar
  • 13
1 vote
1 answer
63 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 ...
Sock's user avatar
  • 11
0 votes
0 answers
125 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 ...
magister's user avatar
1 vote
1 answer
259 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 ...
WDUK's user avatar
  • 135
1 vote
1 answer
316 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 ...
tomsseisums's user avatar
  • 3,366
0 votes
1 answer
132 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 ...
Steyrix's user avatar
  • 213
0 votes
2 answers
82 views

Modeling a naturally circular relationship between three classes

I have three classes Location, Item, Character. Every ...
Michael Moreno's user avatar
1 vote
0 answers
160 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. ...
aallfik11's user avatar
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 ...
Kevin's user avatar
  • 5,734
0 votes
2 answers
390 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. ...
Taras Fityo's user avatar
0 votes
1 answer
146 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 ...
ArenaLor's user avatar
  • 103
2 votes
0 answers
178 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 ...
DyingIsFun's user avatar
  • 1,307
0 votes
1 answer
138 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 ...
d33tah's user avatar
  • 125
3 votes
1 answer
648 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 ...
user29244's user avatar
  • 327

1
2 3 4 5
29