id Tech 4.5 as a reference
Doom 3 BFG is now fully open-source, and can be helpful as a reference. The source code for Doom 3 BFG is available on the id Software github here: https://github.com/id-Software/DOOM-3-BFG
Doom 3 BFG Edition is a mix of id Tech 4 and 5 code. A great deal of this code has carried over all the way to Doom 2016 (id Tech 6) and Doom Eternal (id Tech 7).
The idLib project contains many data structures and algorithms that are still used in the latest versions.
The most intact parts of the code are:
- The math code (still basically the same).
- The geometry code (idWinding has been extended somewhat, as well as idRenderMatrix).
- The LangDict code (much of the format has changed on the filesystem side however).
- The RenderMatrix code is unchanged.
- idStr (the destructor is now virtual, otherwise identical).
- idHashIndex is identical.
- The bv code is still around.
- The thread code is the same, as well as the Signal code.
- BitMsg is the same, as well as Parser and Lexer.
- idMapFile changed a bit for Eternal, a lot of virtual inheritance is used now. In 2016 it is identical.
- RectAllocator is still the same.
- the idParallelJobManager class still exists, but joblists are instead JobChains and those function very differently.
Game code differences
Here is a list of known similarities or differences to Doom Eternal code vs Doom BFG Edition:
- The SWF Gui code is basically identical to id Tech 4 and 5.
- The way events are dispatched is very different now. Instead of using eventmaps, id Software programatically generated the event dispatching code for each entity type.
usercmdgenare still very similar to the idTech4.5 version.
- The inheritance structure for
idBufferObjectis still the same, although there are new buffer types.
idImageare still around, but very different. The interface to them is still pretty similar.
- The LWO file loading code is very similar to the idTech 4.5 code.
- The DXTEncoder / Decoder thread is very similar.
Note: This page was originally written by Chrispy. It was recovered from the now-deleted idTech 7 wiki, and copied here for preservation. This information may be incomplete and needs further details to expand upon it.