Questions tagged [architecture]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
685 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
189 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
76 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
265 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
311 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
45 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
336 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
249 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
652 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, ...
12
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, ...
0
votes
2answers
98 views

How can I fix the vibration in my Player movement?

Edit: solved my issue, but look at the other answer I am stuck with a problem that I cant quite figure out. When I move my Player to a new point, it does get there, but it vibrates. I can't seem to ...
1
vote
1answer
81 views

How do I make the camera aware of the position of the object it is tracking?

I'm making a 2D game with a Camera that tracks GameObjects (usually the player). At the moment, a ...
5
votes
1answer
429 views

Managing complicated RPG character data

For a detailed survival RPG, the data that needs to be managed can easily become overwhelming if approached in an ad hoc manner. First, you may want to do away with HP and instead have a system of ...
0
votes
1answer
101 views

Why are voxels used for landscape?

According to Wikipedia many games have been using so far voxel engines for modelling landscape. Why is it only used for landscape and not characters etc?
8
votes
4answers
1k views

Goal oriented Action Planning with multiple Agents

I'm a little bit stuck: I implemented an AI with GOAP (Goal oriented Action Planning, http://alumni.media.mit.edu/~jorkin/gdc2006_orkin_jeff_fear.pdf) for a simulation game. That works fine. Now I ...
0
votes
1answer
96 views

Structure GameObject - States - Visual representation

Question: What is the best data structure for GameObjects that have different states and thus different visuals? The situation is: I'm creating a game for mobiles (written in Kotlin, no Engine used)....
1
vote
2answers
365 views

Getting Components to their respective System in Entity-Component Engine

I asked this question in stackoverflow, but I didn't get any responses. I think it's better suited in this exchange. I'm building a game engine of sorts (purely educational) and am not sure the best ...
0
votes
1answer
255 views

Game engine tool generating game entities

I'm writing a game engine with an editor that allows you to create individual components like sprites, fonts, and particles. Then you're able to combine these individual components into what I call an ...
1
vote
2answers
1k views

Do game engines compile games or just interpret them

I know that many game engines like Unity3d use scripting languages like c# or java script but does that mean that a game engine is just an interpreter? If so, does that mean that if I move the ...
2
votes
1answer
112 views

Gameserver Request handling

EDIT: I forgot to mention that in this implementation E stands for Entity which is just an ID, C => Component as data-only types and S for Systems which should implement logic Currently i'm working ...
3
votes
2answers
91 views

Filter game data according to player unlocks

I'm currently developing an online "empire management" style game in HTML and Node. Along the game, the player will be able to raise resources (by creating farms, mines, raiding) to unlock new ...
2
votes
1answer
934 views

Game engine design choice, favour data oriented design over oop?

I have a scene, in the scene there are multiple systems. Transformsystem, collidableSystem etc ... Currently, these do nothing except returning a bool if the parameter component matches the system: <...
2
votes
1answer
112 views

Logic and view separation but the view is generated by the logic

We are working on a simple turn-based card game. We would like to implement it using a design which let us create additional "monsters" and "events" later on (so the code should be flexible). Also, ...
2
votes
0answers
183 views

Event based collision system

