Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

8
votes
1answer
121 views
+50

How would a game-state snapshot system be implemented for networked real-time games?

I want to create a simple client-server real-time multiplayer game as a project for my networking class. I've read a lot about real-time multiplayer network models and I understand the relationships ...
0
votes
2answers
91 views

How to hit an enemy, or “how do entities interact with each other?”

The title might be a tad simple for the purpose, but bear with me. I'm a tad lost about how to do the interaction between game objects. I use an entity-component-system framework and I've got the ...
0
votes
0answers
12 views

Node IPC Sibling Processes Communication [migrated]

Assume the following architecture context: +-----------------------------+ Lobby Server Starts ...
91
votes
9answers
11k views

Entity communication: Message queue vs Publish/Subscribe vs Signal/Slots

How do game engine entities communicate? Two use cases: How would entity_A send a take-damage message to entity_B? How would entity_A query entity_B's HP? Here's what I've encountered so far: ...
0
votes
1answer
45 views

How to create sandbox game [on hold]

I have a lot of experience with programming but I'm new in game development world, so I don't know what I don't know. I want to create a MMORPG sandbox game. When I say sandbox game I have something ...
2
votes
1answer
79 views

How can I architect my game tools to allow for easy extension?

In the code for the toolkit for my game, I have a concept I've been calling "contexts." Each context refers to, essentially, different tools (SelectionContext, DrawTerrainContext, et cetera) and ...
-1
votes
3answers
449 views

adventure game architecture

I would like to make an adventure type game functioning similarly to machinarium or broken sword. The only way I can think of doing this is to draw an image as a background on a canvas and use some ...
6
votes
4answers
607 views

Why should I use separate initialization and clean up methods instead of putting logic in the constructor and destructor for engine components?

I'm working on my own game engine and I am currently designing my managers. And I've read that for memory management using Init() and CleanUp() functions are better then using Constructors and ...
1
vote
2answers
64 views

Implementing monte-carlo tree search in a tile based game with units

I have this simple risk-like game I would like to develop an AI for. Players move their Units on the map and a simple fight resolution is done. There is a time constraint of 100ms for each round, the ...
0
votes
1answer
66 views

Render system should know entity manager?

