Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

17
votes
7answers
4k views

Why is it bad to hard-code content?

I know most games store dialogue text in files, but I've also seen a few text-based games actually program the content (map, choices, possible player commands, story text) into the game code. I can ...
31
votes
7answers
4k views

How can I avoid having many singletons in my game architecture?

I use cocos2d-x game engine for creating games. The engine already uses many singletons. If someone used it, then they should be familiar with some of them: Director SimpleAudioEngine ...
5
votes
2answers
342 views

Running multiple box2D world objects on a server

I'm creating a multiplayer game using LibGdx (with Box2d) and Kryonet. Since this is the first time I work on multiplayer games, I read a bit about server - client implementations, and it turns out ...
0
votes
0answers
29 views

Organization of world/eye/clip bounding volumes for ray picking

I currently have objects defined in world coordinates and also other "overlay" type objects defined in eye or clip space. I want to be able to select objects (ray picking) from both the overlay or ...
0
votes
3answers
96 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 ...
0
votes
1answer
24 views

Why can't I reference a sprite loading variable in a separate class?

When I reference a sprite I declared in a separate class that I am using to load images and rectangles, I get an error. Here's how I reference the image in the render method: ...
0
votes
0answers
33 views

Architecture of real time browser mmo game [closed]

I'm currently working on an MMO strategy web-based video game. Something like an Ogame with a tactical map (where you can travel, pillage other players, etc.) and in real time. That is, a game with a ...
0
votes
1answer
70 views

Communication pattern in Entity Component System

I'm putting together a ECS for my game with another two main components: an event bus for communication and a Lua interpreter to load scripts. Now, the parent element is a framework/game object with ...
5
votes
1answer
215 views

Is it a bad idea to couple action and animation?

I'm making an ARPG (like Legend of Zelda but with more action), and this question raised during the development: Should action and animation be coupled? Or should they be independent? With this I ...
0
votes
1answer
109 views

Handling player and AI in a component based structure dynamically?

I'm trying to find a way to allow both input and AI to call actions of an actor in a component based structure for a 2d turn based game. The actions make use of the components. To keep the system ...
4
votes
3answers
818 views

Question about separating game core engine from game graphics engine

Suppose I have a SquareObject class, which implements IDrawable, an interface which contains the method void Draw(). I want to separate drawing logic itself from the game core engine. My main idea ...
3
votes
4answers
115 views

Architecture design in “buff-heavy” game? [duplicate]

I've been trying to wrap my head around this architectural design problem. Think of a game that has lots of spells and buffs (World of Warcraft, Diablo II etc), i.e. spells may cause buffs on ...
0
votes
0answers
25 views

Comparing type's in C++ [migrated]

I'm working on a custom engine where I have 2 different transform classes, one for 2D and one for 3D. I'm using a #define to choose which transform class to use and using that definition instead of ...
0
votes
1answer
60 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 ...
4
votes
3answers
384 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 ...
1
vote
1answer
68 views

how to store game state for a multiplayer board game eg. poker

First Approach: Store the state in database and play with database queries. Could a database handle the load, as poker is quite fast paced, and I have to query/update database for each player move. ...
4
votes
1answer
189 views

Game Architecture and Separation of Concerns

I'm trying to build a "simple" Tetris game, but I want to have enough flexibility to add a few things: The game can be played by a human, or (if the human presses a certain key) an AI is swapped in. ...
0
votes
0answers
26 views

High-Performance Concurrent Model-View Rendering Architecture [migrated]

I have a single-threaded file indexing/scanning engine in D I want to extend with a view thread that visualizes the scanned content as a tree (or later force-directed graph). I want this solution to ...
0
votes
2answers
97 views

Manage game objects depending on visibility [closed]

I'm trying to create an adventure game in 2D and I'm thinking about map management/objects. Here is what I've got in mind in terms of modelling: Now, I would like to create entities based on ...
-1
votes
0answers
43 views

What do most MMO network architextures use a front end server to sort the messages and send them onward to the correct server?

If for example 2 players are in zone3.. players 1 casts a fireball towards the direction of player 2.. Why should this message be sent to the frontend server for sorting when we can just send it ...
7
votes
2answers
852 views

How many OpenGL programs should I use to render multiple objects?

My scene has multiple objects in it. (Let's say 3 cubes, 1 cylinder, 8 spheres.) I assume I should create a vertex shader for each. How many programs should I have? Alternatives: One program per ...
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
110 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
30 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
182 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 ...
5
votes
1answer
134 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
180 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 ...
0
votes
2answers
175 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
29 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
144 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
90 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
108 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
233 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
404 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
151 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
89 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
188 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
127 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
160 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
148 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
109 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
120 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
150 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
49 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
224 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 ...