Looking for some guidance on my game engine task manager.

Looking for some guidance on my game engine task manager.

Hi community,I'm looking for some solutions for threading my game engine.Currently this is how I have my system setup.I have a main loop, like thisloop(){update();renderAll();}In update, it essentialy goes through the node list and calls update for every node.for (NodeIter it = NodeList.begin(); it != NodeList.end(); ++it) { (*it)->Update(fTick); // This handles AI and other updates }In renderAll(), it basically checks that objects are in view and renders them.Now the reason I want to thread this game engine is because I have recently started implementing a heavy AI system and it's starting to slow down my game a bit.Physics is handled by Havok and already multithreaded.I can have thousands of objects on the screen, but when I start to do intensive AI it slows down a little.Anyway, I have looked through Smoke, Nulstein andTaskingGameEngineAnimation material. They all have a different way of doing the threading.Anyone have any recomondations on how to use TBB for threading.Sorry this post looks a little messy, I'm in a rush to post it and I'll be back later to update it.Thanks all!

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I know this is a pretty old thread, but...
For your mode updating, try something like this:

#include <...> // Other includes
#include 
using namespace ... // Other namespaces
using namespace tbb;

// ...
 update()
{
   parallel_for(Nodelist.begin(), NodeList.end(), [=](ModeIter it) {(*it)->Update(fTick); });
}

//...
t3h p3ngu1nz 15 b4k

Leave a Comment

Please sign in to add a comment. Not a member? Join today