Engine-design related questions. How code is structured.
4
votes
0answers
47 views
Should an AI system be centralised or distributed? [on hold]
I'm very new to game development, but a very 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 ...
1
vote
2answers
98 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 ...
1
vote
2answers
62 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
0answers
66 views
The concept of a User vs Player [closed]
In my game, the player can play the game in single player, or local multiplayer mode without really talking to the backend. The player object, which I will call the User, is stored locally, and it ...
0
votes
1answer
38 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 ...
1
vote
2answers
195 views
Where should I put my game loop?
I've seen some tutorials on programming a good game loop, but none mention where (in the game code) I should call it.
My guess is I should call it from the main() method. Am I right? Is there another ...
4
votes
1answer
156 views
How are game menus logically structured?
I've been struggling with making a game menu system in Unity for some time now. I spent time developing a way to help myself understand how game menus are connected together. Right now, I'm calling it ...
3
votes
2answers
87 views
Should entities store other other entities that they spawned?
How should a game entity add another game entity to the game world?
For example, an entity shooting a missile (which is another entity), means the new Missile will need to be added to the entities ...
3
votes
1answer
181 views
How and when to choose which objects to run collision tests on?
This might be problem with plenty of good solutions, but it's all not very clear to me, so I though I could ask and probably get some good hints. I'm having trouble figuring out how to handle ...
0
votes
2answers
101 views
Without using a pre-built physics engine, how can I implement 3-D collision detection from scratch? [closed]
I want to tackle some basic 3-D collision detection and was wondering how engines handle this and give you a pretty interface and make it so easy ... I want to do it all myself, however.
2-D ...
0
votes
2answers
85 views
Best way to store a large amount of game objects and update the ones onscreen
Good afternoon guys! I'm a young beginner game developer working on my first large scale game project and I've run into a situation where I'm not quite sure what the best solution may be (if there is ...
1
vote
1answer
76 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
85 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
112 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
245 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 ...
1
vote
0answers
113 views
Abstracting Game Logic from Game Engine
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 ...
3
votes
1answer
267 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
143 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
62 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
171 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
20 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
159 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
216 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
66 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
122 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
135 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
64 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
173 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
98 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
194 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
193 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
131 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
441 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
156 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
159 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
201 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
91 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
58 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
190 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
744 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
122 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
95 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
118 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
55 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
539 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
66 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
134 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 ...