Game Development Community

Source Code Tutorials?

by Daniel Balmert · in Torque 3D Professional · 03/21/2012 (10:34 am) · 4 replies

Does anyone know if there are any high level walkthroughs or documentation on the source code for T3D?

I don't have any specific questions about the source code, but it'd be nice to have some sort of grasp of the flow. For example - How do the MoveManager, the GameConnection, the Player and the Camera interact?

Are there any resources that explain how to add to the source and implement new objects, methods, and console stuff?

What about packing/unpacking? What do I need to know about it?

I understand these are very high level questions, but my C++ is really rusty and the source is a lot worse about commented documentation than scripts.

#1
03/21/2012 (1:29 pm)
You can get the engine reference manual by running the generateEngineReference.bat batch script in C:\Torque\Torque 3D 1.2\Documentation\ directory and it will take a while to generate it as doxygen will be processing the entire C++ source code to create the reference documentation. It takes my Q6600 machine 16 minutes to create the Torque 3D - Engine Reference.chm file. That's as close to a tutorial guide of the engine's internals you'll get.

As for everything else you'll probably just have to learn the engine by example by reading through various existing resources on engine modifications and seeing how existing classes and such are done as I've had to do over the years.
#2
03/21/2012 (1:38 pm)
I just noticed that you're using Torque 3D 1.1, so in that case you'll need to create a generateEngineReference.bat file yourself and then paste this into the content of it:
@echo off

IF EXIST "EngineReference" rmdir /S /Q "EngineReference"

cd "..\Engine\bin\doxygen"
doxygen.exe engineReference.cfg
cd "..\..\..\Documentation"

xcopy "..\Engine\bin\doxygen\images\*.*" "EngineReference\images\" /E /Y /F

del /Q doxygen.log

del /Q "EngineReference\*.map"
del /Q "EngineReference\*.md5"
del /Q "EngineReference\*.dot"

cd EngineReference
"..\..\Engine\bin\doxygen\hhc.exe" index.hhp
cd ..

move /Y "EngineReference\Torque 3D - Engine Reference.chm" .\

Now you'll be able to generate the engine reference documentation as T3D 1.1 Pro (Final) came with everything else necessary to do it with.

Note: that you will still need to place that bat file into Torque 3D's documentation directory in order for it to execute correctly, which is normally at C:\Torque\Torque 3D Pro 1.1\Documentation if you let Torque install on the C:\ drive.
#3
03/21/2012 (2:21 pm)
Ah! that would help. Thanks a lot for the .bat - I'll try it out when I get a chance.
#4
03/21/2012 (4:56 pm)
Also, for anyone interested, checking out the TGEA documentation covers a LOT of the engine architecture (very similar to T3D). I'm reading a bunch of info here :

http://docs.garagegames.com/tgea/official/