Threaded AI: FTW

By Orion Granatir (Intel) (9 posts) on January 29, 2009 at 4:16 pm

An AI monster attacks our hero

Writing threaded AI (Artificial Intelligence) is epic?
It’s easier than you would think!

I am going to give a presentation about multithreaded AI at GDC this year. We will examine how AI can be threaded and live in a highly parallel environment. How can you thread AI? How can AI talk to physics running on another thread or device? Is deferred processing worthwhile? Do you have to thread your designers? My presentation will hopefully answer these questions and more. The presentation will end with a quick overview of Intel’s Smoke demo; Smoke is a n-way threaded framework that includes source code for highly parallel AI (you can download it at Whatif.intel.com).

Here is my tentative outline:
• The challenge – Why thread AI
• Define a Simple AI – Let’s start by defining a simple game AI
• Threading AI – Let’s thread our simple AI
• Working in a Multithread Land – Let’s look at how AI can work and live in a highly parallel environment
• Smoke: An Example – A quick overview of Smoke and it’s multithreaded AI
• Summary - Threaded AI for the win!!

Please let me know what you think.
Is there anything you want to hear about that I’m not covering?

If you are interested or working with AI/Smoke, I hope to see you at GDC!

EDIT: You can get the Smoke demo here.

Categories: Graphics & Media, Parallel Programming, Software Tools
Tags: , , , ,

For more complete information about compiler optimizations, see our Optimization Notice.

Comments (3)

January 30, 2009 7:50 AM PST


Alex J. Champandard
Hi Orion,

I'll be at GDC -- I'm heavily involved with the AI Summit already. Looking forward to your talk!

One thing I'd like to ask/discuss is whether having multi-threaded AI must imply that you loose determinism. That's probably acceptable, but if that's the case, how do we deal with non-determinism? Conversely, if the AI is deterministic, how does that limit options for threading?

Alex

P.S. There's now a thread in the forums at AiGameDev.com discussing these ideas (free registration & introduction required).
January 30, 2009 7:51 AM PST


Alex J. Champandard
Here's the link to the thread again, it didn't work with HTML:

http://forums.aigamedev.com/showthread.php?t=1997

Alex
AiGameDev.com
February 2, 2009 11:34 AM PST

Orion Granatir (Intel)
Orion Granatir (Intel)Total Points:
3,164
Green Belt
Hey Alex,

Thanks for the feedback!
I visit AiGameDev often; thanks for all your work on AiGameDev and I look forward to chatting at GDC ^_^

Multi-threaded AI and determinism is an interesting topic. I’ll integrate this discussion into the presentation (time permitting). In general, you will lose some level of determinism with multithreaded AI, but it can be controlled. Even floating-point calculation are prone to non-deterministic behavior with threads because floating-point error can be accumulated in different orders.

Enforcing deterministic behavior will generally result in some ordering using locks and queues… this could decrease performance if it’s implemented incorrectly. I’ll take a look at the forum you provided and add further comments there :D

- Orion

Trackbacks (1)


Leave a comment  

To obtain technical support, please go to Software Support.
Name (required)*

Email (required; will not be displayed on this page)*

Your URL (optional)


Comment*