- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 this
loop()
{
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!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know this is a pretty old thread, but...
For your mode updating, try something like this:
[cpp]#include <...> // Other includes
#include
using namespace ... // Other namespaces using namespace tbb; // ...update()
{ parallel_for(Nodelist.begin(), NodeList.end(), [=](ModeIter it) {(*it)->Update(fTick); }); }
//...[/cpp]
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page