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 ...
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
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 ...
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 ...
11
votes
5answers
906 views

How should game objects be aware of each other?

I find it hard to find a way to organize game objects so that they are polymorphic but at the same time not polymorphic. Here's an example: assuming that we want all our objects to update() and ...
2
votes
2answers
181 views

What common interface would be appropriate for these game object classes?

Question A component based system's goal is to solve the problems that derives from inheritance: for example the fact that some parts of the code (that are called components) are reused by very ...
4
votes
1answer
244 views

Separating components and logic

I've been working on how to build some of my game systems using components and systems. I'm having a little trouble following the approach that components should just be bags of data and systems ...
0
votes
1answer
226 views

Where to save enemy positions in C++?

I'm wondering how and where to save the positions my enemies should spawn. My idea was to use a struct such as: struct enemy{ int x,y,type; } And save an array of it in a .dat with fwrite() ...
2
votes
1answer
498 views

Using an Entity System Architecture with Task Based Parallelism

Background I have been working on creating a multithreaded game engine in my spare time and I currently trying to decide the best way to work an entity sytem into what I have already created. So far, ...
9
votes
3answers
381 views

Flexible alternatives to many many small polymorphic classes (for use as properties or messages or events) C++

There are two classes in my game that are really useful, but slowly becoming a pain. Message and Property (property is essentially a component). They both derive from a base class and contain a ...
5
votes
3answers
591 views

When two moving objects collide, which one sends the message, and which one recieves it?

I am writing a platform game using an entity-component system. Entity-World collisions are robust and work very well, and I'm now working on collisions between entities. Just to be clear, in my code ...
3
votes
1answer
197 views

Whats the best way to expose current settings to your classes? [duplicate]

