Skip to main content

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). 

idLib

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:

  1. The math code (still basically the same).
  2. The geometry code (idWinding has been extended somewhat, as well as idRenderMatrix).
  3. The LangDict code (much of the format has changed on the filesystem side however).
  4. The RenderMatrix code is unchanged.
  5. idStr (the destructor is now virtual, otherwise identical).
  6. idHashIndex is identical.
  7. The bv code is still around.
  8. The thread code is the same, as well as the Signal code.
  9. BitMsg is the same, as well as Parser and Lexer.
  10. idMapFile changed a bit for Eternal, a lot of virtual inheritance is used now. In 2016 it is identical.
  11. RectAllocator is still the same.
  12. 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:

  1. The SWF Gui code is basically identical to id Tech 4 and 5.
  2. 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.
  3. sysEvent_t and usercmdgen are still very similar to the idTech4.5 version.
  4. The inheritance structure for idBufferObject is still the same, although there are new buffer types.
  5. idImageManager and idImage are still around, but very different. The interface to them is still pretty similar.
  6. The LWO file loading code is very similar to the idTech 4.5 code.
  7. The DXTEncoder / Decoder thread is very similar.
  8. idRenderModelManager became idStaticModelManager.
  9. srfTriangles_t became idTriangles.

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.