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

learn more… | top users | synonyms

35
votes
6answers
5k views

What's a way to implement a flexible buff/debuff system?

Overview: Lots of games which RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit." ...
41
votes
10answers
10k views

Game State 'Stack'?

I was thinking about how to implement game states into my game. The main things I want for it are: Semi-transparent top states-being able to see through a pause menu to the game behind Something ...
24
votes
4answers
3k views

Finding the nearest object

I have a sizable game engine and I'd like a feature for finding the nearest of a list of points. I could simply use the Pythagorean theorem to find the distances. I know I can't simply add x and y, ...
77
votes
9answers
29k views

What are some programming design patterns that are useful in game development? [closed]

I have a few books on Design Patterns, and have read some articles, but cannot intuitively figure out which programming design patterns would be useful in game development. For example, I have a book ...
40
votes
8answers
28k views

Is Java viable for serious game development? [closed]

Ever since I was a little kid, my dream has been to develop games. Well, now that I am older, more mature, and have some programming experience, I would like to start. However, I would like to turn ...
33
votes
5answers
5k views

Any tips for creating cross-platform games? [closed]

Do you have any tips/recommendations when creating a cross-platform game in C/C++?
28
votes
3answers
2k views

Several classes need to access the same data, where should the data be declared?

I have a basic 2D tower defense game in C++. Each map is a separate class which inherits from GameState. The map delegates the logic and drawing code to each object in the game and sets data such as ...
34
votes
2answers
7k views

How to create adjustable formula for RPG level up requirements?

I'm trying to create a formula that can be modified simply by changing two values: number_of_levels, and last_level_experience. This is to enable people modding the game to change the levelling ...
10
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 ...
8
votes
1answer
3k views

Fast, accurate 2d collision

I'm working on a 2d topdown shooter, and now need to go beyond my basic rectangle bounding box collision system. I have large levels with many different sprites, all of which are different shapes and ...
39
votes
9answers
36k views

Easy to use cross-platform 3D engines for C++ game development? [closed]

I want to try my hand at writing a 3D game. However I don't want to start at such a low level of drawing individual triangles and writing my own 3D object loader and so on. I've heard of things like ...
22
votes
2answers
4k views

Is it safe to use Sleep() in game loop (on Windows)?

Is it safe to use Sleep() function on Windows in game loop (C++)? I want to have fixed frame rate.
5
votes
5answers
2k views

How to lead a moving target from a moving shooter

I saw this question: Predicting enemy position in order to have an object lead its target. My situation is a little different though. My target moves, and the shooter moves. Also, the shooter's ...
2
votes
3answers
2k views

Optimized rendering of a cube mesh world

I want to render a cube-mesh (a.k.a. Minecraft-style) world. If I render each existing cube it will eat up FPS pretty quickly. How can I optimize it? I understand that the point is to not render ...
46
votes
9answers
44k views

Good GUI for OpenGL [closed]

I am starting to learn OpenGL with FreeGLUT using the Superbible and the knowledge i have from my elementary graphics to brush up on my skills. To get more from this experience i want to integrate a ...
55
votes
17answers
25k views

C++ low-level optimization tips

Assuming you already have the best-choice algorithm, what low-level solutions can you offer for squeezing the last few drops of sweet sweet frame rate out of C++ code? It goes without saying that ...
23
votes
9answers
9k views

What C++ GUI library can you suggest? [closed]

I'm building my own game engine in C++ and I'm currently deciding on what user interface I should use. Should I use a library? Should I make my own?
16
votes
5answers
6k views

When should vector/list be used?

I can understand when to use lists, but I don't understand when it is better to use vectors than using lists in video games: when it is better to have fast random access ? (And I understand why it's ...
12
votes
2answers
1k views

What are the common rendering optimization techniques for the geometry pass in a deferred shading renderer? [closed]

I have been developing a game engine using OpenGL 3 and C++ (and glfw for window management). I have advanced so far, got most of the things done except sound entities and optimizations. The engine ...
8
votes
2answers
4k views

Interaction between engine parts

I want to ask a question about how the information exchange between game engine parts should be implemented. The engine is separated in four parts: logic, data, UI, graphics. In the beginning I made ...
3
votes
4answers
5k views

RTS Engine or DotA-like game [closed]

Is there any good documented and simple Game engine for RTS games, especially for building DotA-like game? I know I can use Crystal Space, Irrlicht or another Game Engine. But I need most similar ...
2
votes
6answers
2k views

Will C++ remain viable for game engines in somewhat distant future? [closed]

C++11 has opened ways, which were only dreamt by the C++ programmers. It has been three years since I have been learning C++, and I am going well. Now I want to get into video games. Every core of ...
102
votes
22answers
19k views

STL for games, yea or nay?

Every programming language has its standard library of containers, algorithms, and other helpful stuff. With languages like C#, Java, and Python, it's practically inconceivable to use the language ...
31
votes
2answers
9k views

Entity/Component Systems in C++, How do I discover types and construct components?

I'm working on an entity component system in C++ that I hope to follow the style of Artemis (http://piemaster.net/2011/07/entity-component-artemis/) in that components are mostly data bags and it's ...
53
votes
9answers
6k views

How can you put all images from a game to 1 file?

I've just finished a basic RPG game written in C++ SFML, I've put a lot of effort into the game and I'd want to distribute it, however I've ran into a small issue. Problem is, I have well over 200 ...
8
votes
2answers
5k views

Entity Component Systems with C++ - Accessing components

(What I'm describing is based on this design: What is an entity system framework?, scroll down and you'll find it) I'm having some problems creating an entity-component system in C++. I have my ...
24
votes
4answers
2k views

