Agent threads and spatial movement


I am having some problems understanding how I am supposed to move things about and refresh their positions on the screen.
To make a very brief description, I have about 200 threads of agents that are supposed to move on a navmesh by themselves, based on real-time decisions such as goal changing and collision avoidance.
How should I go about displaying their spatials on screen, while simultaneously refreshing their positions (moving the spatials) based on the agents’ positions on the navmesh.
I’ve tried using MotionPaths to make things ‘move’ but that kind of movement isn’t exactly what I need, because the way it works limits the actions I can do with the navmesh, because otherwise I might risk have the ‘taking off’ the navmesh and fly around erratically. I need “something” that repeatedly asks each agent for its position and refreshes the display once every x milliseconds based on that position.
I imagine people have bumped into this problem in the past so I suppose the answer is well known, but I’m really in the dark.

Any ideas ?

Thank you!

Push or Pull.

All movement of spatials has to be done on the render thread.

So either you enque the movements to the render thread from the agents (could be as simple as using app.enqueu or you could have a queue of movements and an app state to process them). Or you have some sort of state record kept that the render thread parses when it needs to update the spatials to move them.

It sounds like all you need is for your render thread to loop through the agents getting their position and updating the scene graph.

Our MT docs pretty much give this example exactly: