Game Development Community

Some information about DNT (Topics: Multithreading and performance)

by Lukas Joergensen · in General Add-On Discussion · 11/22/2012 (7:40 am) · 0 replies

Original conversation here
I had a long conversation with Vince in the newest and coolest IM ever released! Visual Studio 2012.. He were debugging some DNT related code on my computer using TeamViewer and we fell into a chat using comments in the C# code.

During this chat, alot of useful information came up! I want to highlight some of that information here:
We were talking about how you would need to lock the engine before tinkering with the engine, so the first question is about the fact that DNT is actually a multithreaded version of DNT:

[ME] Would DNT apart from being faster than TS (due to TS parsing time) have increased performance due to the multithreaded nature of DNT`?
[VINCE] Funny you ask, the short is yes, the ai that is in this build can handle 75-100 ai at the same time shooting each other and such. Doing the same thing in TS it was about 25 ai.

[ME] Speaking of functions that is slow due to the engine having a little crappy scripting performance, will the TS improvements which is sparkling on the repo on GitHub, improve DNT aswell?
[VINCE] They should to a point, since the callback from c++ to csharp is handled through the console. Just calls from CSharp to C++ are direct pinvokes

[VINCE] The other performance gain via dnt is that you also must remember that CSharp is compiled into IL which is simulated machine language and you for all intensive purposes are running a DLL versus some scripting simulator written 10 years ago
[ME] Yes that is the most obvious performance gain (which I think people tend to believe is the only performance gain)
[VINCE] Well that and ansync is the real grabbers, the rest is really just niceities

For those who don't know what DNT is:
WinterLeafEntertainment website
Quote:DotNetTorque (DNT) is a C# enhancement written by WinterLeaf Entertainment, L.L.C. for the sole purpose of replacing the TorqueScript console inside of the T3D Game Engine from GarageGames.com. It provides the ability to manipulate the engine from C# instead of using the native TorqueScript script language. The goal was to simplify game creation by allowing game developers to be able to leverage the plethora of C# libraries available on the market today inside the T3D engine.