Just as the title states, whats the best way to expose current settings like resolution to my classes? (I know this might have been asked, but I couldn't find anything) I was thinking of the ...
1
vote
1answer
593 views

Entity-System Architecture; Pools and Factories

I'm creating a 2D game based on entity-system architecture using C++, the C++ port of Artemis, and SFML. I've had to jump through a few hoops, but it's been fairly smooth until now. In this game, I ...
11
votes
4answers
475 views

How to determine range of possible movement in turn-based, distance-based strategy game?

I'm creating a 2-dimensional, turn-based strategy game using c++ and SFML-2.0. Movement is distance-based rather than grid-based, with several different triangle-shaped pieces that, on a given turn, ...
1
vote
3answers
1k views

Entity System creating Components

Over every entity system I see implemented in C++, or even in Java/C# (e.g. the Artemis framework). I see components not allocated via a new operator (or something similar, e.g. std::make_shared). For ...
4
votes
2answers
611 views

Allocating Entities within an Entity System

I'm quite unsure how I should allocate/resemble my entities within my entity system. I have various options, but most of them seem to have cons associated with them. In all cases entities are ...
4
votes
1answer
521 views

Material System

I'm designing Material/Shader System (target API DX10+ and may be OpenGL3+, now only DX10). I know, there was a lot of topics about this, but i can't find what i need. I don't want to do some kind of ...
0
votes
0answers
120 views

Resource/Asset Manager [duplicate]

I'm creating a ResourceManager. At the beginning i'm creating a groups of resources which contain a map of resources. The role of groups is to quick load/unload resources, to find some constant, never ...
2
votes
3answers
241 views

Desire advice on implementing this animation timeline system

I have read a lot of questions on here, as well as books regarding game architecture. I have a general question about the implementation of a game's animation timeline, on which many isolated ...
0
votes
0answers
58 views

Design issue: World class only contains Rigidbodies but custom objects need further updating

BACKGROUND: My World class that is responsible for updating the physics for each object in the game contains a std::vector of Rigidbody classes. As Rigidbodies are added to the world, they are also ...
8
votes
5answers
503 views

How can I update Display settings from an Options screen without restarting?

I'm currently creating a 2D RPG in C++11 with Allegro 5 and boost. My goal is to somehow update my game settings when an option is changed in the Options Menu. I don't want to force the user to ...
17
votes
4answers
2k views

Game architecture / design question - building an efficient engine while avoiding global instances (C++ game)

I had a question about game architecture: What is the best way to have different components communicate with each other? I do really apologize if this question has already been asked a million times, ...
1
vote
1answer
738 views

CPU usage, game loop and sleep()

I've read about this topic on numerous discussion sites, but I can't seem to find a clear definitive (up-to-date) answer, and hopefully this will me some more insight: I've read the excellent game ...
1
vote
1answer
662 views

UML Class Diagrams for 2D platformer Games? [closed]

I have to develop a small arcade game in C++ for a college assignment using a 2D Game Engine my teacher coded. What would be the best way to make a UML class diagram for it? It's very basic stuff but ...
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 ...
2
votes
1answer
404 views

Creating Input layouts for different vertex types

I'm still in the planning phase for a hobby abstract renderer, and i'm wondering how i should handle multiple vertex types and different shader inputs. (This is my first graphics project, so cut me ...
1
vote
1answer
269 views

How can you implement Lua into your game? [closed]

I am trying to implement Lua into my game, but am having trouble. Say I have a weapon class, which is just a hollow shell, lacking real functions. I was thinking of creating an onFire function, which ...
9
votes
1answer
2k views

Implementing a camera / viewport to a 2D game

What is the most practical way to implement camera/viewport to a 2D-game? I've read, that I should store the object world position instead of position relative to the screen? Current situation: I ...
2
votes
3answers
825 views

Question on the implementation of my Entity System

I am currently creating an Entity System, in C++, it is almost completed (I have all the code there, I just have to add a few things and test it). The only thing is, I can't figure out how to ...
3
votes
3answers
1k views

SceneManagers as systems in entity system or as a core class used by a system?

It seems entity systems are really popular here. Links posted by other users convinced me of the power of such system and I decided to try it. (Well, that and my original code getting messy) In my ...
5
votes
1answer
476 views

Component based design, but components rely on each other

I've begun stabbing at a "Component Based" game system. Basically, each entity holds a list of components to update (and render) I inherit the "Component" class and break each game system into it. ...
11
votes
1answer
410 views

How can I cleanly and elegantly handle data and dependancies between classes

I'm working on 2d topdown game in SFML 2, and need to find an elegant way in which everything will work and fit together. Allow me to explain. I have a number of classes that inherit from an abstract ...
1
vote
1answer
213 views

How can I refactor my code to use fewer singletons?

I started a component based, networked game (so far only working on the server). I know why singletons can be bad, but I can't think of another way to implement the same thing. So far I have: A ...
16
votes
6answers
1k views

Should Vector3 inherit from Vector2?

I'm creating a couple of classes Vector2 (X & Y) and Vector3 (X, Y & Z), but I don't know whether to make Vector3 inherit from Vector2, or whether to re-implement the member variables m_x and ...
6
votes
4answers
945 views

Pros and cons of using dlls

I wonder about create every game engine module (render, input, sound, etc...) into dlls (renderer.dll, input.dll, etc...). What are pros and cons in your opinion of divide game into set of dlls ? I ...
-2
votes
3answers
2k views

C++ Game Engine Book/Tutorial/Anything recent? [closed]

Before I get flamed, please understand that I have been looking for a while now. Yes, I have found a good amount of game engine tutorials...except filled with errors, out of date syntax, missing ...
1
vote
4answers
1k views

SDL - Getting a single keypress event instead of a keystate?

Right now I'm working on a simple SDL project, but I've hit an issue when trying to get a single keypress event to skip past a splash screen. Right now, there are 4 start-up splash screens that I ...
2
votes
2answers
2k views

Entity System with C++

I'm working on a game engine using the Entity System and I have some questions. How I see Entity System : Components : A class with attributs, set and get. Sprite Physicbody SpaceShip ... System ...
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 ...
9
votes
3answers
2k views

Component-based design: handling objects interaction

I'm not sure how exactly objects do things to other objects in a component based design. Say I have an Obj class. I do: Obj obj; obj.add(new Position()); obj.add(new Physics()); How could I then ...
6
votes
4answers
4k views

Why has the industry switched from C to C++?

First of all i would like to have a real answer, i'm always trying to get more from various sources and articles, and when I read things like C++ is slow because it has virtual functions and because ...
2
votes
1answer
911 views

Managing the user input

I'm studying a good number of articles about this topic and seems to me that there is just one way to do this: a signal/slot design. I was also looking at some more complex async examples but I don't ...
3
votes
4answers
4k views

What is the most efficient container to store dynamic game objects in? [closed]

I am making a first person shooter and I know about about a lot of different container types but I would like to find the container that is the most efficient for storing dynamic objects that will be ...
3
votes
1answer
505 views

C++ game architecture

I'm trying to make a game, but I'm not sure of the best way to set up the main loop and classes. For really small games, I could put everything in the main() loop, including event handling, collision ...
6
votes
1answer
1k views

Game editor integration with the engine?

What I am trying to figure out is what is the best way to integrate the editor(level, effects, model, etc...) in the most effective way? Now the first thing I thought would be to create the game ...
10
votes
4answers
1k views

Circular class dependency

Is it bad design to have 2 classes which need each other? I'm writing a small game in which I have a GameEngine class which has got a few GameState objects. To access several rendering methods, these ...
6
votes
1answer
2k views

Game programming: common methods and design patterns

I begun writing a very simple game engine so that I can learn OpenGL 3.x better but since my inexperience and my sparse knowledge of how a 3D game should be designed, I usually get into problems where ...
2
votes
3answers
381 views

C++ Namespace vs Reference passed around like crazy - Implement a quest journal

May sound funny, but that's what the question is about. Suppose you have this situation: http://i48.tinypic.com/whl6pk.jpg Red squares are data types. Hexagons are methods and Journal is the main ...
0
votes
1answer
2k views

GameObject and Components

I am creating a relatively simple game engine in C++ and Qt. I am using Irrlicht for graphics, and as of now, I will not be using any physics or audio libraries. For time's sake, I am using ...
7
votes
1answer
2k views

Turn-based JRPG battle system architecture resources

The past months I've been busy programming a 2D JRPG (Japanese-style RPG) in C++ using the SDL library. The exploration mode is more or less done. Now I'm tackling the battle mode. I have been unable ...