Questions tagged [architecture]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
54 views

Synchronizing clients

I have a server-client setup where each client has a number of screens attached, and the screens together form the display. As such, the visuals displayed by each client needs to be roughly in sync. ...
3
votes
2answers
176 views

Game Architecture: Class leaking into almost all files

We currently have the problem that our main class GameController is being pulled into every backend file in our game. We're wondering what are common solutions to this problem. Here's a bit more about ...
2
votes
2answers
983 views

Using an interpolated game loop (such as Gaffer's final game loop), will the frame be rendered out of sync?

A highly recommended game loop is one from an article called Fix Your Timestep. It presents a method to update using a semi-fixed time step with interpolated rendering. The problem with this is that, ...
0
votes
0answers
25 views

Data structure for objects in a galaxy of star systems

I'm having some difficulty coming up with the appropriate data structure to use for a game. I'm aiming for a galaxy view with tens of thousands of visitable star systems. Structure Hierarchically, ...
0
votes
1answer
40 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
1answer
93 views

Instantiating GameObjects in Custom Game Engine

So,i'm having a bit of an issue with instantiating my gameobjects into to universe(My Scene object). I can create an empty object from scratch and populate it from there with ease,my problem starts ...
0
votes
1answer
28 views

How to disable pause() in game_loop() once game_over() function is called?

How can I disable pause() in game_loop() once game_over() function is called? game loop ...
1
vote
2answers
136 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 ...
0
votes
0answers
27 views

Questions about “stateless, layered multi-threaded rendering”

I have read this blog: https://blog.molecular-matters.com/2014/12/16/stateless-layered-multi-threaded-rendering-part-3-api-design-details/ Where does a setup like this bind textures/buffers and does ...
1
vote
0answers
21 views

How to deal with references to shared manager classes

I am using C# with MonoGame, although this is relevant for any object-oriented programming language Static classes should be reserved for stateless utility classes (for example System.Math) and they ...
1
vote
0answers
44 views

Entity Component System: Dependency Between Systems

Inspired by the Entity Component System Architecture, I started to refactor my 2D tiled-based game to follow the rule "favor composition over inheritance". However, after writing the ...
0
votes
0answers
19 views

ECS: Should Systems access only one component-type [duplicate]

Let's say I have a Transform-component-type, and a Color-component-type (to keep things simple). I also have an entity E that is ...
0
votes
0answers
26 views

Multiple planar reflections works weird in UE4

When I add multiple planar reflections for arch-viz, some of them on glasses don't have any result, but ones on mirror works properly. Sometimes all the planar reflections on glass are invalid. But ...
0
votes
2answers
337 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
0answers
66 views

Game server multiplayer architecture

I'm planning to build a big browser multiplayer game with gameplay very similar to agar.io but rpg. Game will be containing rooms as It's done in agar.io. 50-100 players max per room. Realtime. 10ms ...
-1
votes
2answers
97 views

Why do we have to use a fractional numbers in the graphic engines (2D/3D)? Why integers are not enough?

Maybe it'll be a super beginner question but can someone explain me why do we have to use a fractional numbers (floats, doubles) ...
0
votes
1answer
65 views

Functions in the game loop

I'm learning about the game development. No i'm on the total basics - writting a proper game loop. As i've searched over the Web i'v found that simple but good ...
0
votes
1answer
32 views

Approaches on 2D top-down track racing visualisation

I'm considering writing a very simple management style game with the theme being motorsport racing. I've got a good idea how to do the 'management side', but the issue I'm having is how to visually ...
7
votes
5answers
2k views

Networking gampeplay - Sending controller inputs vs. sending game actions

I'm reading about techniques for implementing game networking. Some of the resources i've read state that it is a common practice (at least for some games) to send the actual controller input across ...
0
votes
1answer
46 views

OOP architecture problem between Camera, Player, Weapon

I am making an FPS game in Unity, trying to keep myself to OOP principles as much as I can but I found dead-end. I want to add recoil to my game, now logically thinking the amount of recoil should be ...
0
votes
1answer
62 views

Entity component system: how and where store pointers to system resources or third-party lib's objects?

I'm migrating my game pet-project to ECS. I use C# (custom-made engine, not Unity). It goes pretty well, but one big thing is making me worry. This is how and where to store pointers to system ...
0
votes
1answer
99 views

What's the Unity way of implementing data driven UI

I'm used to application development with frameworks like Qt, and I'm really fond of using MVC-like patterns. Now I'm diving into game dev and I have a bunch of data that I want to show the user and I'...
0
votes
2answers
199 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
0answers
34 views

Any clue to create natural shadow like this?

I only use skylight with hdri map for overcast lighting. The corner isn't dark enough compare to other's work. Any clue to achieve this natural falloff soft shadow? What I want What I get My world ...
1
vote
1answer
713 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 ...
0
votes
0answers
29 views

Managing player/AI state in Entity Component System

I am working on a 2d platformer game. Right now, I'm also using ECS. My question is how can I manage player's and AI current states in the context of ECS when some states are exclusive and some may be ...
1
vote
1answer
315 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)....
3
votes
1answer
99 views

