Questions tagged [architecture]
How code is structured. For questions on the internal design of a game engine.
1,345
questions
0
votes
1
answer
16
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
34
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
57
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
142
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. ...
0
votes
1
answer
47
views
Architecture of networking in game engine
I am currently building a 2d game engine, with the future intention of adding some sort of networking functionality. I have past experience making networking games in Unity and whatnot, however I am ...
0
votes
0
answers
36
views
(FSM) Detect a change on a variable on Update, and trigger certain State
So, I'm working on a FSM that ticks on every frame. The inner workings can be simplified to this:
The user (me) creates the States:
...
0
votes
1
answer
61
views
How to give two GameObjects references to each other?
I have two GameObjects and would like both to have a reference to the other. I know this can be done by creating public properties and setting them with Unity's inspector, but my preference is to ...
2
votes
1
answer
53
views
How are map/room/world-related game assets usually organised and implemented?
I'm trying to build a simple 2D Shoot 'Em Up type of game in C++ using SDL2 and an Entity Component System, which I've already implemented. The idea is to have different maps/rooms where you have to ...
2
votes
1
answer
71
views
Why are some gameplay systems set up to `exist in the world`, with full collision and kinematics, whereas others seem like `complex event timelines`
I wanted to ask a question I've always wondered about to the larger crowd of gamedevs out there:
Why is there often a disconnect between the locomotion / kinematic systems that a player controls vs. ...
1
vote
1
answer
69
views
How to include cross cutting concerns like sound/graphics effects in an ECS?
It does not seem like a good idea to include this functionality in the game logic like that even if the concrete implementation of the sound or graphics effect is abstracted away. Ideally, the game ...
0
votes
1
answer
26
views
Architecture advice: a combo manager with combo displayed on the GUI in Unity
I would like some advice on the architecture I am using, and if there's perhaps a better way to go about doing this / if I am over-complicating things.
I have a combo meter go up on the screen based ...
0
votes
1
answer
47
views
proper items db design mysql
I'm working on a game using MySQL as the db. I'm struggling a bit on the database design, this is the part I'm struggling with:
So basically exp_ups, mystery_boxes and weapons are entities in the ...
3
votes
1
answer
75
views
Proper way to build sensible object graphs?
The Context
I'm currently working on a game and its engine using C# and MonoGame. The engine is data-driven and I want people to be able to mod the game or make their own using my engine. All the ...
0
votes
1
answer
32
views
First Person shooter look direction abstraction for InputController, AIController and NetworkController
The problem
Suppose I have a game where there are multiple Input Controllers:
LocalPlayerController: Reads inputs from the keyboard/mouse/gamepad.
...
0
votes
1
answer
61
views
Scripting Language To Renderer Architecture
I am currently designing the scripting side of our engine.
The idea is an entity-component system. That means most of the coding is done via jobs.
The language we are using is compatible to C. The ...
0
votes
0
answers
38
views
Unity code design - Events
I am aiming to create a Unity project with a code structure similar to ECS.
I want the code to be consistent, easy to integrate extend and expand if multiple developers will work with it.
By that I ...
1
vote
2
answers
90
views
How do you break up or architect Unity scripts?
I have a player script that is turning into a bit of a monster. I don't know too much about Unity so I'm just jamming the whole game logic in there which does not seem right. The player is currently ...
0
votes
0
answers
77
views
Best architecture for describing interaction between spells
Interactions serve as retroactions. I'm currently looking the best way to describe interactions between different abilities.
For instance, if we take a fire ability and a water one, a lot of different ...
0
votes
0
answers
50
views
How to Pass Multiple VBOs to OpenGL for a voxel game
I'm trying to make a voxel engine (NOT based on an octree model). Currently I have a setup with a Chunk class, which stores the following:
...
0
votes
0
answers
122
views
Mini-games development like Wario Ware in Unity
I'm trying to develop a game that consists of multiple simple minigames, just like Wario Ware or Dumb Ways to Die, but in Unity. The problem is I'm not sure how the project should be structured. I've ...
0
votes
0
answers
28
views
What visual object should I use for a lot of for nonmoving objects in Unity?
The objects only need to mouse clicked but there are 1000 of them. They don't move- they have color modulation and text. I was thinking buttons, can Unity reliably handle so many of them? Or do I need ...
1
vote
1
answer
134
views
Extensible 2D Rendering with ECS Architecture
I am currently creating a 2D game/game engine using an ECS architecture. Currently I have a renderer_2d system which is a function that takes all ...
0
votes
1
answer
177
views
Help with software design of a turn based combat system using SDL2
I have been working on a RPG where the player is free to wander an open world but when a monster is encountered or on keyboard command
the game switches to a turn based system. Note this is not like ...
0
votes
0
answers
47
views
What's a good architecture for a simulation?
I have a concept that involves a world being simulated. Lots of entities and processes acting upon them, not to mention interactions, etc...
Every SimulationTick, ...
1
vote
1
answer
190
views
What should be an entity/component, and what shouldn't?
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 ...
3
votes
1
answer
90
views
Storing stateful function-based actions in a JSON
System: My game uses an "ECS + event queue" architecture where every tick, various events change
the state of JSON-able data. Plain JS objects.
Problem: I want to be able to save the game-...
0
votes
0
answers
80
views
How can I efficiently and safely represent and query game state in the logic programming paradigm?
After learning Dialog, I've discovered representing game logic using the logic programming paradigm is a lot of fun; the composability and non-locality makes it feel like some kind of superior ECS. ...
0
votes
2
answers
62
views
How to handle bloat that comes with derivative ScriptableObjects?
I have ScriptableObjects with special code functions that all are slightly different in their interaction, all derived from one main ScriptableObject. This has lead to making the ScriptableObject ...
1
vote
2
answers
118
views
Design patterns for non-modal (in-game) dialogues/cutscenes in a game engine
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 ...
0
votes
1
answer
64
views
Point System Using a GameManager?
I am trying to use a GameManager script to store and hold my players points, across multiple levels. The problem is that I have no idea how I should implement this. Should I declare the points ...
1
vote
2
answers
193
views
How to handle "identity" of unit/building types within an RTS context?
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 (...
0
votes
2
answers
82
views
Naming convention for loop modules
Question about game engine object oriented design.
Let’s say I have an engine with a main loop, and many handlers that will be executed by the main loop every time on next iteration of main loop. So ...
1
vote
0
answers
54
views
How is the processing for FPS games with massive worlds (like Planetside 2) distributed between servers?
For such massively sized maps with an insane amount of players when it came out (or maybe it still has thousands of players in one general area at once still?), I'm almost certain the entire world is ...
0
votes
0
answers
32
views
What are Unity's subsystems used for?
What is the purpose of these classes?
https://docs.unity3d.com/2020.3/Documentation/ScriptReference/UnityEngine.SubsystemsModule.html
I understand generic subsystems in web development, is this the ...
1
vote
4
answers
327
views
Are MMORPG servers and clients usually developed in isolation?
As with the title, are they usually developed together in a custom engine, or are they mostly developed independantly of each other? e.g. the server and client as completely different projects that ...
2
votes
2
answers
122
views
Record/History of moves and state of entire game after that move for a Turn based game
My first question here! :)
Im trying to conceptualize how I would go about recording the moves of my players, and also the state of my game after the calculations of that move.
For example, Final ...
0
votes
2
answers
211
views
Designing persistence in an ECS world subdivided into chunks
I'm designing a kind of simple open world with ECS. The whole world is too large to be loaded at once, so I load and unload chunks according to player's position. Nothing fancy, pretty much standard ...
0
votes
1
answer
81
views
How to design a system that allows for custom equations of movement?
I'm developing a top-down shooter and I currently have a PhysicsSystem which operates on TransformComponents. Basically, it ...
1
vote
1
answer
115
views
Should state and behavior be combined for Buffs? Cannot decide between data-driven and OOP approach
I'm writing a 2D roguelike that uses an Entity Component System and I'm having trouble deciding between the traditional OOP approach versus a data-driven approach to implementing buffs and debuffs. ...
1
vote
1
answer
172
views
How do game engines enforce global, engine-specific coordinate systems?
In Unreal, the 3D coordinate system is defined as a right-handed, X-forward, Y-left, Z-up frame of reference; but, the default 3D coordinate system for, say, DirectX is a left-handed, X-right, Y-up, Z-...
2
votes
1
answer
117
views
How can I solve interactions between game environment and Entities like player or NPC on the code level?
I want to figure out how objects in a game environment like these:
A reward Chest
A mana depleting/replenishing zone
sudden stormy winds in a certain direction
should affect other entities' (player'...
1
vote
1
answer
79
views
How do I solve a problem where sometimes recursion is untenably vast and sometimes it is not?
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 ...
0
votes
1
answer
468
views
What server architecture should I use for matchmaking in Node.js?
I'm making a board game in which users register for a game which will start at fixed time and users can register till the start of the game. My initial idea was to use it with socket.io(connection ...
0
votes
1
answer
81
views
Best way to handle events for a turn base game?
I'm looking for the best way to handle events for a tactic game in Unity. Every unit may need to react to different events (turn start, end, on damage to self, on damage to other, on kill, etc...).
At ...
1
vote
1
answer
172
views
Multithreading vs Asynchronous game loop for multiplayer online game?
I'm trying to create a turn based multiplayer online game where players can be grouped in a room/lobby and play (similar to Ludo but number of players can be more than 4). There can be multiple such ...
0
votes
0
answers
29
views
Designing an API for defining rigged game entities
I am making a game framework for building/constructing what I would imagine are called something like "multi-component rigged entities". This would be things like a stick-figure drawing. Can'...
0
votes
2
answers
742
views
What data structure do I use to store Archetypes in ECS?
I am implementing an ECS with "archetypes" similar to how they are defined in Unity:
A unique combination of component types is called an Archetype. For example, a 3D object might have a ...
0
votes
2
answers
142
views
Structuring a game in Java
I am currently programming my first game in Java and I'm having trouble structuring it.
My biggest concern is regarding the game loop.
Currently I have implemented a class with only a main function ...
5
votes
2
answers
2k
views
Can you show rng code running in real time in a game?
First off, I know almost nothing about game development/rng but I will learn. So apologies for sounding uninformed.
I want to make a sandbox ios game with several activities to do within, one of which ...
1
vote
0
answers
59
views
How to reduce code duplication in a cross-platform renderer without tying the interface to one specific API?
I'm working on a game engine as a fun project over the spring+summer. I've decided that to allow myself to explore rendering APIs I'm unfamiliar with, and force myself to write reusable code, I'd ...