Game Development Community

dev|Pro Game Development Curriculum

Crank Up Your Game with Threads

by Javier Canon · 07/17/2009 (10:09 am) · 2 comments

(From intel visual adrenaline)

Show us how you turn up the heat and rock on with threading in your games! We know that a correctly threaded game can have dramatic visual effects, more accurate physics, smarter AI, and faster frame rates.

Haven't yet gotten into threading? No worries. Click on the thumbnail below to get started threading your AI with the white paper Two Brains Are Better Than One. Then check out our Thread Like Wildfire program.
Been threading for awhile now? Great! Show us how your threading rocks!

www.intelsoftwaregraphics.com/?lid=zQSbR/i0WxQ=&siteid=Qa9s/6SYM4M=

Two Brains Are Better Than One

Whether you're developing a complex system of AI or a simple scripting engine to drive your gameplay, your AI will benefit by using the entire CPU-and that means threading.
In this white paper, Intel's Orion Granatir, senior engineer in the Visual Computing Software Division and technical lead on the Smoke demo project, shows how-by properly sturcturing collision and pathfinding-adding threading to your game AI can be easy.

Download the Smoke Demo here!:
software.intel.com/en-us/articles/smoke-game-technology-demo

The question is:
¿how easy is to implement this in torque engines?
¿TGEA and T3D current threading implementation is better than Intel threading?

#1
07/18/2009 (2:19 am)
Hi Javier,

Some time ago I was reading about the Intel threading library which you mention in this blog but never thought about using it for improving TGE.

This library is particularly interesting because it handles multithreading as mini tasks making possible for single threaded (single core) applications to use all the cores in modern platforms. Seen in other way, it makes possible to write a single threaded app and make it run in multiple cores with minimal changes in the code logic by allowing the cores to crunch through expensive portions of code like math heavy functions.

This is really different to a MT game where you work tasks as complete threads, meaning you have a thread for AI, a thread for physics, a thread for scene management, a thread for networking, a thread for input and a thread for rendering. So each thread works on a large subsection of the engine as an independent module. The problem in this kind of systems is implementing the appropiate mutexes for the shared memory sections.

Now, the Torque engines are inherently single threaded. I dont know if this has changed with T3D as I dont have a license but if it keep the logic of its predecessors then it should be single threaded.

The good part is that as I mentioned at the begining, this library is ideal to improve this case. I havent tried but I would start on a non critical system like the particle system. Particles are fairly common on any game and handling the creation, destruction and rendering of particles as multi threaded may improve the performance. In TGE at least particles are handled one by one and they share the same render states so try creating a simple scene with lots and lots (millions) of particles and run as single threaded. Then go to the renderparticle methods and adjust them with the Intel library and run again in order to benchmark the difference.

Luck!
Guimo

#2
07/18/2009 (1:33 pm)
Thanks Guimo, starting with particles system is a good idea, maybe you can find useful the smoke demo...