Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

1
vote
5answers
2k views

Entity System creating Components

Over every entity system I see implemented in C++, or even in Java/C# (e.g. the Artemis framework). I see components not allocated via a new operator (or something similar, e.g. std::make_shared). For ...
4
votes
1answer
94 views

Utility of submesh class in a 3d game engine?

I've read somewhere that we use sub mesh for being able to give different materials to one mesh. But why not simply do this with scenegraph ? I mean you have a car mesh, and instead of using ...
0
votes
1answer
56 views

Proper way for Player object to communicate with Map object?

I'm writing my first game (in javascript / node over websockets) and am running into a bit of chicken and egg problem, and am afraid how I'm doing it right now won't scale once the game gets more ...
-1
votes
0answers
51 views

I'm developing a Component-Entity game engine and could use some guidance/opinions on design [closed]

After writing this... it's a bit of me thinking out loud, so I know it's a poor question, but I'm struggling with anxiety, and being uncertain about how to do things puts a lot of strain on me, often ...
0
votes
1answer
27 views

Retrieving snapshots of game statistics

What is a good architecture for storing game statistics, so that I can retrieve snapshots of it at various moments? Say I have a game, and the user's statistics initially are: { hours_played = 0, ...
7
votes
3answers
171 views

How to load stacking chunks on the fly?

I'm currently working on an infinite world, mostly inspired by minecraft. A Chunk consists of 16x16x16 blocks. A block(cube) is 1x1x1. This runs very smoothly with a ViewRange of 12 Chunks (12x16) ...
2
votes
1answer
1k views

Making efficeint voxel engines using “chunks”

Concept I'm currently looking in to how voxel engines work with a view to possibly making one myself. I see a lot of stuff like this ... ...
13
votes
2answers
3k views

What is the standard C# / Windows Forms game loop?

When writing a game in C# that uses plain-old Windows Forms and some graphics API wrapper like SlimDX or OpenTK, how should the main game loop be structured? A canonical Windows Forms application has ...
0
votes
1answer
44 views

Server Side : How to manage “delay” action/event like attacking?

at the moment I'm writing a game server, so I made an event "handler". I mean, if a player send to the server "I move" it fire a function, so I think I'm doing well at the moment. But there's a ...
5
votes
1answer
117 views

Is there a good alternative to a world state data structure?

How do you avoid one big data structure containing all the current world state ? Let's pretend we're in a real-time strategy game, how would you code a skill that decrease mana of units around it ? ...
5
votes
1answer
159 views

City/Nation Builder - Unlocking game elements over time

Current Git (Needs more documentation) Current working prototype to play with (Git code is after a BIG refactor) Background: I'm making a javascript text city/nation builder along the lines of A ...
3
votes
1answer
299 views

Entity Component System for HUD and GUI

This is a very rough sketch of how I currently have things designed. It should, at least, give an idea of how my ECS is currently designed. If you notice in that diagram, I have basically split ...
0
votes
2answers
153 views

UDP Netcode Architecture for Fighting Game

I am programming a fighting game that uses a UDP client/server architecture for multiplayer. The server can handle multiple clients, two of which (or one being the server) are playing and the rest are ...
19
votes
4answers
3k views

“The Game Object” - and component-based design

I've been working on some hobby projects the last 3-4 years. Just simple 2d and 3d games. But lately I have started a bigger project. Soo in the last couple of months I've been trying to design a game ...
0
votes
2answers
28 views

GameLogic Model as Property or Constants with lookup in other Models?

Basically imagine a game where the Player has a Weapon which has a BulletType/type of Bullet. Now Player, Weapon and Bullet are Models having properties and they would represent Instances in the ...
1
vote
1answer
121 views

Sever Structure for a Turn Based Game (Chess) [closed]

I am working on a Turn-based Game (Chess) I have done the client part and single player mode so AI is no problem here. But the only problem is now I want to make my project multiplayer. I have done ...
2
votes
2answers
87 views

