C++ and Making games...

A separate tool is generally used to create the 3d model. c/c++ is used to dynamically manipulate those models.

If you're serious about learning this, download the Direct3d SDK and look at the sample code. The tutorials will give you the basic idea of how a triangle (the building block of 3d objects) is rendered.

If you're really serious about learning this:

Step 1: Get a strong-ish math background. No need to be a whiz, but at least have a good grasp of linear algebra. This book looks like it may be something for you: http://www.amazon.com/exec/obidos/t...859-5825560?v=glance&s=books&n=507846.
Step 2: Choose an API. At this point, it doesn't really matter which one. Learn the basics of that API. Enough so that you feel comfortable writing simple "draw this triangle over there" types of programs.
Step 3: Download sample code. Play with it. Learn why and how it works.
Step 4: Start reading technical papers. www.siggraph.org www.gamasutra.com http://www.ati.com/developer/index.html http://developer.nvidia.com/page/home
Step 5: If you aren't sick of this yet, find a 3d artist to make a few models for you (or if you have any artistic talent, do it yourself). Start applying what you've learned to create your own demos
Step 6 - infinity: Figure out how to make money from your new skills.
 
dantruon said:
Im realli confused now ppl

C++, C, Java, C#, etc... are just programming languages. A set of syntax, rules, structure, etc when written correctly syntactically will allow the compiler of the respective language convert to Machine Code (1s & 0s).

Now how C++ can be used for graphics programming as long as there are graphics libraries or API (e.g .DirectX, OpenGL, etc) for the language to interface. Better if the development environment have low-level APIs you can code closer to the metal (more primitive function calls). Or better you can create your own which will more than likely will require Assembly coding (this you will require intimate knowledge of the hardware and of cause an assembler).

My graphics programming experience only extended to 3rd and 4th year Uni classes, but always wanted to get back to it. I am surprised some of the things I've learnt in theory 10 years ago is only in the spotlight or hard-wired in the recent years.

P.S. Know your maths in vectors, matrix, etc… if you want to learn more in Graphics (especially 3D) programming. It’s hellalota mathematics. :)
 
dantruon said:
Then exactly what is the role/duty of c++ in the process of making a games.

Im realli confused now ppl

I think u (and some others) are just a bit confused on the difference between content creation and programming. These are the 2 main sides of videogames creation, but also movie production for example.

All that u see on screen, the models, the textures, the environments, are created by artists. First on paper, with drawings and sketches of ideas, then translated into 3D models (and surfaces) using common 3D packages. In the videogame world, 3D Studio Max is used. In movie post-production, Maya is usually the queen of the jungle. And a pain to use too, if i may add.

The process of getting to run all this content on whatever platform is done using APIs, graphic libraries, middlewares, or your own engine.

The 2 sides "should" work side by side to ensure that the content created by the artists runs well on a particular platform without sacrificing too much in terms of quality in favour of playability.

Or that's the way i understand a typical videogame studio to work, i have only experience with movie post-production "chain-of-events".
 
C++ plays the exact same role in console game development that it does in developing games for a home computer.

At home you might have a game source file that looks like this:

Main.cpp
#include <GL/gl.h>

void
Object::Update()
{
// C++ game logic/AI/collision detection
...
}

void
Object::Draw()
{
// OpenGL drawing commands to render the object
...
}

int
main()
{
// Initialize OpenGL
Init();

while(true)
{
HandleInput();

for(int i=0;i<numObject;++i)
gObjects->Update();

for(int i=0;i<numObject;++i)
gObjects->Draw();
}
}

A console game very often looks very similar:

Main.cpp
#include "ConsoleAPI.h" // Defines and functions supported by the console hardware

void
Object::Update()
{
// C++ game logic/AI/collision detection
...
}

void
Object::Draw()
{
// Console graphics API drawing commands to render the object
...
}

int
main()
{
// Initialize console hardware
Init();

while(true)
{
HandleInput();

for(int i=0;i<numObject;++i)
gObjects->Update();

for(int i=0;i<numObject;++i)
gObjects->Draw();
}
}

