Tools to write 3d Graphics games and Legacy Games

April 1, 2008

Tools to write 3d Graphics games and Legacy Games

Tools to write 3d Graphics games and Legacy Games.

Writing 3d graphics games and legacy games are 2 distinct tasks.
While graphics games requires some knowledge of graphics driver APIs some high level helper 3d engines and their layout of helper classes, legacy games can be written with a very simple user interface in languages like C++, java with a well thought gaming algorithm at the back end.

To know how to write something which our familiar Windows or for that matter Linux PC will understand, is the first step.
There are many a ways to write something which our operating system (if we may propose a short term for our Windows, Linux….) can interpret.
Starting from very low level, a very crude way like assembly code, to a bit more human readable native applications written in languages like C, C++ and Java, could be our array of choices if we are thinking to write a game.
But to create the 3d objects running around, we need to get our hands on to 3d engines, 3d graphics drivers and 3d accelerators.
On the contrary if you want to write a chess game, or pinball, then the 3d graphics usage wouldn’t be necessary.
We could use some simple widget toolkits provided by Microsoft as a part of it native C++ programming library or if you choose Java (which has an inherent advantage of writing once and running on an operating system), you could use the Swing library or the java SWT library to make simple GUI applications.
Never the less card games and chess do require a good game algorithm to cover all possible cases of moves of a player.
To make the computer read the moves of a particular player and guess probable next moves, often game programmers incorporate some intelligence using genetic programming or genetic algorithms.
It is basically starting the game knowing nothing about the gamer and as he plays through; his moves for different scenarios are noted.
You could just Google for the terms SWT, Swing, Microsoft Foundation Classes (MFC) to find some of the tutorials, which help you writing graphical user interface in Java/VC++.

3d graphics rich games have a somewhat different story behind them.
Creating a wide array of guns, indoor and outdoor maps, animations, playback tracks, animated figures make up a large part of writing first person and 3rd person shooters like Wolfenstien and Max Payne.
While in case of strategy games what it takes to bringing them in front of you with a near to real look and feel are basically 2 things: a detailed study of the races and the warrior tribes and building the 3d objects, which look like the way they looked, creating buildings and monuments they built and last but not the least shaping up maps and terrains which are like the ones they lived in.

It is done by using a 3d engine in your game application code, which delegates the 3d drawing and rendering of the objects to another set of relatively lower level graphics drivers.
Yes the latter are the familiar Direct X, OpenGL or X11 versions we have to load into our machine so that the game can run.
Now does that sound weird? It’s not that kind of rocket science.
Basically when you buy a game what you buy is a set up disks, which have the installation, set up of the game for a particular operating system or a set of operating systems, which you install to some directory in your hard drive or you play from the disc itself.
The thing, which actually runs, is the executable file of the game.
The game programmers namely the people at Ensemble Studios, write a huge program or code in some language say c++, using their 3d engine API suit.
This suit is basically a collection of classes and methods (terms common for any object oriented programming language) which are a kind of helpers to do a certain work like loading a map, moving a object from one point to other at the stroke of a key or click of a mouse, checking for collision avoidance, moving animated objects, creating animated objects etc.
But they library does not know any magic to make it happen.
It actually breaks up each of those operations into several steps which the underlying 3d engine like Direct X or OpenGL can understand and delegates them.
The engines do rest of the drawing.
How to use those 3d API library customized for gaming applications, how does the Direct X engine work are separate topics of study and demand organized tutorials each.
OpenGL and Direct 3D tutorials are available in the net at many locations. Here are some of which I have encountered.
There are many open source free 3d helper libraries like i discussed.
One of the free 3d engines I have seen is IrrLicht. Its written in C++ and the beauty is that it has a very small dependency on the graphics driver we are using.
That means that if you write a game application using IrrLicht, and you test it in your windows machine where u have direct X installed.
That same game of yours could run on a Linux machine where OpenGL is installed with a very small effort.

The tools required for a 3d game to program is basically a 3d world and level editor which is nothing but a studio to edit and make animation files and to shape 3d objects.
The second thing you need is an Integrated Development environment for C++ where you would actually write the c++ code.
The 3d engine library you are using should be linked to the IDE.
To have sound effects in the game separate tools are there. They let you add mp3s and some other supported encoding to be played back within you code.
The details of how to do them are library and IDE specific. Here, it was intended to give a general overview of the steps in designing your own game.