Tagged Questions

Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

1
vote
1answer
91 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
90 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
184 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
288 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 ...
2
votes
0answers
136 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 ...
5
votes
1answer
2k 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
154 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
65 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
389 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
21 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
223 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
250 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
74 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
403 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
151 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
70 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 ...
7
votes
1answer
239 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
118 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 ...
4
votes
3answers
431 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
230 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
174 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
1k 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
177 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
200 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
236 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 ...
0
votes
1answer
145 views

Representing multi-tile objects in a tilemap

I'm building an isometric tiled game, where the terrain and objects are represented by a 2-dimensional array of lists. Depth of objects on the map is derived from the tile (and a per-tile sorting ...
0
votes
0answers
60 views

How can I position different size creatures in a group automaticly

I'm doing a game (in xna) on my free time, as I'm not in the game market, I'm pretty sure I'm missing something that would help me get this right. Think of Ogre Battle. A group of unit moves, and ...
2
votes
1answer
213 views

Why game loop should be running on a separate thread?

I am struggling to fully understand the responsiveness argument suggesting to run the game loop on a separate thread other than main thread. When OS sends a user event (touch, mouse move, etc.) it ...
2
votes
4answers
950 views

How to make a game without OOP? [closed]

I am currenty studying game development and practicing making games. I use a lot of OOP in my games. For example, each missile that is shot is an instance of a Missile object, and added to a list of ...
2
votes
2answers
134 views

Materials and Mesh association

I'm trying to implement a Material system in a small engine for training and I've got questions about materials. Currently I've got that: Material: A Material with array of Technique Technique: ...
2
votes
1answer
103 views

Where should the collision response/resolution code go?

I've got a collision response/resolution function that does the same for any pair of two entities. It's is in the World class right now. But right before that function is invoked, I have some ...
0
votes
2answers
149 views

Manage shader parameters

I'm making some test with OpenGL and I've got a problem with my application design. Currently, I've got something like that in pseudo code: // Ask to draw a given scene. renderer->drawScene( ...
1
vote
0answers
63 views

Designing & Implementing a generic actions & communication system [closed]

I'm currently in the process of redesigning the action/communication/sound system of some small game. This part currently handles characters speech and emotes. The game itself allows for a lot of ...
2
votes
3answers
789 views

Event/Trigger System Architecture

The Plan I am up to write write an own Trigger/Event System, an event engine or how you call it. I would like to achive something similar to Blizzard's most level editors, like Starcraft 1-2, ...
1
vote
1answer
69 views

Swapping function definitions at runtime

I am developing an cross-platform game-engine with a friend using C++, OpenGL ( 2 + 4 ) and some other Low Level API provided by the platform. So far we've finished window initalisation and some ...
0
votes
1answer
204 views

How to implement status-changing effects for attack class in turn based RPG?

I'm implementing "On Attack" and "On Receive Damage" within my game and from these two answers(Implementing flexible buff system,Implementing attack class in RPG ) I got that I will be implementing ...
1
vote
1answer
70 views

How do I implement references or relations for entities within a serialized savegame?

I have a 2D tile based RPG for which I'm developing save game function. In particular, I'm trying to save this structure: A caster can have multiple buffs that he maintains. Each buff can have ...
2
votes
2answers
140 views

Should widgets be part of a scene in a 2D game?

I'm in the middle of separating logic and drawing of a 2D game, i.e. I'm moving from scenes/entities that draw themselves to scenes/entities that merely store and update data, getting drawn by a ...
3
votes
2answers
195 views

How can I organise the code for an episodic game?

We're working on a game that's going to be split into three episodes, which we'll release one after another as they get finished. I'm worried that our typical somewhat monolithic architecture is not a ...
6
votes
4answers
277 views

Should references between assets be handled by name or ID or something else?

How should content or asset items be referenced in their serialized form? For example, a material might need to reference several textures. The simplest way would be to use a path, relative to the ...
1
vote
2answers
140 views

Should the game update loop compensate for slowness

I am building a game engine and considering the design for the core game loop that will drive the game. In the most basic form, the implementation looks similar to this (in pseudo-code): while ...
2
votes
0answers
188 views

How do you deal with loot in an RPG where all mosters drop their full inventory? [closed]

I currently have a system where both players and monsters in an RPG use equipment. This means that when an enemy is killed, I can technically drop everything they have. These are armor and weapons ...
2
votes
0answers
36 views

How to implement a property with a base value and a changed value? [duplicate]

I have a number of stats and effects in game that are subject to change, they have some kind of base value and the current value. For stats, I implemented this in a dynamic way, but for less important ...
2
votes
1answer
94 views

How to implement expiring and self-refreshing buffs in an RPG?

I have a turn based RPG with buff system where buffs are always on, and the player has an option to cancel them at any time. An exception to this system is buffs like "Effect lasts until the end of ...
1
vote
2answers
140 views

Architecture - how to refer to skills/abilities internally within code?

I have about 60 skills within my game, which are loaded from a JSON file. Each skill is a subclass of a skill object and has attributes like range, cost, target type, etc. Currently each skill has an ...
1
vote
1answer
158 views

How to centralize stat/feat/equipment related changes in an RPG?

I have a game with an RPG system where derived stats, like HP,armor, etc depend on a variety of components: armor, stats and feats. I'm running into an issue where the code to change derived metrics ...
14
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 ...