Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

1
vote
1answer
78 views

Sever Structure for a Turn Based Game (Chess)

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 ...
0
votes
1answer
32 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
vote
1answer
88 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
0answers
61 views

How to plan a game project properly [on hold]

Nearly everything on this earth got accomplished once. The same thing counts obviously for developing a game. Since I just wrote a pacman in Java and my project wasn't that large, I don't know how to ...
4
votes
1answer
381 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
106 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
69 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 ...
1
vote
1answer
95 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, ...
0
votes
1answer
28 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 ...
1
vote
1answer
143 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 ...
1
vote
1answer
92 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, ...
3
votes
1answer
128 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 ...
6
votes
3answers
123 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 ...
1
vote
2answers
110 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
2answers
85 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 ...
0
votes
1answer
43 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
208 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
176 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
2answers
94 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 ...
3
votes
1answer
191 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 ...
0
votes
2answers
108 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 ...
0
votes
2answers
102 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
81 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: ...
0
votes
1answer
87 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
131 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
257 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 ...
1
vote
0answers
120 views

Abstracting Game Logic from Game Engine

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
456 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 ...
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 ...
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 ...
5
votes
2answers
183 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 ...
0
votes
0answers
20 views

Component systems: No inheritance hierarchy at all, or a basic one? [duplicate]

(I asked a similar question, but it had more questions inside it and I feel it wasn't clear enough, so I'm opening a new one). Until recently I implemented all my games using an inheritance ...
0
votes
2answers
168 views

Component based architecture: “pure” or some inheritance?

(I asked a similar question, but it had more questions inside it and I feel it wasn't clear enough, so I'm opening a new one). Until recently I implemented all my games using an inheritance ...
0
votes
0answers
21 views

How can I avoid duplication of jBox2D physics attributes?

I'm using jBox2D for physics and collision detection in a game engine with an entity-component system. It works, but I'm unsure how to structure my code with respect to the values represented in the ...
7
votes
3answers
223 views

How do AI agents access information about their environment?

This might be kind of a trivial question, but I am having trouble understanding this. Would very much appreciate your help. In game development using object oriented design, I want to understand how ...
2
votes
2answers
68 views

What is the advantage of wrapping D3D in a class versus a namespace?

Almost all the tutorials and books use a class wrapper for Direct3D. But I haven't found any scenario in which using more than one instance of Direct3D system (the "device" and state, et cetera) is ...
-1
votes
1answer
177 views

Distributed Multiplayer Game Server Architecture [closed]

I'm programming a multiplayer game for mobile phones.I'm working on a distributed server architecture for handling lots of concurrent players. Here is my architecture on my mind: Some questions ...
0
votes
2answers
136 views

Best practice for handling “dead” objects and their particles

I'm developing a side-scrolling run'n'gun game (but with planes! :P). I'm an experienced coder, but new to game development. When an enemy plane collides with a friendly missile, I start an explosion ...
0
votes
1answer
67 views

How are vertices determined complex geometries in an ever changing game state

For example say you wanted to draw a 3D cube you can define an array of hard coded vertices using float3, here is an example. http://msdn.microsoft.com/en-us/library/windows/desktop/jj552949.aspx But ...
6
votes
1answer
196 views

Optimize state changes within a render queue

I am refactoring some parts of the game engine I am working on. This engine is made in C# with XNA. The part I have trouble with is shader/material and the render queue. In the new version I will ...
13
votes
6answers
2k views

OOP architecture for Hero with many attributes

I'm about to start a simple browser text RPG, with characters that can (passively) fight other people. This involves a list of about 10 skills like strength, dexterity and so on, with additional ...
0
votes
1answer
103 views

When entities don't draw themselves, who actually does?

There are countless questions here about whether entities should draw themselves or not. The answer is almost universally no, there should be a renderer. And I do see a point in having a single place ...
3
votes
1answer
233 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 ...
5
votes
2answers
197 views

Is having a master builder object a bad idea?

I have wondered about using the following approach to creating Entity objects in a personal project. What I want is to be able to keep track of all Entity objects that get created, so whenever an ...
1
vote
2answers
137 views

Circular dependency when creating entities

I have the following problem: I have a a class called Stage, that keeps an list of entities, which it iterates over every update loop, and updates them. One of these entities might be a weapon (PEW ...
1
vote
1answer
587 views

How should I handle animation states in Mecanim?

I did a tutorial which associated an integer to each state and manually set transitions from one state to another based on that integer, but that seems really sloppy. Is there a more elegant way? I ...
2
votes
3answers
161 views

How do I implement Breakout's “multiball” powerup?

I'm just starting out and making a breakout clone as my first game. I'm implementing all kinds of powerups, but I'm stuck on multiball. The powerup adds additional bouncing balls to the game. So far, ...
0
votes
1answer
169 views

How to architect collision detection in SFML

I have a pretty simple game engine that I'm making for a 2d platformer game. I don't want it to be super advanced, but it does have some basic properties. Most important to this question is a class ...
2
votes
2answers
219 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 ...