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
1answer
109 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
90 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
868 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
109 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
175 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
71 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
994 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
363 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
1k 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
176 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
226 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
50 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
76 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
695 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
113 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
737 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
190 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
389 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
483 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
337 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
57 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
356 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
703 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
vote
1answer
54 views

Handling different renderers Y axis direction in a single engine

I have an engine that uses either three.js (3D WebGL rendering library) or pixi.js (2D rendering library) depending on the game. ...
0
votes
1answer
99 views

What is the optimal way to store customisation options?

I am trying to understand the most optimal way of storing customisation options within a game, or to be precise, to store all the possible customisation options for multiple different objects. For ...
1
vote
1answer
189 views

How do I avoid big switches in my message system?

I've been implementing a message system for my small engine, and I have started to think about optimizing and maintaining it. Right now, my message class looks like this (at its simplest - only member ...
0
votes
1answer
51 views

Changing the current state of an entity in the middle of an update step or wait for the end?

Let's say that I use a behaviour component that holds a function call to be called every update step assigned to an entity. Inside that function call I'm changing the active state for the entity to ...
0
votes
1answer
194 views

Three levels deep composition (player<-character<-spell), with preset character+skill sets

So I'm creating a rather generic strategy game similar to Warcraft or League of Legends, which needs to have: a Player class for representing the users playing the ...
5
votes
4answers
780 views

What is the best approach for networking a basic HTML5 pong game?

I'm working on the design of a basic multiplayer HTML5 pong game, and I have a very basic question about architecture. The implied physics is very basic, and the movements are not a problem. The ...
4
votes
3answers
229 views

Issues with events changing game state

I am currently experimenting with creating a turn based game using Unity and am trying to come up with a sensible architecture for structuring my game systems. So far I have decided to base ...
3
votes
1answer
428 views

2D Tile Engine Architecture

I'm been working on a 2D tile game (sidescroller perspective) and I decided to rework my tile engine. Right now I store a new tile instance per block in the world (so there are like 1000 TileStone ...
2
votes
0answers
50 views

With what structure do you manage the graphics of a game? [duplicate]

Im currently trying to program a little game (in Java - Libgdx; if thats necessary). I currently use a GameWorld and a ...
1
vote
0answers
62 views

How to implement mutable functionality at runtime? [duplicate]

I am making a game in which the player character can gain traits that change how their character behaves in my world model or add functionality to it. For example, the character might gain the "...
0
votes
3answers
116 views

how to make client and server to develop independently?

Currently, all i want to do is rapid prototyping of Tower-Defense-Like game, which means that i just need write client code only,single player, play with AI system. but shortly afterwards, maybe it's ...
5
votes
1answer
3k views

A more data oriented design approach to Entity Component System game engine

I'm creating my first c++ game engine project (for learning purposes) and in it I've attempted to implement an entity/component system utilizing some data oriented design principles while also not ...
-1
votes
1answer
104 views

Clean code structure for dynamically rendering strings & numbers

I am currently working on the rendering aspect of my game. The code is currently organized in this manner: Classes: G_Texture: ...
0
votes
2answers
153 views

What is the best (or a good) approach to “code” difficult level

I've to decide how to code enemy spawn: quantity and time. What's a good approach to do that ? Maybe a class like this ? ...
-1
votes
2answers
100 views

How to solve this component based events response issue?

I'm working on a new game architecture and I have issues with the handling of events in our component-based approach. We have a component Match. When a match ends, an event Match_end is sent. There ...
1
vote
1answer
360 views

Semi-procedural mission generation

I want to generate missions out of more or less predefined smaller chunks. Example mission structure: Mission type: Rescue Travel through forest Gather intel Choice: Sneak into castle (if it fails, ...
2
votes
5answers
167 views

Most efficient way of communication between “unfamiliar” game objects?

Title could look vague, so here's what I actually mean. Three groups of people are walking in the city. These are Guards, Thieves and Citizens. Something has happened in the city, Thief have stolen a ...
46
votes
4answers
12k views

How can I avoid giant player classes?

There is almost always a player class in a game. The player can generally do a lot in the game which means for me this class ends up being huge with a ton of variables to support each piece of ...
1
vote
1answer
1k views

Game Loop delay the right way and game speed

I am a newbie game developer. I am trying to find a right way to create my game loop. Consider following example. Simple Android Game I have a game with a simple gameplay - bouncing ball. I want ...
0
votes
1answer
203 views

Best way to manage thousands of objects in an multiplayer online game? [closed]

I'm currently planning to develop a real-time multiplayer online game, using the Google Maps API on Android. I thought about having survival-like game play, where you collect resources to build ...
2
votes
1answer
806 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 ...
6
votes
2answers
2k views

Entity-Component-System data storage design

I'm working on an ECS and I've already read a lot of articles about it. Most of these articles are talking about a simple case (store data contiguously, read it in a single for loop). However the real ...
2
votes
2answers
1k views

Component oriented programming for rich RPG world

I've asked this question on several forums but didn't get the proper answer yet. So, in my opinion, it is a really theoritical and deep, but I really can't deal with it by myself. What is my goal? ...
0
votes
2answers
67 views

Recreate UI or move it out of view?

Which method would be best? What are the pros and cons? For example, if I have a main menu screen, I can easily start my game loop right as the user presses 'Start'. Which would be better, moving the '...
2
votes
0answers
484 views

OpenGL back/front end threading and Doom 3 BFG engine

Introduction I have been reading through the source code of id Software's Doom 3 BFG engine. The whole codebase is on GitHub at id-Software/DOOM-3-BFG. The architecture is both clean and elegant. The ...