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
1answer
183 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)....
1
vote
1answer
386 views

Are references between entities in Entitiy Component System allowed?

I've got a player entiy in my game that can pick up weapons when colliding with item entities. The player can hold and use the weapon in their hand (the weapon sprite is rendered relative to the ...
1
vote
1answer
61 views

Is a sequential update method really acceptable and is there a sane alternative?

A sequential update method is the update method pattern (e.g. as described here) where all game entities have their update methods called sequentially, even if this means the order of the entities ...
3
votes
2answers
201 views

What is the term for how much a game's code is coupled to its engine?

Essentially, what is a word or phrase I might use/search for to describe how much the choice of an engine dictates the structure of your code, such as the language it is written in or the way objects ...
3
votes
3answers
217 views

How can I un-bloat my player input processing in my text based game?

I'm writing a text based game, and I hit a snag with the user commands processing: so far I have a huge hardcoded ifelse block, and that does not seem good or scalable. With single word non session ...
0
votes
1answer
96 views

Scene components and renderer

I'm currently writing a very small game engine for learning purposes, and hit a block when trying to separate the engine's logic from the "rendering" module. My current approach is to feed my ...
0
votes
1answer
167 views

How to create class for storing different types of vertex?

I am writing graphics engine for educational pursoses and have some problems. I need to have ability to use different vertex formats (for example position+normal+uv or position+normal+uv+bones+...
1
vote
0answers
44 views

Sequencing method calls with time delay

I'm trying to solve what seems to be (or should be) a very simple problem. I'd like to sequence several steps in a GameManager class with some time delay between them. In my case, I'd like to clear ...
3
votes
1answer
349 views

Simulate parallel dimensions / subspaces in Unity without colliding coordinate systems

I've built an online game with Unity with a very large open world. The server (which can be a local player, or run as a standalone application without a local player) simulates everything around ...
2
votes
1answer
297 views

representing transforms without a world/global reference frame

Background: I'm trying to make a segmented/portal-based game engine that supports impossible (non-euclidean?) geometry. By segmented/portal-based I mean the world is divided into segments which are ...
1
vote
1answer
143 views

Preloading for level transitions in a tile-based game?

I am developing a 2D Metroidvania which consists of a series of interconnected levels. When my player gets near a portal which can take him to a new map, I want to pre-load the next map so that there ...
17
votes
1answer
2k views

How can I implement persistent state for objects defined in a level?

I am developing a 2D Metroidvania which consists of a series of interconnected levels that can be revisited. Each level is represented by a Tiled TMX file in which I have specified where various ...
0
votes
1answer
944 views

Tips on how to architect your JavaScript game with classes

OK, so I'm creating a <canvas> game using JavaScript (ES6+) features like Classes. It's straight from the vue-cli and <...
1
vote
0answers
78 views

How to do game object perception at scale without some god object?

I've read through this post Interactions between game objects but it doesn't really address my question. Background assumptions: Maximum number of possible objects and the game still runs Maximum ...
1
vote
0answers
44 views

Good Way to Handle Scheduled Events in Mobile Multiplayer Strategy Games

I am developing a mobile strategy game like Clash of Kings. There are scheduled events in the game (like constructing buildings, recruiting troops, and attacking to other settlements) which happen ...
2
votes
1answer
417 views

Is this an optimal way to architect an OpenGL Renderable object class?

I want to create a class which is a "Renderable class". Basically, world objects will use this as a Base class to create objects that can be drawn into an OpenGL window. This is what i 've got so far: ...
2
votes
2answers
142 views

Is it possible to copyleft license a game engine and still allow users to sell games made with it?

I have recently been studying and working on implementing my own game engine. I am interested in making my work open source so that others may use and modify it freely. However, I also want to make ...
-2
votes
1answer
33 views

Entity update or Keyboard commands transferred to the Gaming server?

I am working on a research project . I need to know the network communication in games in large Multiplayer games (Battlefield,GTA 5). Is there some official documentation present for these games? ...
0
votes
1answer
122 views

How do I deal with this tilemap wraparound edge case?

I'm building a 2D game engine that uses tilesets to build levels. I recently added functionality to handle wraparounds (ie. where the right edge of the map connects to the left edge.) The engine ...
3
votes
0answers
186 views

Optimal solution to render sprites with transparent edges in Unity

Since I'm currently developing a 2D game for mobiles, overdraw and drawcall count is my first priority in the design of the application I've thought initially to split each sprite in two parts: one ...
1
vote
0answers
198 views

unity game engine - should I be using a di framework / ioc container [closed]

Is it worthwhile for a solo dev to take up the widely recommended practice of using a dependency injection framework within the unity game engine? I have seen reason for concern regarding the clash of ...
4
votes
0answers
406 views

With this MMOG architecture, how can I avoid losing games when the server goes down?

I am fairly new to game designing and am trying to design game engine architecture for MMOG poker game. My major problem is scalability. Old Legacy code written in python runs everything on single ...
14
votes
2answers
6k views

What is an actor in game development?

I am reading a book about game development (Game Coding Complete, Fourth Edition) and there is an "Actors" topic which just explains how to use them briefly instead of explaining what it is. Here's ...
3
votes
2answers
253 views

Is single/double frame allocator suitable only for POD datas?

Let´s say I have a single frame stack allocator, so I´m using it for allocating memories for my temporary data. ...
4
votes
2answers
967 views

Performance problems with quadtree for dynamic objects

I´ve implemented a quadtree spatial partitioning to my game engine as I wanted to try it and see how it affects the performance checks. The results were great (instead of hundreds collision checks ...
0
votes
1answer
250 views

What kind of work is usually done by scheduled tasks

I was reading about how task schedulers work in game engines. What is unclear to me is what kind of work is usually scheduled inside these tasks. Do engines usually tick an actor inside a separate ...
1
vote
1answer
122 views

How do you update time based resources? [duplicate]

im currently writing a simple server for a mobile/web game. In short, players have a number of buildings that will produce several items every x minutes. What i though as a solution its creating a ...
26
votes
3answers
8k views

How to handle a large number of pickups in a MMO game

How do games like Minecraft, or really any MMO game that has pickups, handle them? Say terrain spawns 3 pickup drops of "dirt" everytime you dig said terrain. Say every item has a rotation ...
0
votes
1answer
145 views

How to efficiently filter by a component with a specific value in an entity component system (all entities in grid position [x,y,z], for example)?

I'm working on a 3d grid based game, and I am trying to implement it using an ECS. I have a position component which indicates the entity's position on the grid. It is comprised of 3 integers (for ...
0
votes
1answer
134 views

How can I improve on this engine design?

I am trying to come up with a terrain visualization system and I am writing a simple graphics engine for this. For some reason, I wanted to try a new idea. Rather than using dynamic polymorphism and ...
1
vote
1answer
485 views

How to abstract GLFW from my rendering library?

I would like to split my game engine in different libraries, so it is easier to maintain, however i have one problem: for example the window creation is handled by GLFW, so I encapsulated it into a ...
0
votes
1answer
104 views

Should I separate the Pathfinding info from the Tile Info class? [closed]

I have implemented A* on a Tile Based Game, my Tile class contains a lot of info like Position, TileType, Items, Characters, etc on it. Right now that class has the Edges references(neighbours), ...
3
votes
0answers
535 views

Framerate independent realtime input

I am currently working on a fighting game (with 3d graphics, gameplay like a 2d fighter) and encountered a pretty big hurdle I currently don't know how to deal with. For fighting games, input ...
1
vote
1answer
117 views

Single handler vs multiple handlers for the Command Pattern

I'll be soon implementing for the first time a Command pattern to catch general events about the world of the game I'm developing Since I haven't found much info about this particular issue, I'm ...
4
votes
1answer
627 views

Game Engine “Control Flow” Design Options?

I'm dabbling in writing my own somewhat basic game engine from scratch, and I wanted to ask about some common design configurations for connecting the various parts. I'm particularly interested in the ...
0
votes
0answers
22 views

Fast selection of visible child components

I'm working on gui and I have next realization of base UI component: So when I want to get absolute component position I need to sum all parent positions with component position. Also if I want ...
22
votes
3answers
4k views

How to avoid hard coding in game engines

My question isn't a coding question; it applies to all of game engine design in general. How do you avoid hard coding? This question is a lot deeper than it seems. Say, if you want to run a game ...
1
vote
1answer
187 views

How to keep the state of all games in the server?

i have a problem implementing a turn-based game server in java. What i want is a way or a technic that let the server keep all the games state that are created in order to the client recover at the ...
3
votes
0answers
147 views

Design pattern for world objects caching

I'm developing in Unity a voxel-generated terrain and I'm trying to find an extensible design pattern for voxels and more in general, world objects caching. E.g. storing in a 'ChunkCache' class only ...
0
votes
0answers
75 views

Convert a one-player client to a hotseat

I'm making a card game (inspired by Dominion, Hearthstone, Gwent, and others). The way it's set up now, it has a player manager that handles a player's resources ...
3
votes
1answer
262 views

Merging custom c++ engine with Unreal Engine

I have my own custom C++ game engine with networking, game logic (most important) suitable for type of games I am working with etc. I find it harder and harder to keep up with other engines in case ...
0
votes
2answers
276 views

How to handle Entity Initialisation and Destruction

I've been using the ECS pattern for a while now and, as the complexity of the game increased, I started having issues with the timing of the entity initialisation and destruction code. I'll use the ...
1
vote
1answer
44 views

How should I implement an Observer patter in the following example

I am wondering how I implement an observer pattern in the following example. I am mostly wondering what should be in charge of subscribing. The Example A factory produces cars (Observable), they ...
0
votes
1answer
50 views

Which Entities should be in my Pooling System?

Let's suppose that I'm designing a Tanks Battle Game, there will be a lot of projectiles and Tanks. Every Tank is composed with a Body, multiple Weapons such as Machine Guns, Missile Launchers, etc ...
0
votes
0answers
98 views

Are unit/building types generally stored as full objects or imported properties?

I'm trying to write a generic turn-based strategy game, with a few unit types, building types, etc. Since this is something I've never done before, and its not a very easily searchable subject, I'm ...
2
votes
1answer
316 views

When/where should a game state transition take place?

I'm in the process of redesigning some of my state management code (there are several features I've grown to dislike in practice..) which was based on this tutorial and others. The issue I'm having ...
6
votes
2answers
248 views

Should I store a value for every damage type even if zero, when using the Decorator pattern?

My game characters take damage by the method TakeDamage(Damage amounts), and the Damage struct has every type of damage (...
0
votes
1answer
70 views

Guidelines for determining what should be a component?

Background: So I'm developing my first 2d C++ fighting game (for learning purposes) and I have a setup where I have 'components' which are really just data holders with maybe some simple utility ...
2
votes
2answers
564 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, ...
11
votes
1answer
2k views

Creating a Robust Item System

My aim is to create a modular / as generic as possible item system which could handle things like: Upgradeable Items (+6 Katana) Stat Modifiers(+15 dexterity) Item Modifiers(%X chance to do Y damage, ...