Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get started when trying to understand the code of a 3D game engine (like id Tech 3)? [closed]

Tags:

c

game-engine

I'm a C# developer for the most part. Back in college I had classes on C/C++ so I "know C" and that's a good chunk of the reason I'm a C# developer.

However I've never had the chance to code in C/C++ professionally and I'd like to study how a modern game engine works, along with how an industrial grade C/C++ app operates.

The problem is, I have no idea where to start. As in, I downloaded the Quake 3 engine source code (which has been retronymed id Tech 3) and I'm not even sure where to start with it.

How should a sheltered C#/WinForms attack a massive C codebase like id Tech 3 or some other massive AAA engine?

like image 696
Tom Kidd Avatar asked Aug 24 '09 19:08

Tom Kidd


People also ask

What game engine uses C++?

The free game engines that use C++ are: CryEngine, Esenthel, G3D Innovation Engine, Godot, idTech, Irrlicht, Leadwerks, Limon Engine, Lumberyard, Lumix Engine, OGRE, Panda 3D, PhyreEngine, Source Engine (free if your game is free), Torque 3D, Toy Engine, Unigine, Unreal Engine, and Urho3D.

How long does it take to program a game engine?

Game Engine development can take anywhere from a couple of days, to years. The expertise needed to make a small functional engine is a lot higher than the expertise needed to make a small functional game from an existing engine (keep that in mind). As an example, I made a 2D engine in about 6 months.


2 Answers

Try to do the simplest 3d "Hello World" program that uses the most basic subset of the engine. That will probably teach you loads.

With big code bases it's best not to try to learn everything all at once. Just dive in with a very specific question that you need to answer to yourself (or can search for on the internet), or a very specific task that you need to accomplish. This approach gives you the purpose and motivation you need to actually do some programming. The learning will come by itself.

like image 126
Inshallah Avatar answered Sep 21 '22 16:09

Inshallah


Writing a mod would be a good starting point.

Start on charted territory: The vanilla game. Change stuff. Look at the grenade bounce code. Make it bounce further. Add client-side prediction (which non-bouncy projectiles already have).

Add a teleport weapon. It will tell you more about collision detection than you'd like to know.

There are a few key functions that handle most of the game: The engine exports, the trap_* calls. It might help a great deal to know what exactly mods are doing with them before opening up the engine code and looking at their implementation.

For example, it might tell you more about the engine to know that you need to call LinkEntity every time an entity moves or otherwise its position in the game BSP tree is not updated and subsequent engine calls might ignore it, than to know exactly how the tree is stored and accessed.

like image 33
aib Avatar answered Sep 21 '22 16:09

aib