Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

2
votes
2answers
46 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 ...
0
votes
0answers
44 views

Secure Login with Login Server [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: So my question is: ...
-1
votes
1answer
46 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
97 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
60 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
139 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
88 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 ...
2
votes
1answer
122 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
179 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
116 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
145 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
131 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
89 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
139 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
59 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
53 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 ...
1
vote
1answer
147 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 ...
1
vote
4answers
648 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
96 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
93 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
89 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
41 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
448 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
58 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
101 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
61 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
119 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
156 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
228 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
108 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 ...
1
vote
0answers
129 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
35 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
60 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
125 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
112 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 ...
12
votes
2answers
1k 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 ...
3
votes
2answers
213 views

How to implement special weapon and armor effects (ex: vampiric, holy, damage shield, thorns)?

I'm working on the inventory system for my game, and am interested in how do I implement additional weapon and armor properties that are not just damage or armor? If all I have is damage and armor, ...
0
votes
1answer
236 views

How to use Bullet physics with Entity Component Systems?

I have an Entity Component system and I want to have a Physics Component that would add the given object to the physics simulation. My problem arises because the Bullet API requires me to add each ...
2
votes
1answer
166 views

Collision Shapes Abstraction Design

Straight to the facts. I have a base CEntity class for different entities in my game: Static entities ( those do not move, simply props and items ) Dynamic entities ( these move, jump ) Each of ...
1
vote
0answers
259 views

Gluing libraries together into a 3D engine [closed]

As I read about people wanting to write their own 3d engine from scratch and people recommending using existing engines, it occurred to me that a middle-ground exists between developing your own ...
0
votes
1answer
192 views

How or why are major video games programmed so reliably? [closed]

It seems like every five minutes, you come across yet another installer which fails to install certain components, another .NET application that throws up an unhandled or semi-unhandled error message, ...
6
votes
1answer
603 views

How to benefit from cpu cache in a entity component system game engine?

I often read in the ECS game engine documentations that is a good architecture for using cpu cache wisely. But I can't figure how we can benefit from cpu cache. If components are saved in an array ...
3
votes
1answer
156 views

Entity component systems and DDD: violation of encapsulation?

I'm using a hybrid of DDD (domain-driven development) and an entity-component system. That is to say: I have an Entity class with a list of Components, and the ability to add/remove/get components I ...
2
votes
2answers
196 views

In a ES system, how one would implement/ deal with Modifiers?

Given the normal entity-component-system architecture, lets say we a component that give the entity Strength. Now on the game flow I want to give +4 strength do to the wielded weapon. What would be ...
1
vote
1answer
123 views

How do you get player to interact with level?

I suffer from this problem where I have say a class called Player and a class called Level. Now the only way I can figure out how to say make the player interact with the level is if I do something ...
1
vote
0answers
75 views

What should the data structure of a flexible ability system look like? [duplicate]

Hi guys I am currently working on a turn-based RPG that will require me to create numerous abilities with little overlap. I've been looking to other games to see how their ability and combat system is ...
0
votes
0answers
83 views

Different Spawning Target Pattern on a Music Game App (Prototype)

I'm using Gtomee's audio spectrum decoder tutorials (from sample video or codes at GitHub) to create its own spawning pattern according to what music it played. It worked pretty nicely despite this ...
2
votes
1answer
277 views

What makes games responsive to user input?

Many games have been praised for its responsive gameplay, where each user action input correspond to a quick and precise character movement (eg: super meat boy, shank...) What makes those games ...
10
votes
3answers
576 views

How should I model an economy-based game in code?

I'd like to create an economy game based on an ancient civilization. I'm not sure how to design it. If I were working on a smaller game, like a copy of "Space Invaders," I'd have no problem ...