- Home /
Threaded Pathfinding still lagging
Well, we have threaded pathfinding in our project, it's A* with a node grid, I thought I can outsource the calculations on other cpu cores with threading, but it's still affecting the main core. I took a look at the Windows TaskManager to see the CPU heat, and all 4 Cores are affected by the calculation. Is there any possibility to keep the Thread-Job on just one CPU core? We tried to only start one thread-job at a time, but this doesn't change anything, all 4 cores are on their limit.
thanks in advance
Edit: it's not just the pathfining, we tried it with different calculations, like filling a list of floats and a testClass in a for loop
Answer by Kishotta · Jun 21, 2017 at 07:53 PM
What are you using for threading? ThreadPool should evenly distribute jobs to other cores/CPUs. How big is the graph you're pathfinding around?
It may be worth splitting into smaller chunks and finding a path to the closest point in that chunk to your destination, and repeat when you get to the edge of that chunk (or whenever else, so long as the job is split).
The grid is not big. 100x200 nodes - and we need to find paths across the whole map - it's kind of a strategy game.
We use System.Threading.Thread
Look at the performance tracker and optimize your pathfinding. It should not be affecting your game this much.
Your answer
Follow this Question
Related Questions
Saving data question 1 Answer
My game overheats phone and terrible FPS? 1 Answer
2d game lagging 2 Answers
Multiplayer lagging in player but not in editor. 0 Answers
Animation.RebuildInternalState spike 3 Answers