Encapsulating parameterised prefabs

I'm currently using the following general pattern for most of my configurable components (i.e. MonoBehaviours): ...
2
votes
1answer
113 views

Shifting Skill Tree

I have been thinking of implementing a system like Wolcen does for their skill tree, however I want to use it for level unlocks. Nodes grouped in segments and multiple segments from a ring (see ...
0
votes
0answers
47 views

Game Rooms Server Architecture - ENet CSharp

My team and I are working on an upcoming online fighting game using ENet-CSharp (A C# ENet implementation created by nxrighthere), and we're currently designing the architecture of the server. We ...
0
votes
0answers
24 views

Making a successful party matchmaking system

I am currently making lots of servers and stuff like that for a game that me and a few friends are working on. For the last few days I've been thinking a lot about how to best implement a partied ...
0
votes
2answers
107 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. ...
1
vote
0answers
46 views

Efficient way to store “item” objects in a simple game

I am developing a simple text-based game from scratch in Java. In this game, the user is able to collect items and store them in an inventory. My question is: how should I organize the internal ...
0
votes
0answers
49 views

Microservice architecture in game client

We can use microservice architecture for backend in mmo games, like one service for auth, one for chat, etc But can(or should) we use same architecture for client part in mmo games? One service for ...
0
votes
1answer
167 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
0answers
66 views

How can an Entity trigger changes to the world in C++?

I'm writing a simple physics based game in C++ using SFML. I want to trigger a scene change when my playerCharacter collides with a door. Since C++ does not have any native Event Sender/Listener ...
1
vote
2answers
55 views

Should I do interactions between a new class and the main engine via a redirector class, or directly refer to only the classes the new class needs?

I'm making an open-source voxel engine, and there's an architectural problem that I would like an answer to. I have come up with 2 different solutions, and would like your opinions on: When I'm ...
2
votes
1answer
86 views

Management of objects as targets of other objects

I have started my first game three years ago and learned a lot during that process. Now I would like to rewrite it to incorporate my "lessons learned" or try out new ideas. My game consists of space ...
1
vote
1answer
67 views

Is it useful to distinguish between two different kinds of events?

i have thought about this for a long time and i think i just going in circles. I need someone to tell me if im just simply overthinking it. So, first of all im coming from a 'classical' ECS approach: ...
0
votes
1answer
68 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-...
1
vote
0answers
51 views

Skyrim:Papyrus Possible Conflict Error [18+?]

I am working with a friend of mine to create a mod that relies on a mod called Devious devices, which would allow BDSM be utilized in Skyrim's combat by allowing the assailants to have special weapons ...
19
votes
13answers
34k views

How do I ensure a piece of code runs only once?

I have some code that I only want to run once, even though the circumstances that trigger that code could happen multiple times. For example, when the user clicks the mouse, I want to click the thing:...
3
votes
3answers
517 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 ...
1
vote
2answers
92 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
39 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
87 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
595 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
20 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
45 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
103 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 ...

1
2 3 4 5
26