Questions tagged [architecture]

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

Filter by
Sorted by
Tagged with
2
votes
3answers
29 views

How to create a solid cross-scene game manager in the editor of unity?

I have been checking dozens of known 'solutions' for how to create a game manager in Unity, but none leave me satisfied. I know I can create a singleton GameManager.Instance() that would have data to ...
0
votes
1answer
22 views

What is the most effective way of managing scene objects states in Unity?

I often see this kind of problem in projects: the scene contains many hierarchical objects that must be in a certain state to work correctly. If a disabled object has to be edited it has to be ...
1
vote
2answers
73 views

Best way of passing game data in functions?

In most programs, if we want to do something to, say, Bob, then myFun(bob) is enough. We know that the function deals with Bob and won't touch Alice. However, in a ...
0
votes
1answer
22 views

How do you handle entity life-time and entities without all components in an ECS?

I'm just starting to implement my own ECS and am drawing everything down on paper to make sure I understand it all before tackling the implementation in code. However I'm getting stuck on entity-...
0
votes
1answer
28 views

Ideal way to instantiate abilities in a class give a dynamic list of abilities to use?

I have a PlayerClass class that is used to set my Player's class. For instance, this will make him a warrior: PlayerClass warrior = new WarriorClass(); ...
0
votes
1answer
78 views

How to differentiate between object types and roles?

I have a base class Object, and depending on how the object must behave on the scene, I have multiple abstract "role" classes, that inherits virtually from ...
2
votes
0answers
43 views

Idle game: calculating resource generation/consumption

I'm making an idle game in the vein of Melvor Idle and I've run into a problem calculating the yield and consumption of resources while the user is away. For those who don't know, many idle games have ...
0
votes
1answer
19 views

Best way to implement a class or interface for a set of UI buttons that only differ in their Draw() function?

I have three types of UI buttons that go on a cooldown bar: A traditional cooldown bar button where once the corresponding key is pressed, a timer shows over the button and dims the texture. A button ...
0
votes
2answers
291 views

Project organization for a multiplayer client-server game

I'm programming a game 100% in Java but I'm having some issues concerning the final games architecture. I plan on having two separate projects: one that will hold the client side of communication ...
0
votes
2answers
44 views

How do I design my classes so that my Player.cs code can use class-specific abilities from another script? [duplicate]

Right now, I have a Player.cs class that handles button pushes, movement speed, damage, Update() etc. At the moment, all of the logic for button presses triggering an ability, and the logic ...
0
votes
2answers
82 views

How do I design my RPG-like class system in a more modular way?

I'm building a mod for Terraria that will add classes and their corresponding abilities to the game. You're a warrior? Push your ability key and you'll use your berserk ability. I'm trying to make ...
0
votes
0answers
51 views

Best game loop architecture

So I understand how a game loop works (listenInputs/updateData/redrawInterface) but what I'm struggling with is how am I supposed to equalize rendering? I initially thought I had to make the thread ...
0
votes
1answer
29 views

Behavioural Items with ScriptableObjects

My game has an item system that is relatively small compared to most of the RPGs, but it is pretty similar to the games like Half-Life and Counter-Strike where you have an inventory consists of ...
0
votes
0answers
28 views

unity3D Angry bird orthographic 3d approach

i want to create a game like angry birds but in orthographic mode 3D . i want to give the player the ability to Jump to the Red and Blue Platform (see the picture below) with the Click, Drag and ...
0
votes
0answers
22 views

Forward rendering and separation of shaders logic

I'm currently playing with writing a rendering engine and implementing a forward rendering pipeline. I have few doubts on how things should be implemented regarding the render passes as-well as the ...
-1
votes
1answer
33 views

Flexible Message

I'm looking to create a way to show messages to the player. The message should be able to have pictures, different options and outcomes. What's the best way to design this?
0
votes
0answers
34 views

Design decisions in building a 3D Rendering Engine using Vulkan in C++

I'm starting to learn the core concepts and features of the Vulkan API. I'm following the tutorials that can be found here: vulkan-tutorial. I'm at the point of getting ready to implement the code to ...
0
votes
0answers
24 views

Updating argument for a matrix every frame

Question is how to properly use continuously changing argument every frame. I have Class Shape, which have children Box, Sphere, etc..., I'll follow with Box example. Each of children have ...
0
votes
2answers
187 views

How do i manage skill collision target in Unity?

I wanted to make a skill that can be used by both Player & Enemy. How do I make it such that the skill will not be colliding with the owner/caster or colliding with both? One stupid way I have ...
2
votes
1answer
169 views

Multithreaded design for a game server

I would like to start developing my own game. Basically, the game has a "world" that players can travel around and modify. Think of it as a much more realistic version of Minecraft or an open world ...
1
vote
1answer
687 views

Libgdx: Check collisions in Stage among actors

My goal is to check collisions among the actors that are in the Stage. My question is: is it necessary to maintain a list for each type of actor I have? Doing that I get 3 problems, 2 bad design ...
1
vote
1answer
261 views

Box2D simulation running slower on lower FPS(even when the desired FPS is lower than the actual)

I´m playing around and trying to make myself an easy platformer using the Box2D physics, before that I was not using it and was using my own physics implementation(just simple movements with timestep)....
0
votes
1answer
48 views

Making an RTS game- how to handle player-created units interacting with each other

I'm making an RTS game in Unity with C#. However, the interaction I'm going to have with player-created units interacting with other player-created units is what has me stumped. The player and his ...
3
votes
1answer
540 views

Game Engine Memory Allocator

I'm a bit confused on how to implement an allocator for my game engine. I'm currently trying to implement PhysX for the physics in my game and it requires an implementation of an abstract allocator ...
3
votes
1answer
92 views

Encapsulating parameterised prefabs

