Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

2
votes
1answer
50 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
47 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 ...
1
vote
0answers
31 views

Snapshot data architecture 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 ...
1
vote
1answer
37 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
2answers
73 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
1answer
34 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 ...
0
votes
0answers
31 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
3answers
145 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
58 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 ...
0
votes
2answers
112 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 ...
2
votes
1answer
100 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
49 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
269 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 ...
1
vote
1answer
102 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 ...
1
vote
2answers
167 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
106 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 ...
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 ...
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 ...
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
1answer
38 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
1answer
210 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 ...
6
votes
1answer
259 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
2answers
173 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 ...
3
votes
4answers
138 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 ...
1
vote
1answer
101 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
211 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
98 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 ...
7
votes
2answers
1k 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 ...
4
votes
1answer
126 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
32 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, ...
5
votes
1answer
144 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
206 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 ...
7
votes
3answers
196 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) ...
0
votes
2answers
215 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 ...
0
votes
2answers
33 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
219 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 ...
0
votes
3answers
106 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 ...
2
votes
1answer
118 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 ...
7
votes
1answer
413 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
182 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
102 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 ...
2
votes
1answer
140 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
63 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
182 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
124 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
153 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
206 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
123 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
97 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
51 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 ...