Currently I am writing a litte 2D engine for training purposes. Some time ago I had some thoughts about good ways to implement and handle collision. (Not about the particular algorithm, but about how ...
2
votes
2answers
73 views

Programming Pattern: Representation of pick up objects

I'm pondering about the best way to represent objects that can be picked up in my 2D engine. I have an Actor class which is the base for all objects that can be spawned into the game. This class ...
1
vote
2answers
1k views

Entity component system design. Should ID of entities be continuous?

I am implementing an entity-component system. Below is my current implementation in c++. ...
2
votes
1answer
394 views

Should I avoid constructors/destructors in C++ when using custom allocators?

I'm currently building my first 2D game engine and have reached a point where some large-scale tests have shown that some form of custom memory management would be beneficial (object pools). So I ...
5
votes
5answers
2k views

Is it acceptable to use Hash Maps for input, copying one hash map to an another during the game loop?

I recently started developing a simple 2D game in Java using JavaFX and no proper game library (libgdx etc.) and among the things I did was to make an InputManager to handle every input from the ...
1
vote
2answers
177 views

Where should I put the code for objects interactions?

I'm working on a 2D puzzle game, and one of the features is the ability to push crates so you can climb on top of them to get to a destination. I've tried many things to get this to work but none of ...
1
vote
0answers
56 views

Flexible and extendable system of level objectives (victory/failure conditions) in Unity

I'm trying to come up with a flexible system of level objectives for a Unity game. What I'd like to achieve is to have a system that on each level (scene) can accept a different set of (configurable) ...
0
votes
1answer
262 views

What is the intended usage of the Sprite class in LibGDX

I am making a small game in LibGDX and it all works, sprites are moving etc. The drawing is mainly done in the render() method of a Screen, using Batch.draw(TextureRegion). So far so good. But now I ...
0
votes
1answer
52 views

How to save and update modifications done by the player in my procedurally generated JavaScript game?

I am making a game and I need the world to be generated and saved. I used Perlin noise to generate the terrain (and other stuff like trees), but cannot figure out the best way to save and recall ...
1
vote
0answers
77 views

Interaction between entity and tiles

In my game, I have a player, ennemies and tiles like Mario. And each entity has a different behavior when it touches a tile. For exemple, when my player walks on spike he dies. But a certain type of ...
6
votes
3answers
2k views

Clicker economy and bonus system

How is an economy system implemented in clicker games? Obviously, you can't store values like 1 Quintilian in long type. I understand that there might be some string operations or even better, some ...
2
votes
2answers
720 views

Architecture for extremely modular game? [closed]

I'm developing a modular game in Unity 5.6. Each module has very little overlap in assets with the others. I'm concerned about having a bloated repository after a few months of development, and since ...
3
votes
2answers
118 views

Large-Scale Case Handling for 2D Procedural Environment

I am creating a procedurally generated side scroller and I have a question regarding proper code structure/Architecture when it comes to connecting different platforms and large scale cases. There are ...
2
votes
1answer
818 views

How to make a game people can mod? [closed]

In C++, how can one make it's game load content developped by other people? For instance in Java you can look for jar files and load specific class from it.
4
votes
1answer
207 views

When should I acquire game objects with dependency injection, find-with-tag, or singletons?

This is sort of a best practice/efficiency kind of question, and I haven't really seen any other question talking about these three things together. Essentially, Dependency Injection, Find with Tag (...
0
votes
2answers
445 views

Finite State Machine for player states

I have a state machine for a game I am developing. The player can be in four states, depending on button clicks, and some game elements (being in thin air, or standing on the ground). I am just ...
1
vote
2answers
587 views

Don't message systems slow down game engines?

I am wondering, aren´t messaging systems slowing the speed of engines down? I mean, lets say that I want to zoom in my camera, without messaging I would do something like: ...
1
vote
0answers
373 views

Nested Entities in Entity Component Systems (ECS) [duplicate]

Say I have an entity that has these components: -Transformation -Visual Imagine that these components can nest: If I have a parent transformation component, a child transformation relies on the ...
1
vote
0answers
59 views

Strategy for abstracting rendering from draw surface

This question might be a little vague because I don't know how to do this myself and I might be asking something rather silly. So here we go. Up to now, when I did my personal graphics code I used ...
1
vote
1answer
393 views

Should I create a Lua wrapper classes for my C++ classes, or should I bind them directly?

I have a fairly standard architecture like this: GameObjects have Transform, and can have ...
1
vote
1answer
767 views

Game logic in mvc: model or controller?

Sorry if the title is too broad, I'll try to explain this in a more specific way down here. We need to create a board-game in Java for an University project and we have to use the mvc pattern for it. ...

1 3 4 5 6 7 25