C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

7
votes
1answer
776 views

Bringing a Box2D, Physics Enabled game Online?

Lets say, to simplify the problem of online games a bit, my goal would be to run a near identical simulation on multiple computers in sync. Would sending commands be a good idea? Now if only sending ...
7
votes
5answers
581 views

Graphics module: Am I going the right way?

I'm trying to write the graphics module of my engine. That is, this part of the code only provides an interface through which to load images, fonts, etc and draw them on the screen. It is also a ...
7
votes
4answers
3k views

C++ Game Library for SVG Based Game [closed]

I'm looking into building a cross-platform opensource 2D RPG style game engine for ChaiScript. I want to be able to do all of the graphics with SVG and need joystick input. I also need the libraries ...
7
votes
3answers
4k views

Binding C++ and V8 Javascript from Google

The examples are quite challenging to grasp if you are still getting your head around other things, so the simplest example would be great. Is there a simpler example?
7
votes
3answers
443 views

Profiling and containing memory per system

I have been interesting in profiling and keeping a managed memory pool for each subsystem, so I could get statistic on how much memory was being used in something such as sounds or graphics. However, ...
7
votes
1answer
1k views

How can I organize render and transformation data in a scalable fashion?

I am writing for OpenGL 2.0 and in the future porting to OpenGL ES 2.0. I only use VBOs and shaders (no immediate mode, no vertex arrays). I already have working solutions, they just... feel wrong. ...
7
votes
1answer
2k views

How do I calculate collision response between a sphere and a plane?

I'm trying to create a simple 3D game and need to constrain the player within the limits of the game world. When the player hits the sides of the world I want the player's ship to bounce off slightly. ...
7
votes
2answers
2k views

Frustum Culling with VBOs

I have terrain being rendered in my project using VBOs in OpenGL. I would like to apply some Frustum Culling but have no idea how to access each polygon as its drawn to check if it is in view. I think ...
7
votes
1answer
2k views

OpenAL - alGetSourcei and AL_BUFFERS_PROCESSED gives junk

Posted this question on SO but got no answers. Maybe somebody can help me here. I recently had a well-working program which streamed WAV and Ogg sounds with OpenAL. I then decided to abstract the ...
7
votes
3answers
317 views

Terrain & Multi-Texturing

I'm using OpenGL (Version 4.4) (and C++ if that matters). I've created a terrain renderer, the terrain is stored as a 3D scalar field (isosurface/voxels). It uses a slightly modified version of ...
7
votes
2answers
860 views

How would I setup fog to follow a players coordinates?

I'm wondering if its possible to setup a fog to a player's coordinates (where there is fog around the player to make it more third-person) the main reason I ask this is because I have my player more ...
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 ...
6
votes
4answers
658 views

Identifying Entity 'Types' in an Entity-Component System

If an Entity has no explicit 'type' (e.g. player) and is simply a collection of components, how do I identify the entities that my systems should and should not be working on? For example, in a game ...
6
votes
7answers
1k views

Need 3D RPG development library/framework recommendations [closed]

I’m currently planning to develop an RPG. It will be a project I do in my free time. No pres-sure behind it. I’ll probably be doing it together with a friend and it’s just supposed to be a fun ...
6
votes
4answers
751 views

Game Clock Precision

I'm reading a fantastic article about game timer precision and here is a quote about 2/3 of the way into the article: If you start your game clock at about 4 billion (more precisely 2^32, or any ...
6
votes
5answers
4k views

Alternative to 2D array in a tiled-map structure

After searching for a long time, I'm surprised this question was not asked yet. In a 2D, tiled-map game, how do you handle the map ? I'd be glad to have your point of view in any languages, though I'm ...
6
votes
2answers
2k views

How can I handle inventory in an object-oriented way?

I'm trying to think of the best way to handle player inventory following an object oriented approach. For example, sword and axe are two different classes, both inheriting from weapon. Weapon and ...
6
votes
5answers
3k views

How to handle netcode?

I'm interested in evaluating the different ways that the netcode can "hook into" a game engine. I am designing a multiplayer game now, and so far I have determined that I need to (at the very least) ...
6
votes
4answers
2k views

2D Platformer Collision Handling

I am trying to create a 2D platformer (Mario-type) game and I am some having some issues with handling collisions properly. I am writing this game in C++, using SDL for input, image loading, font ...
6
votes
3answers
3k views

Draw contour around object in Opengl

I need to draw contour around 2d objects in 3d space. I tried drawing lines around object(+points to fill the gap), but due to line width, some part of it(~50%) was covering object. I tried to use ...
6
votes
3answers
511 views

Abstracting multiple math libraries with C++

I would like to create some level of abstraction above math in my code. I mean I don't want to be dependant on the implementation of math operations or even on class names, which are provided by some ...
6
votes
4answers
398 views

What data should I use to track the player position on a world at the same size of the earth in a multiplayer game?

I guess this kind of game or simulator already exist somewhere, but I'm not sure... Let's imagine I'm making a game where the proportions of the planet earth and the humans beings on it are the same ...
6
votes
2answers
320 views

What's the largest “relative” level I can make using float?

Just like it was demonstrated with games like dungeon siege and KSP, a large enough level will start to have glitches because of how floating point works. You can't add 1e-20 to 1e20 without losing ...
6
votes
1answer
626 views

Spaceship interiors: How to approach, implementation-wise?

I'm creating a 3D space game using Ogre3D for graphics with C++ and one of the features is to be able to freely wander around spaceship interiors, but I am lost with how to implement it. Here is what ...
6
votes
2answers
1k views

Sending a struct containing a string over network

I'm trying to send structs as neatly sorted packets using iPhone Game Kit.. I have a struct which looks like: typedef struct { int coolStuff; char playerID[100]; } MyStruct; Then I'm using ...
6
votes
1answer
565 views