How can I manage complicated visual state over a simple model in puzzle games?

I've been encountering this design challenge making a few toys with Javascript (CreateJS, EaselJS) The scenario is that you've got some sort of puzzle game with a simple game model. For a simple ...
2
votes
1answer
101 views

What types of matrices are needed for game and graphics programming?

I am writing a 3D math library for general game development and want to know what type of Matrix classes I should include. Is just a 4x4 matrix enough, or must I provide 3x4 and dedicated rotational ...
2
votes
2answers
228 views

Expandable 2d environment by spawning and controlling individual tiles

what is the best way to implement an environment that is "expandable" in every direction so that when the player moves in any direction a new row or column of tiles that can be manipulated ...
6
votes
1answer
399 views

User vs Player Model

A lot of the online games out there have this concept of "User" or "Profile", and the concept of "Player". The "User" has username, password, lifetime stats, ... etc. The player concept is per game ...
1
vote
1answer
130 views

How should I structure my code to add enemies?

So I am currently making a 1942-style game in Sprite Kit. I've reached the point where I am finished implementing pretty much everything (movement, shooting (also recognizing a hit and exploding an ...
2
votes
2answers
79 views

Decoupling the entity from whatever controls it

In a lot of games the player can choose whether an entity will be controlled by the AI or by the player. For example in the game Little Fighter 2, the player can choose how many of a maximum of 8 ...
6
votes
3answers
158 views

Game AI Implementation

I'm very new to game development, but an experienced software engineer. As an introduction to game dev, I'm making a 2D zombie game in Python, using pygame. The game is almost done, but I still have ...
2
votes
1answer
116 views

What is missing from SDL for it to gain more widespread adoption? [closed]

As I understand, SDL offers abstractions that let you make windows, handle input and audio much easier than doing so directly with the low level APIs provided by several operating systems. However, ...
1
vote
1answer
151 views

How should I implement the “Observer” pattern with respect to a game world?

I'm thinking of ways to implement the Observer pattern in a game I'm developing at the moment. I can have a Game World (local map) with Game Objects (player, NPCs, monsters etc...) inside of it. Other ...
4
votes
2answers
2k views

Use a SQL Database for a Desktop Game

Developing a Game Engine I am planning a computer game and its engine. There will be a 3 dimensional world with first person view and it will be single player for now. The programming language is C++ ...
3
votes
1answer
142 views

game mod security question

So I'm in the process of building a game in C++ for the engine and Python for behavior and moddability. One of the planned major features is that when the game client connects to a game server with ...
1
vote
1answer
102 views

Game Engine Entity/Component with Services Architecture

I'm currently working on my first game engine and decided to use the entity/component model with services. Background: My GameEngine class is an Entity and has multiple services that are Components, ...
1
vote
2answers
116 views

Is it acceptable to mix simple physics logic with gameplay logic?

In my 2D game I have a PhysicsEngine class. It currently does two things: Called every frame to apply global forces on all entities (e.g. gravity). Called by the CollisionDetector to do the physics ...
2
votes
3answers
2k views

Entity System with C++

I'm working on a game engine using the Entity System and I have some questions. How I see Entity System : Components : A class with attributs, set and get. Sprite Physicbody SpaceShip ... System ...
0
votes
2answers
146 views

Driver inversion