I'm currently using the following general pattern for most of my configurable components (i.e. MonoBehaviours): ...
134
votes
3answers
86k views

How should I write a main game loop? [closed]

How should I write a main game loop? What are some things that you should do in the game loop, and what are some things that you shouldn't do in the game loop? I've written plenty of them, but I've ...
0
votes
0answers
12 views

Filter data in scriptable objects

I have imported data from a csv file into a scriptable object. The scriptable object is made up like this. ...
2
votes
1answer
1k views

Pattern for collision handling?

I am writing a game with Java. There are many different kinds of entities on the screen, like the player, NPCs, monsters, bullets, items, shiftable blocks and so on. This question is not about ...
2
votes
1answer
271 views

How to program (architecturally/organize) a set of customizable changes to a game?

The floor of my game (tower defense) is composed by a set of cubes. I wish to change these on some of the waves. I have a list of the changes that need to be made on each wave in a floorController ...
0
votes
0answers
30 views

What information should be included in a render command?

I'm writing a 3D renderer for my engine and now that I'm working properly with a scenenode system, I've decided to implement render queues (command lists to some) and render commands. I wanted to know,...
0
votes
0answers
30 views

minecraft like game server database arhitecture

Let's say we have a 2d map 500*500 tiles in size. And each tile is editable by players and has many states. So it's 250k tiles. The game is multiplayer online game. What would be the best approach ...
0
votes
0answers
26 views

How would I go about creating dynamic weapons using EC architecture?

I currently have a weapon component that contains common functionality across weapons (mainly guns). ...
0
votes
2answers
97 views

Moving cars on a tiled map

I'm writing a game which is situated on a tiled map. I have a PlayState on which there's a Board which cosists of Fields. My Board is an isometric map of a city, where each tile is a kind of road. ...
0
votes
1answer
128 views

Possible patterns for Registering event listeners of game entities with an event queue

I'm trying to integrate the idea of an event queue with a game loop that creates entities and responds to input. Is it better practice to submit entity reaction functions to the queue during input ...
2
votes
1answer
89 views

Right way to get reference from across scene object in unity

I need a reference for the game-object from another scene but the problem is that the scene object by default is off. So I thought that I should place its reference in another script and get a ...
0
votes
1answer
78 views

How to manage network spawning?

I'm developing an multiplayer game "from scratch" (not using a big Engine-Suite like Unity but the lower-level libgdx). Currently I've got a NetworkManager which handles the sending of messages on ...
1
vote
0answers
61 views

Is it better to store whole levels in one model file, or maintain smaller reusable models and a custom scene format? [closed]

I've experimented with a few small game engines over the past few years and usually I end up keeping models separate as a .dae or similar file, then designing a scene file format and hand-writing the ...
0
votes
0answers
63 views

Workflow for a data-heavy, almost spreadsheet-like management game

I'm absolutely fascinated by the management games, such as Football Manager, with dozens of spreadsheets and thousand of pieces of data. Coding it all in Unity, especially for a prototype, feels like ...
1
vote
2answers
116 views

How do you make sure that a component can be applied to very different entities?

I know there's lots of posts about this sort of thing, and I've read a lot of them, but there's some gaps that I can't seem to fill in my head. Specifically, I've been reading about the SOLID ...
1
vote
0answers
51 views

Is Loading Assets Before Game Start Necessary? [closed]

I am creating a relatively simple game engine that uses opengl. Do I need to create a system that loads all the 3d models / textures from files before the game starts, or is loading them during ...
0
votes
1answer
103 views

Good data structure for storing graph-like map

I'm creating a strategy-based kingdom expansion game, where you start with one city and try to expand as far as possible from there. All the cities fit on a hexagon-grid and are connected by the edges ...
0
votes
1answer
105 views

Need help with making number system for idle game

So, I want to create a new game. I have problems with how to store large numbers in the game and how to output them. I have written a small pseudo code that contains everything I need to play the game ...
1
vote
1answer
420 views

dx11 Rendering to target texture shows only clearcolor(ImGUI-Custom Game Engine)

Im trying to create a game view for my game engine using ImGui framework,however when i try to render texture,there is only clear color displayed on the screen. My plan Creating Render Target ...
11
votes
4answers
4k views

How can I implement an inventory that stores different types of items?

Let’s assume I want to create an RPG with collectible items my character can pick up and store in his inventory. One item could be a sword, with an attack, defense, and level attributes. Another ...
0
votes
0answers
48 views

How to document processes and concepts for a game?

For the sake of generating a documentation and having a reference for my self, I want to formalize some concepts, behaviors and processes in a proper way. For example: My game has a game server. This ...
1
vote
1answer
66 views

How do rendering pipelines improve the performance of updating all the vertices every frame?

Let's say I am implementing a simple game engine, particularly the rendering part. From the high-level view we have some vertices which are copied to the graphics card alongside shader information etc....
3
votes
2answers
214 views

String storage in game engine

I've been designing the memory management module for my game engine, including things like custom allocators and when it came to allocating memory for strings I kinda got stuck. What I mean by strings ...
0
votes
2answers
139 views

Why are rotations in 2D game engines often counter-clockwise = positive systems?

I was looking over the API for a game engine a friend was developing in her spare time. She made the decision to make positive angles rotate in a clockwise direction. This immediately struck me as odd....
0
votes
1answer
149 views

How can I structure in-game menus?

I'm working on a multiplayer RPG using only C++ and SDL2. I've already made the main menu and a map editor, and I'm preparing to make the actual game. The main menu and map editor were easy to ...
0
votes
2answers
96 views

Querying game objects in real-time

I'm thinking about working on a game where I need to find all the objects matching certain properties. For instances I might need to look up all the objects... Producing gold. Whose level is 5 or ...

1
2 3 4 5
26