How to do collision detection for fluids in 3D? [closed]

Is there an algorithm or a technique which can detect the collision between 3D fluids? I currently treat my fluids as dynamic meshes. Is it possible to find collisions with these, or will I need a ...
6
votes
2answers
691 views

How should I plan the inheritance structure for my game?

I am trying to write a platform shooter in C++ with a really good class structure for robustness. The game itself is secondary; it is the learning process of writing it that is primary. I am ...
6
votes
4answers
557 views

Sharing data between graphics and physics engine in the game?

I'm writing the game engine that consists of few modules. Two of them are the graphics engine and the physics engine. I wonder if it's a good solution to share data between them? Two ways (sharing ...
6
votes
2answers
1k views

Custom extensible file format for 2d tiled maps

I have implemented much of my game logic right now, but still create my maps with nasty for-loops on-the-fly to be able to work with something. Now I wanted to move on and to do some research on how ...
6
votes
2answers
263 views

Self-righting agents that have fallen over

I need insect-like agents that have fallen/rolled on their back/side to naturally re-orient themselves. The agents are modeled as simple cuboids in the physics engine (Bullet) to approximate an ...
6
votes
4answers
1k views

Spell Effects/Shaders

I want to be able to achieve spell effects that cause a fragmenting/discoloring effect on the sprite. The first couple seconds of this video http://www.youtube.com/watch?v=HNCFh7mkvuc shows what I ...
6
votes
3answers
697 views

Most Efficient way to read a Settings Configuration File

I have been working on a game for quite a while, and I am using Ogre3D for the rendering engine. It is getting to the point I need to move adjustable settings to a configuration file such as video ...
6
votes
2answers
468 views

Triangle-triangle continuous collision detection

I am making a 3D game engine and I use continuous collision detection. I am using Sphere-Trees to cull primitive collision checks to a minimum. However, I'd like to perform continuous ...
6
votes
1answer
592 views

How would one draw many objects using the same VBO

I'm kind of stuck with this question for some time now, maybe because I don't know exactly what to search for, it might be a term I have not heard of yet as most tutorials ends after drawing one ...
6
votes
5answers
1k views

What is Serialization?

I have been around programming for a while as a hobby, but I did not start seeing this concept until recently. I have google'd "what is serialization" numerous times, but I never actually get any sort ...
6
votes
1answer
466 views

How would one store global context data in an entity component system?

My question is this: How would one store global context data, ie. world data information, current world time, etc in an entity component system? I'm think of working towards building a Dwarf ...
6
votes
2answers
981 views

In DirectX 11, batching primitives for performance, how does this actually work?

I don't seem to be able to understand this. Microsoft says that one of the possible optimizations of for a Direct3D 11 if to batch primitives draw calls. For example in order to draw say 300 triangles ...
6
votes
2answers
1k views

How do you pack resources in a game when you have too many of them?

I've recently made a basic space invaders clone in C++ using the Allegro 5 framework. It took me a long time, but after I finished, I realized I had about 10 sprites, and 13MB worth of DLLs (Some of ...
6
votes
2answers
6k views

How to handle a Block World like Minecraft

I want to write a simple game with a block world like in Minecraft. My theoretical question is what is the best way to handle this block informations during playing. My first Idea was a huge array but ...
6
votes
4answers
1k views

Where to start the coding of online leaderboards?

I NEVER, EVER did ANY sort of network code in C++, I don't know even the libraries that exist, but a popular demand for my game is online leaderboards... So, what sort of libraries I should research ...
6
votes
2answers
716 views

Example of Data Oriented Design

I can't seem to find a nice explanation of the Data Oriented Design for a generic zombie game (it's just an example, pretty common example). Could you make an example of the Data Oriented Design on ...
6
votes
4answers
4k views

Object-Oriented OpenGL

I have been using OpenGL for a while and have read a large number of tutorials. Aside from the fact that a lot of them still use the fixed pipeline, they usually throw all the initialisation, state ...
6
votes
1answer
5k views

Help understanding gluLookAt()

I am fairly new to openGL( 3 months ) and am asking for assistance in understanding the fundamentals behind gluLookAt(). Currently I have spent most of my time with openGL modeling scenes with fixed ...
6
votes
3answers
402 views

Managing Voxel Data

I've been programming in C++ as a hobby for about 4 months now, and I've really loved creating stuff using voxels. I wrote a "game" (More of just a personal challenge, as I really only did the ...
6
votes
3answers
2k views

C++ and OpenGL ES: glDrawArrays calls are time consuming

Currently, I'm profiling my iOS. All the calls to glDrawArrays are expensive. For example, here is a screenshot of the rendering part of a particle system: As you can see, the glDrawArrays call ...
6
votes
4answers
1k 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 ...
6
votes
1answer
2k views

How can I build and run Doom 3 from source in Windows?

I am trying to build and run Doom 3 from the open source release in order to better understand how the engine works. Unfortunately I am not able to run the game from the binary I built. I just get the ...
6
votes
2answers
915 views

How to get the maximum installed version of DirectX?

Okay, So I would like my engine to detect weather or not it can use DirectX 10, if it can't it defaults to DirectX 9.0c but, the function DirectXSetupGetVersion() will only return Versions 5 through ...
6
votes
1answer
923 views

Is the STL efficient enough for mobile devices?

When it comes to mobile game development on iOS and Android NDK, some developers write their own C++ containers, while others claim that STL is more than adequate for mobile game development (For ...
6
votes
2answers
1k views

Smooth terrain rendering

I'm trying to render a smooth terrain with Direct3D. I've got a 50*50 grid with all y values = 0, and a set of 3D points that indicate the location on the grid and depth or height of the "valley" or ...