in an ecs based game architecture, I think the entity manager is a "high-level" system, and the render system a "low-level" system. When I move my entity (that means I edit the position component of ...
14
votes
4answers
2k views

Should a socket server and game server be separate processes?

Assume a simple standard client/server game. For the server, is it worthwhile to have a separate process that listens for connections and messages from clients and sends the data via local sockets or ...
0
votes
3answers
190 views

Entity Component Architecture and Scripting without using threads

I am working on a small game engine for practicing purpose and also for putting some of my ideas into action. What I have so far is a couple of systems for rendering, sound etc. The next step is to ...
1
vote
1answer
56 views

Where should I put the SDL_Renderer* using the ECS with SDL2 and C++?

So I'm still learning about ECS (Entity Component System) and whenever I'm thinking about the architecture and actual implementation, I just can't figure out where should I put the SDL_Renderer*. So ...
8
votes
1answer
239 views

Implementing a Graph-Based Material System?

I'm trying to wrap my head around how material systems like this, this are implemented. These powerful and user-friendly, graph-like systems seem to be relatively common as a method of allowing ...
53
votes
8answers
19k views

Why don't more games use vector art?

It would seem to me that vector art is more efficient in terms of resources/scalability; however, in most cases I have seen artists using bitmap/rasterized art. Is this a limitation put on the artists ...
3
votes
4answers
707 views

How do I prevent memory-modification cheats?

There are many memory-altering programs out there nowadays (Cheat Engine & co). Is there an efficient way to keep a constant variable actually constant? I had two ideas: Make a separate thread ...
2
votes
1answer
120 views

Modular enemy behaviour in a shmup - Delegates unsuitable?

I'm creating a shmup type game and trying to implement the enemy wave system, which includes the associated enemy behaviours like their movement and bullet patterns. I've tried to separate the ...
0
votes
1answer
58 views

Modeling object oriented snakes and ladders

I'm trying to create a basic clone of Snakes and Ladders using object oriented design. I'm struggling to model my objects and their relationships. For the time being I'm interested in moving players ...
13
votes
2answers
3k views

Implementing a camera / viewport to a 2D game

What is the most practical way to implement camera/viewport to a 2D-game? I've read, that I should store the object world position instead of position relative to the screen? Current situation: I ...
-1
votes
1answer
258 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 ...
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
38 views

Class design for a risk-like game [closed]

I'm currently coding a AI for a risk-like game, but I'm not sure how I put even the base classes together. I've read a lot about game design patterns, entity component designs and such, but I've ...
118
votes
8answers
23k views

Why are MVC & TDD not employed more in game architecture? [closed]

I will preface this by saying I haven't looked a huge amount of game source, nor built much in the way of games. But coming from trying to employ 'enterprise' coding practices in web apps, looking at ...
5
votes
2answers
1k views

Should I use inheritance or composition for modelling game objects?

In terms of game engine modeling, please give your pros and cons for two types of interfacing: class MySceneObject_Model1 : public IRenderable, public IScriptable, public IAnimatable { ... } class ...
10
votes
3answers
448 views

Why aren't more games 64-bit executables? [closed]

Until now I've seen that many games are still compiled in 32-bit architecture although nearly 50% of current Windows users are on 64-bit OS? Why is this? If the reason is for getting larger audience ...
0
votes
0answers
33 views

How can I trick or see how the source engine knows if the process is in focus or not.

The source engine does not support split screen so I am trying to run two borderless windows side by side but the source engine automatically limits the cpu utilization of any window not in focus. Any ...
0
votes
2answers
116 views

Avoiding singletons for puzzle system [closed]

Say for instance I have a puzzle with 3 switches that need to be in some configuration (say all on) in one room, that opens a door in another, with a load screen separating, so I can't link the ...
1
vote
1answer
60 views

How can I stop explodable objects from creating new ones during cleanup?

I have a problem with the handling of explosions in my game. Currently, I have an entity create an explosion when it is destroyed (in the destructor). The issue with this is that when I change ...
10
votes
5answers
1k views

Should beginning/indie game developers target multiple platforms initially?

Partially as a response to How do game developers target multiple platforms (Xbox 360, PS3, PC and Linux)? but mainly because there are people on here with published games, should cross platform be ...
2
votes
1answer
163 views

How can I access a script variable from another script in Unity?

I'm creating a space shooter (think Space Invaders or Galaga) where the GameManager persists between scenes but the player and enemies don't. I need to access a boolean value from the player and ...
0
votes
0answers
61 views

Data structure to store map layers in each Tile while keeping the order of terrain, items and monsters intact

My game represents its map as a 2D array of tiles, each of which stores a stack of layers. I'm looking for a data structure to efficiently represent this . I want to be able to add layers ...
3
votes
5answers
283 views

Is it bad practise to have an object for every tile?

In the game I am working on, many of my tiles must have special attributes (such as triggers when the player steps on them). I was wondering if it would be bad practise to create an object for every ...
5
votes
3answers
476 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
181 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 ...
37
votes
9answers
11k 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 ...
1
vote
1answer
112 views

Best Practices for combining animation and logic

In Games I often run into this kind of scenario: The Game Logic decides something happens, and of course the logic does so instantly. But the Game also has animations depending on the logic. Like ...
2
votes
2answers
234 views

MMO Client / Server Architecture (NoSQL)

The main aim is to keep the games variables server-side for obvious security reasons. I believe having server-side code to check before updating the games database values will protect me from classic ...
1
vote
1answer
110 views

Where to put graphic representation of game entity?

I am working on simple 3D version of Snake game. I created classes like snake and grid so far. My concern is, putting all render logic (draws cubes - to show snake, and lines to show the grid) in ...
40
votes
8answers
7k 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
420 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
51 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
112 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
1answer
43 views

Why can't I reference a sprite loading variable in a separate class? [on hold]

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: ...
6
votes
1answer
262 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 ...
4
votes
3answers
853 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
140 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
1answer
69 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
108 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
218 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
2answers
100 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 ...