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

learn more… | top users | synonyms (2)

0
votes
0answers
28 views

std::vector clears after every frame? [on hold]

I execute the following code each frame std::vector<DataType>& data = bigData->moreData[i]->evenMoreData[j]->data; Why does the vector get destructed after I finished drawing the ...
0
votes
1answer
35 views

Entity-components pattern and memory management

I indent to use a level-entity-components hierarchy in my c++ game engine where level is just a placeholder for entities. However, since I'd like to setup all the levels at once (and thus entities and ...
0
votes
0answers
16 views

Stack, list or array for screen/state management. (XNA/MonoGame) [on hold]

I am wondering the best approach to manage game state in monogame. My first thought is have a screen class and keep them in a collection with either isFocused properties or use like a stack and the ...
3
votes
0answers
72 views

Tick frame: update order problems

Sorry, it's a bit long story but I hope you can help me. First of all: I have an entity class called SceneObject. The SceneObject has components (eg. RenderableMesh, Camera) and transformation data ...
0
votes
1answer
50 views

Targeting logic for 100.000 units army

I am making an army fight for my website armyfight. There can be fights of hundreds of thousands units. I am looking for better unit targeting. in jsfiddle is an example. var enemy = { 2: { ...
0
votes
0answers
20 views

Platformer command queue - not sure how to proceed

While trying to figure out how to implement platform agnostic input handling for a platformer, I've discovered the command pattern and I liked the idea so I wanted to take it a step further. I got ...
3
votes
1answer
51 views

Ability/Skill Data and Method Structure (C#, Unity3D)

So I've come to design my game which players will be having a unique set of skill or ability to come with. I can store skill name, mana cost, cooldown, etc in database which each skill have in common, ...
0
votes
2answers
119 views

TCG Board Architecture

While I was, sort of, studying the various TCGs around, concepts, similarities, differences and how they could be implemented, if designed to be in a virtual environment (e.g. PC game) I obviously ...
6
votes
0answers
196 views

Entity component system - game progression

I'm quite new to game development (but not to programming) and I'm trying to figure out what would be the best way to handle inter-world communication. What I mean is this: I've been reading about ...
0
votes
0answers
34 views

How to handle rooms in a lobby based MMO server architecture?

I'm planning to develop a room based MMO server for an HTML 5 game. The architecture is easy to figure out how to handle things when the server is a whole, and not seperated to rooms. But I can't ...
1
vote
0answers
44 views

When NOT to use ECS architecture? [closed]

I'm familiar with the notion of entity-component-system architecture, and its advantages over traditional class trees. That being said, are there scenarios where one wouldn't want to use ...
2
votes
0answers
51 views

How can I connect multiple explorable regions into one large map?

I am planning a 2-D science fiction game involving spaceships. A major thing that I am having trouble figuring out is how to create a 2-d array of smaller maps that the player can explore. My ...
2
votes
0answers
33 views

Moving Draw functions out of GameObjects

This is basically the issue as in Tactics for moving the render logic out of the GameObject class with the topic already discussed here and here However I'm not really satisfied with the given ...
0
votes
0answers
28 views

NodeJS timed update approach

My game has users building buildings, recruiting units, trading resources and sending attacks. All of this functionality takes a certain amount of time to happen and I'd like help with deciding on the ...
1
vote
1answer
42 views

game server - fault tolerant

If you have for example an MMO with 2000 players, and players are constantly removing / creating / swapping items (and doing some other important things that can't be lost). If the updates are saved ...
0
votes
1answer
61 views

Is window creation decoupled from game engine?

I'm new to game development, and I was wondering about a architecture question. The window creation code in C++ is given by doing the following: Fill out a WNDCLASS struct Register the window class ...
1
vote
1answer
36 views

How can I reduce writes-per-second when saving player data to a database?

Consider a game where the player has some profile or save data stored in a database. What I want to understand is, for things that effect the users score or level, there could be so many factors that ...
1
vote
0answers
31 views

How could I achieve an iOS high detailed level design for a platformer?

I'm seeing a lot of games that use a predefined and repeating set of tiles for their level (like FlappyBird or the Super Mario game series). I'm a graphics designer so I would like to create levels ...
0
votes
1answer
54 views

How to desing an RPG system with regard to PVP [closed]

When you design a RPG system focused on PVE, one usually goes "mob of level X has Y hp and Z damage". How about when we do PVP with multiple classes? Lets say we go Diablo, so we have ...
0
votes
0answers
36 views

What are the benefits of decoupling the input system from the gameplay system?

I want to decouple as many systems as possible from the main loop. Probably the most beneficial would be to decouple the renderer and the gameplay system. But I am wondering about what I should do ...
0
votes
2answers
123 views

Backend for data-driven multiplayer game

I am working on a match-based (5v5) multiplayer steam game that is similar to TF2, LoL, Dota 2, etc. I am planning a data-driven approach where character/abilities/items/etc are defined in data ...
0
votes
1answer
92 views

How should my engine Identify objects

I'm making a fairly basic openGL 3D engine, at the moment, when you load an object, you would write manager->LoadObjFile("cube.obj"); manager->AddParent("uvmap.bmp", "cube.obj", "cube", ...
3
votes
2answers
100 views

Designing ability interaction system

I am making a turn based game where player chooses a team of heroes with specific abilities for each of them. (ex. stun one enemy, deal 20 damage to all enemies, heal 10 HP to one ally,...) The design ...
0
votes
1answer
54 views

What is the exact difference between the game and game engine? [duplicate]

I thought game engine are something like Unity or Unreal. They have a editor with scene editor, some Physics library, some scripting editor and tools to improve the workflow of developer. Furthermore, ...
18
votes
11answers
4k 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 ...
0
votes
0answers
33 views

what is an elegant way to add a border to a hexagonal grid

At the moment in my hexagonal map generator, I am working from the idea of generating the grid, doing some nasty conditional logic to check if grid position is within the scope of the border and ...
1
vote
1answer
130 views

How to implement specific custom events in an Event Condition Action (ECA) game system?

A while ago I implemented a simple event-condition-action system for my game trying to emulate the Warcaft 3 trigger system (in a small scale, of course): So far, it works fine, but there is ...
4
votes
4answers
191 views

How decoupled should game logic and rendering be?

From a data perspective, how decoupled should game logic and rendering be? How much does it have to know about each other? Take a look at the following example. I'm going to use javascript because ...
0
votes
1answer
43 views

How to efficiently organize different game zones with different functionality?

For now I have a list of basic data class like position in game world, dimensions, type and stuff like that, but since I am starting to implement their functionality it seems kind of a bad pattern, I ...
1
vote
1answer
62 views

Managing game states (states flow, controlling the state machine…)

I am currently struggling really bad to make the game states management. Before we dig into the problem, I must point out that I do know about state machines, I do have both implemented (states and ...
0
votes
0answers
32 views

Unity State machine behavior practice

I have few scripting design question regarding the SMB. I am excited to apply the state machine pattern after learning about it to my players and monsters alike and was so happy that SMB is exactly ...
3
votes
4answers
607 views

How do I deal with scale of the universe when generating a simulated universe?

I have a dataset of 100,000 actual stars. I wish to create a game where I can fly between the stars and fly up to them and click on them etc. How do I go about dealing with the problem of the scaling ...
0
votes
3answers
182 views

Correct architecture for weapon class in RPG

So, I'm a little stuck on what the best way to implement weapons is. The problem I'm running into is, what exactly is a weapon. I have a Player Class that has an attack method. public class ...
0
votes
0answers
51 views

What is the best way to represent a large field of objects while using minimal resources?

I have recently started to plan a project in Unity that will be for android. I have a database that consists of over 150,000 stars (may trim this down if I/O cripples the overhead). The game will ...
0
votes
0answers
40 views

Java - Component Based Architecture applied to Entities

I've recently been getting my game a lot more of functions for the entities: growing, IA, colours depending of season, position, magic, teleportation an d a lot more. The problem was that for ...
0
votes
0answers
149 views

Game loop architecture using WPF(MVVM) and C#

Could i get some suggestions on how to implement a game loop whilst using WPF(MVVM) and C#, I am a professional developer and understand the technology well. The game loop usually contains a Init(), ...
0
votes
1answer
49 views

Can Soomla directories be safely moved one directory down in Unity?

I'm integrating in-app purchases in my game. To do so, I chose to use Soomla (http:soom.la) asset. I use the free version registering for the grow bundle. I've downloaded a unitypackage named ...
16
votes
2answers
2k views

RTS game unit structure

I want a way to make a lot of different units without having to program stuff like moveTo and Attack actions more than once The way I see it, there are 2 ways I can do this. A single generic Unit ...
1
vote
1answer
114 views

Relation between game systems and components in a component-based architecture?

Based on a question I previously asked here regarding to decoupling input from other components of an entity I developed a small component architecture on top of XNA to understand how everything works ...
2
votes
1answer
262 views

Should I implement Entity Component System in all my projects?

I'm not here to ask for any specific code implementation, I'm here just to make my ideas clearer. But let me explain the situation: I have already developed some little and amatorial game projects ...
4
votes
2answers
344 views

Complex system-component dependencies in entity-component system?

I am trying to design a typical (data-oriented) ECS engine. The issue I am struggling with is that my rendering system have to rely on two different sets of entities to actually do rendering. My ...
0
votes
1answer
43 views

Storing player data for multiple players in libGDX

I'm working on a game (in libGDX) that would allow multiple player accounts. I need to store some simple user data (several key-value pairs). I think JSON is the best for my needs, but I'm wondering ...
2
votes
0answers
40 views

Strategies to make it difficult to cheat + easier to identify cheaters in Javascript/HTML5 game [duplicate]

I intend to have a Javascript/HTML5 game with a global leaderboard. I have devised a very simple system for submitting highscores as follow: When the game finishes, the game client makes a POST ...
0
votes
1answer
89 views

Organizing Setup(), Update() and Draw() function in a game engine

I'm creating my first game engine and I want help with organizing the Setup(), Update() and Draw() functions in the correct way. Here is how my main() function looks like /* BEGIN main() Function */ ...
3
votes
1answer
70 views

How to store renderer vertex / index data in scene graph objects?

I have a SceneNode class which contains a Mesh instance. The Mesh class stores client side information such as vertex and index arrays (before they're uploaded to the GPU). I also have an abstracted ...
3
votes
1answer
86 views

Ideal draw order - sort primarily by distance or material?

When it comes to pre-sorting the draw calls for a given frame, I am aware of two different methods for optimising. The first is to batch draw calls by their material. This minimises shader changes ...
3
votes
3answers
131 views

Is it a bad practice to add helper methods if the class is intended only for data? [closed]

For example, if I have something like: class ItemData { public int cost; public int level; ... public List<ItemData> childItems; } And I'm aiming to separate ...
1
vote
1answer
77 views

How do I structure AI that uses both Behavior Trees and Pathfinding?

Architecturally, what are the best practices for how these two concepts interact with each other? For instance, say I have an asteroids like game where the AI player must dodge floating asteroids ...
4
votes
1answer
742 views

When to use a blend tree vs state machine for animation

Im an experienced game dev hobbiest making my first game with 3d animated characters (in Unity) and am struggling to figure out when to use blend trees vs animation state machines. I understand both ...
1
vote
0answers
37 views

Help with building a platformer engine on top of cocos2d [closed]

I am a C# programmer making a transition to game programming and hence C++. I want to make a reusable platformer engine (for now I want to start small) on top of cocos2d/box2d to make prototyping of ...