C++/GAME PROGRAMMING
Expert: Ralph McArdell - 2/6/2005
QuestionCAN U TELL ME HOW CAN I MAKE GAMES USING C OR C++.PLEASE DO TELL ME IN DETAIL IF U CAN.
AnswerWell, I cannot go into too much detail as that sort of level of advice would fill several books - even assuming I knew exactly what sort of games you were thinking of developing and the platforms (hardware and operating systems) you wished your games to run on.
One note: PLEASE DO NOT SHOUT AT ME WHEN ASKING QUESTIONS!
This is a _basic_ piece of netiquette (Internet etiquette).
To a large extent the choice of language is secondary to having a good idea of what your game (let's do one at a time) will do. You need to think hard about this and have a good detailed idea of the scope of the project. You might start with something simple. For example you might start with a simple board game or a simple 3D game - just to get experience.
Next you can start breaking down the requirements into more detail.
For a 2D turn based board game you probably require fairly simple 2D graphics and an idea of how the game should be played. Of course you can always add a 3D dimension to the board and pieces if you wish.
For a 3D game with some sounds and full player 3D movement you will require a 3D library of some sort, and obviously some sound support. As your game probably uses complete scenes a library or framework that had support for such things would be useful.
In between are sprite-based games which are not like chess and not full 3D role playing games. One example is the type of game where you take turns jumping your piece over obstacles which keep scrolling in from one side as you progress. The screen saver games I did for the Wallace and Gromit CD-ROM many years ago were sprite based but were simple and used only a single 640 by 480 pixel window. In such games getting the effect you wish can require a certain amount of lateral thinking.
For multiplayer games across many machines you need some network or other communications support.
To get the computer to play the game you need to research game theory and computer game playing techniques such as the Min Max algorithm and other AI and strategy techniques.
Of course web-based games are a whole different area and probably require a whole set of different or at least additional skills and tools.
On top of these requirements for games you of course need to understand the underlying basics of computer science and software development and be familiar with the language and operating environment in which you are targeting the game.
If the platform you are writing for lacks a facility you require then you may have to provide this yourself within the game - preferably you write it as a separate component - a library or some such that can be re-used easily in other games you write for that platform. This was the case a some-time colleague of mine mentioned he did for a games company for a certain games platform. This platform did in fact have an operating system, unlike some I think. However it had no virtual memory and their game - presumable being large - required such a feature. So my friend was hired to develop a virtual memory sub system.
Oh, and of course games, particularly the complex 3D games, require many types of media resources - 3D models, sound clips, music, animations, video, bitmaps etc, etc. So you will require the tools and skills to develop and manipulate these.
So, to recap you need to have knowledge of:
Computer science and software development in general
C and/or C++ as your language of choice
The game you wish to develop
The techniques required such as
2D graphics
3D graphics
Animation and video
AI, games theory and strategy
Audio techniques
You will also require the tools to develop such software:
A C / C++ development system for the target platform which runs on the development platform. These may be the same (e.g. Windows PC is both target and development platform) - or they may be different (e.g. Symbian based smart phone is the target platform and Windows PC is the development platform) in which case it is useful to have a target platform simulator that runs on your development platform.
The SDKs (software development kits) for the various helper libraries or frameworks - such as the Microsoft DirectX SDK. An SDK includes the materials needed to use such a facility to develop with - such as library header files and documentation. It should also include redistributable components such as DLLs - and the license agreement or other product information will make it clear what you can and cannot distribute with your product and how much (if any) additional costs - such as royalties - need to be paid to the library vendor. Of course sometimes there is no formally available SDK - for example open source projects - but as you have the source code you should have every thing you require except possibly for good documentation - the quality of which tends to vary in such projects.
Note that the libraries you choose must be compatible with the C / C++ development system you use. On Windows the MS Visual C++ product is the most widely supported. If your chosen compiler and linker are not supported and the library is open source then maybe you can put in the work to make it work with your compiler and linker - and of course donate the results back to the project.
Finally you will require the tools to produce the media resources. These might include graphics packages and sound editing and MIDI sequencing software, and even good text editors.
At this point you are probably thinking this might be getting a little expensive in both time and money. Well the money part may be reduced by searching for freely available open source software and libraries. Good places to look are on SourceForge (
http://sourceforge.net) which host thousands of open source projects and on the GNU/FSF site (
http://www.gnu.org http://directory.fsf.org). Here are a few to get you going:
GNU C/C++ Compiler (
http://gcc.gnu.org
http://directory.fsf.org/devel/compilers/gpp.html)
The most popular 'free' compiler. Used to compile Linux and available for many platforms. Basic command line toolset.
Dev-C++ (
http://www.bloodshed.net
https://sourceforge.net/projects/dev-cpp)
A C/C++ development package for Windows based on the MinGW port of the GNU C/C++ compiler for Windows (included in the package).
Graphics3D (
http://g3d-cpp.sourceforge.net
https://sourceforge.net/projects/g3d-cpp)
A 3D graphics library written in C++ for games and other uses. Note: MinGW is _not_ listed as a supported compiler for Windows.
Allegro (
http://alleg.sourceforge.net
http://sourceforge.net/projects/alleg)
A library for game and multimedia development. Not sure if MinGW supported.
XConq (
http://xconq.sourceforge.net
http://sourceforge.net/projects/xconq)
An engine for turn based games. Not sure if you embed this in your game or you write your game in some sort of script and run it through the engine.
ScummVM (
http://www.scummvm.org
https://sourceforge.net/projects/scummvm)
A virtual machine for running other games as I understand it. It runs on a variety of platforms. May be of interest from the software implementation point of view.
GIMP (
http://www.gimp.org
http://directory.fsf.org/graphics/editors/gimp.html)
The GNU Image Manipulation program - presumably good for bitmap manipulation although I have never got around to using it.
The above is a quick sampling of programs and libraries from the Source Forge and GNU sites. I used "game library" with the require all words check box checked to search on SourceForge. You might like to try other searches and search for other products of interest using Google or other search sites.
Good luck and have fun.