game story event programming

I have developed a game engine in c/c++ and DirectX. I have a tile engine for the maps, animated player/npc sprites, talking to the npc, menus, and level changing but there is no game, it just feels ...
13
votes
6answers
7k views

Where do I begin if I want to write a C++ 2d game? [closed]

Clarification: I'm not asking for the best place to start. I'm just asking for a place to start. I am a C# web developer and I want to expand my skillset and have some fun while doing it. I know some ...
14
votes
3answers
7k views

Starting out with OpenGL when most tutorials are out of date

I'm sure there are already a bunch of questions like this asked, but the constant updating of the OpenGL library throws them all away, and in a month or two, the answers here will be worthless again. ...
11
votes
5answers
939 views

Custom Content Package for Files

I am about to purchase quite a few model packs from a website for prototyping my game. In the contract it states that I must protect them as to prevent the public from gaining access to them. I ...
18
votes
4answers
4k views

Should collision detection be done server-side or cooperatively between client/server?

I am working on an online game that will have very heavy collision detection processing. Player models will collide with other players, mobs, structures, terrain, and solid objects that only exist ...
12
votes
1answer
1k views

Programming a climbing system like tomb raider

I was wondering if anyone knew or had knowledge of how to program a climbing system like the one found in tomb raider/uncharted. I had thought of just having bounding boxes at all the climbable ...
12
votes
6answers
3k views

Should an object in a 2D game render itself?

I'm making a 2D street fighter-like game that is not tile based. Usually people recommend that entities be given to a renderer that render them, not them render themselves, but it seems the inverse is ...
9
votes
6answers
2k views

Throwing Exceptions in C++ game DLL's? Pros and Cons

What are the pros and cons of using Exceptions in C++ in relation to game development. Google style guide says that they don't use Exceptions for a variety of reasons. Are the same reasons ...
5
votes
7answers
8k views

What is a good book to start programming a 2D C++ game?

I have a degree in Computer Science and while I was in college, I created a simple 2D game in Game Maker. I would like to recreate this game in C++ as a start to learning how to create games in C++. ...
1
vote
2answers
8k views

Where to start learning OpenGL with C++? [duplicate]

Possible Duplicate: What are some good learning resources for OpenGL? I have learnt C++ and made some cool text based games and such but I would love to start graphical programming. I'm a ...
3
votes
4answers
17k views

Starting programming in 3D with C++ [closed]

EDIT: There aren't sufficient enough tutorials for what I'm trying to do in Python, so I'm going to take my time and slowly build up my skills in C++. It's hard to trip and not land in a book of C++ ...
8
votes
3answers
1k views

Proper way to handle destruction of game entities

Imagine a game world where loads and loads of entities are dynamicly loaded all the time, I would represent that as a list of entities perhaps, but what about removing them? While when adding i ...
5
votes
1answer
2k views

Different shaders for different objects DirectX 11

I am learning Direct3D 11, and in all basic tutorials I found on shader writing, Vertex and Pixel shaders are written so they transform whole scene same way. Tutorials like render cube with texture... ...
5
votes
9answers
2k views

How do I create a game that runs on Windows, iOS and Android?

I use C++ to create windows games and now I want to step into another other OS like Android or iOS. I'm totally familiar with C++ so I tried to create app for iOS using objective C it was working ...
3
votes
3answers
2k views

How do I shoot bullets towards the mouse in a top down shooter?

I have a formula for pointing my main character of the game towards the mouse, and it gets the angle he needs to be turned to point towards the mouse. But how do I get the bullets from the gun to use ...
-6
votes
1answer
1k views

Why is C++ used for game engines? How about its future in game engines? [closed]

C++, as I have seen, is being heavily used in 3d video game engines.... Is it because of the performance issues, legecy code or libraries such as DriverX? If performance, libraries and code ...
24
votes
3answers
15k views

Android game development in c++

So being a primarily c/c++ developer, I've always thought that the only option for mobile game development for me was using iOS, which allows for c/c++ (and minimising objective C). I heard from a ...
35
votes
8answers
4k views

How are deterministic games possible in the face of floating-point non-determinism?

To make a game like an RTS networked, I've seen a number of answers here suggest to make the game completely deterministic; then you only have to transfer the users' actions to each other, and lag ...
39
votes
9answers
24k views

Why don't C++ Game Developers use the boost library? [closed]

So if you spend any time viewing / answering questions over on Stack Overflow under the C++ tag, you will quickly notice that just about everybody uses the boost library; some would even say that if ...
19
votes
7answers
12k views

What languages are used to develop MMORPGs like EVE Online and WOW?

As I understand it, MMORPGs are games that run on your computer like any other normal 3d video game but, with each action that happens with in the game, changes are made to the universe via HTTP calls ...
-2
votes
1answer
5k views

How do I start writing an MMO game server? [closed]

I am developing a multi-player on-line game. I just started coding the server but I have no idea how to do it. Do I have to use threads ? And if i do, do I need one thread for every client? Knowing ...
16
votes
3answers
7k views

How do you add a scripting language to a game?

Let's say I have a game written in C++. But I want to add some modding or scripting functionality to it. How would one go about adding a scripting functionality to your game?
11
votes
3answers
2k views

How to implement buffs / debuffs / temporary stat changes in an RPG? [duplicate]

Possible Duplicate: What’s a way to implement a flexible buff/debuff system? In the context of creating an engine for a RPG I want to implement a generic way to give effects / buffs / ...
4
votes
4answers
5k 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 ...