The API header files for a particular console look very similar to the OpenGL header files, although since the hardware is fixed they tend to be more low level.

Very often the same C++ source files are shared between the console and home computer versions of games, with the rendering/input/sound code abstracted away into platform specific source files.
 
Tuttle said:
C++ plays the exact same role in console game development that it does in developing games for a home computer.

At home you might have a game source file that looks like this:

Main.cpp
#include <GL/gl.h>

void
Object::Update()
{
// C++ game logic/AI/collision detection
...
}

void
Object::Draw()
{
// OpenGL drawing commands to render the object
...
}

int
main()
{
// Initialize OpenGL
Init();

while(true)
{
HandleInput();

for(int i=0;i<numObject;++i)
gObjects->Update();

for(int i=0;i<numObject;++i)
gObjects->Draw();
}
}

A console game very often looks very similar:

Main.cpp
#include "ConsoleAPI.h" // Defines and functions supported by the console hardware

void
Object::Update()
{
// C++ game logic/AI/collision detection
...
}

void
Object::Draw()
{
// Console graphics API drawing commands to render the object
...
}

int
main()
{
// Initialize console hardware
Init();

while(true)
{
HandleInput();

for(int i=0;i<numObject;++i)
gObjects->Update();

for(int i=0;i<numObject;++i)
gObjects->Draw();
}
}

The API header files for a particular console look very similar to the OpenGL header files, although since the hardware is fixed they tend to be more low level.

Very often the same C++ source files are shared between the console and home computer versions of games, with the rendering/input/sound code abstracted away into platform specific source files.


That was a very interesting explanation, I jsut have a question wonder in my mind while i was reading your post,
Normally how big is the c++ coding for the whole games say final fantasy x for example?
 
My last console game's source code was around 10 megs uncompressed for all the .cpp and .h files for all platforms.

It was a very large project, but I don't think it is as large as one of the current Final Fantasy games.
 
dantruon said:
Then exactly what is the role/duty of c++ in the process of making a games.

Im realli confused now ppl

that's because you started with the wrong premise

I mean is everything onscreen (the graphic) Ai, physic ar.e code in c++.

most generally put, eveything you see onscreen is artwork, AKA game content. whether and how you see it, though, is a matter of game logic. so the role of c++ is to put that game logic (an otherwise abstract entity) into action. what you see onscreen then, is some data, subject to visualisation, passed to the display output device by that very game logic. is that clearer now?
 
darkblu said:
dantruon said:
Then exactly what is the role/duty of c++ in the process of making a games.

Im realli confused now ppl

that's because you started with the wrong premise

I mean is everything onscreen (the graphic) Ai, physic ar.e code in c++.

most generally put, eveything you see onscreen is artwork, AKA game content. whether and how you see it, though, is a matter of game logic. so the role of c++ is to put that game logic (an otherwise abstract entity) into action. what you see onscreen then, is some data, subject to visualisation, passed to the display output device by that very game logic. is that clearer now?

But arent game logic handled by another programming langauge namely prologue?

It getting more clearer for me by the day so thank you all for your reply.
Im eager student. :D
 
The vast majority of code in console games these days is C++, although I there are teams/companies who are writing with something between C and C++.

There are bits and piece of assembly.

Some games have script code that gets executed for game logic. Usually it is some very simple built from scratch language that has only the syntax and features needed by that game or that company's games, but it sometimes is a full-scale existing language.
 
dantruon said:
But arent game logic handled by another programming langauge namely prologue?

It getting more clearer for me by the day so thank you all for your reply.
Im eager student. :D

game logic can be handled by any language deemed appropriate by the devs, and as Tuttle said, it could even be a custom-created scripting langauge. what language devs choose is a complex topic on itself. fact is, C++ is often chosen by game devs, occasionally in combination with some other langauge(s), arbitrarily more efficient for particular layers/stages of the game logic.

ps: if you're really keen on getting into the know with this matter, i suggest you follow Blahblahblah's guidelines a few posts above.
 
Back
Top