Engine-design related questions. How code is structured.

learn more… | top users | synonyms (2)

2
votes
2answers
48 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 ...
10
votes
3answers
544 views

Does Unity have existing support for Timelines?

I am planning the development of a game in Unity3D, and trying to come to terms with what the engine has already provided, and what I must code myself. The game itself is going to be a rhythm game, ...
6
votes
1answer
604 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 ...
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
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: ...
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 ...
-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 ...
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 ...
80
votes
3answers
22k views

Tips for writing the main game loop? [closed]

Can anyone recommend some good tips, articles, sites, etc. for writing the main game loop? What are some things that you should do in the game loop, and what are some things that you shouldn't do in ...
6
votes
5answers
1k views

What is Java missing that might make it difficult to develop fully-featured 2D games?

Without using any external libraries, does Java, including all officially supported APIs give you enough to develop fully-featured 2D games? The reason I ask is that I hear a lot of "bad-mouthing" ...
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 ...
-2
votes
2answers
134 views

Should collision sounds and UI responses be deferred or processed immediately?

When checking for collisions between entities, should you play a collision sound immediately on discovering a collision or queue every collision and process the sounds later? Similarly for user user ...
0
votes
1answer
61 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 ...
5
votes
2answers
1k views

Component based game engine and dependencies - singletons [closed]

I am thinking about how to create component based game engine. I understand that all things should be very similar as in Data Oriented Design (each object is a collection of various structures as ...
43
votes
8answers
8k views

Event-driven Communication in a Game Engine: Yes or No?

I am reading Game Coding Complete and the author recommends Event Driven communication among game objects and modules. Basically, all living game actors should communicate with the key modules ...
3
votes
3answers
331 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 ...
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 ...
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
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
3answers
1k views

How do I code a 2D tile map? [closed]

I'm new to game development and I want to know how to create a tile map. The map should be divided into squares, such that each square represents a location like x : 10, y : 10. The width and height ...
6
votes
3answers
1k views

How to avoid “Blob-Systems” in an entity component system?

Currently I am facing the following problem: I am trying to write a pong clone by using an entity component system (ECS). I wrote the "framework" all by myself. So there is a class which manages ...
1
vote
1answer
274 views

Adjusting server-side tickrate dynamically

I know nothing of game development/this site, so I apologise if this is completely foobar. Today I experimented with building a small game loop for a network game (think MW3, CSGO etc). I was ...
5
votes
1answer
373 views

How do you parameterize turn based AI?

I would like to create/find an AI algorithm/process that can be parameterized such that a change in the parameters causes a change in the AI behavior. I am specifically looking to apply this to a turn ...
0
votes
2answers
1k views

I need an enemy spawning algorithm for a 2D tower defense

I need an enemies spawning algorithm for a 2D tower defense game. I have 4 maps, each has 4 stages and each stage has 40 rounds. I need to create an algorithm which will instantiate waves, increase ...
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 ...
9
votes
2answers
671 views

Should the content pipeline tools be embedded in the engine?

How minimal should a games engine be? How much of the content pipeline should be embedded in the engine? Some use cases where the super engine might be useful: When loading user content, the user ...
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 ...
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, ...
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 ...
0
votes
1answer
91 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 ...
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
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, ...
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 ...
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
160 views

How do I keep user input and rendering independent of the implementation environment?

I'm writing a Tetris clone in JavaScript. I have a fair amount of experience in programming in general, but am rather new to game development. I want to separate the core game code from the code that ...
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
0answers
221 views

Game editor architecture [closed]

I'm looking in to developing a game editor - essentially a level editor for my game but a little more advanced i.e edit menus and loading screens and what not. So far, I have come up with a ...
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 ...
17
votes
3answers
840 views

How to create a Ghost Replay feature in a game?

When you set a personal best lap time in a console racing game, you have the option to compete against your ghost. How can this feature be created for a single player casual type game?