Streamlining Memory Usage
by Bob Verity · in Torque Game Builder · 06/24/2010 (7:40 am) · 2 replies
Hi,
I have a very memory-hungry pathing algorithm in my game. When I command a character to move somewhere the algorithm expends all my computer's memory finding the best path and then makes the character walk it, resulting in the game freezing and then unfreezing when the character starts moving. I'd rather it took longer finding the path but allowed other things to happen at the same time.
I guess what I need is some kind of memory cap on the algorithm so that it never hogs all of my computers resources, or maybe I need to manually put breaks into the algorithm allowing other things to happen?
Any ideas would be greatly appreciated
Cheers
I have a very memory-hungry pathing algorithm in my game. When I command a character to move somewhere the algorithm expends all my computer's memory finding the best path and then makes the character walk it, resulting in the game freezing and then unfreezing when the character starts moving. I'd rather it took longer finding the path but allowed other things to happen at the same time.
I guess what I need is some kind of memory cap on the algorithm so that it never hogs all of my computers resources, or maybe I need to manually put breaks into the algorithm allowing other things to happen?
Any ideas would be greatly appreciated
Cheers
#2
Have you tried precomputing your paths and caching the results in a LUT? This technique works very well for maze type games.
c'ya
Alain
BTW, don't do pathfinding in script!!!
06/24/2010 (12:25 pm)
Sounds to me like you need a better algorithm. ;-)Have you tried precomputing your paths and caching the results in a LUT? This technique works very well for maze type games.
c'ya
Alain
BTW, don't do pathfinding in script!!!
Torque Owner RollerJesus
Dream. Build. Repeat.
Hard to say though without seeing any scripts.