I have a GUI game, which is driven by user every time it clicks the mouse. Every time user clicks a square on a board, the board state is updated (we re-compute the score, the player to make next move ...
0
votes
1answer
46 views

How can I avoid type checking in the physics side of collision handling?

I have a class responsible for handling the physics side of collisions. When the collision detector spots a collision, it notifies both entities in the collision to take care of gameplay. It also ...
1
vote
2answers
215 views

Where should I put my game loop?

I've seen some tutorials on programming a good game loop, but none mention where (in the game code) I should call it. My guess is I should call it from the main() method. Am I right? Is there another ...
4
votes
1answer
182 views

How are game menus logically structured?

I've been struggling with making a game menu system in Unity for some time now. I spent time developing a way to help myself understand how game menus are connected together. Right now, I'm calling it ...
3
votes
1answer
193 views

How and when to choose which objects to run collision tests on?

This might be problem with plenty of good solutions, but it's all not very clear to me, so I though I could ask and probably get some good hints. I'm having trouble figuring out how to handle ...
3
votes
2answers
102 views

Should entities store other other entities that they spawned?

How should a game entity add another game entity to the game world? For example, an entity shooting a missile (which is another entity), means the new Missile will need to be added to the entities ...
0
votes
2answers
114 views

Without using a pre-built physics engine, how can I implement 3-D collision detection from scratch? [closed]

I want to tackle some basic 3-D collision detection and was wondering how engines handle this and give you a pretty interface and make it so easy ... I want to do it all myself, however. 2-D ...
8
votes
8answers
2k views

Best resources to learn Game Development from a Java background? [closed]

I'm an enterprise Java programmer, however something I've been interested in and what got me into the whole programming thing was the idea of being able to create a game. Just wondering if anybody ...
5
votes
2answers
222 views

Pure functional programming and game state

Is there a common technique to handle state (in general) in a functional programming language? There are solutions in every (functional) programming language to handle global state, but I want to ...
1
vote
2answers
129 views

Best way to store a large amount of game objects and update the ones onscreen

Good afternoon guys! I'm a young beginner game developer working on my first large scale game project and I've run into a situation where I'm not quite sure what the best solution may be (if there is ...
1
vote
1answer
88 views

Implementing movement on a grid

I have a simple snake game, where I have other NPC snakes on the field. How do I calculate the movement of those other snakes so that they did not hit walls, and each other? So far I have it like ...
4
votes
2answers
1k views

Why does my turn-based game loop allow the enemy to act repeatedly?

I'm trying to create a turn-based game in pyGame but hit a wall when trying to properly handle the main game loop. So I have something like this: def loop(self): while self.stategame==1: ...
6
votes
4answers
4k views

Object-Oriented OpenGL

I have been using OpenGL for a while and have read a large number of tutorials. Aside from the fact that a lot of them still use the fixed pipeline, they usually throw all the initialisation, state ...
0
votes
1answer
89 views

How to store and use different AI behaviours

I'm coding a space shooter on three.js (WebGL) and since the game I'm doing is rather simple, plus I want to keep controll of the structure, I'm not using a game engine. I'm using oop classes and ...
1
vote
1answer
152 views

How do I implement space partitioning in entity component system?

My systems work on components without needing to now anything about entities. I want to implement simple grid partitioning, so each entity will be given a cell based on its current position. But how ...
3
votes
1answer
267 views

storing user data for rpg

I'm creating a single player Web rpg that will store a decent amount of information about the player, items, map, npcs, etc. I have been developing html5, javascript, php, and the mysql database ...
17
votes
4answers
4k views

Resource Managers - Are they any good?

I've seen many a time in source code, things like this [well, this is more of a pseudo C++ idea of mine] typedef shared_ptr<Resource> ResourcePtr;// for ease ResourcePtr sound1 = ...
1
vote
0answers
123 views

Abstracting Game Logic from Game Engine [closed]

I've seen that the Quake 3 Engines uses QVMs and DLLs for the gamelogic. Unity uses some kind of Component-Entity system. My question is basicly: What's a good way to keep the engine seperated from ...
4
votes
1answer
705 views

How to edit key-value pairs (like a Dictionary) in Unity's inspector?

I have a spell system I am creating, the principle is as follows: Each spell is an autonomous prefab. It contains a script with some properties (base damage, duration...) that can be modified in the ...
2
votes
1answer
63 views

Mixing old and new state of game objects?

If I have a group of game objects that are being updated each frame, and some of them query each others data like position and such, is it common practice to not care that a game object might get ...