Pathfinding in The Incredible Adventures of Van Helsing, Media
-
Category: News ArchiveHits: 1574
And here's a snip from the blog entry itself:
So the list of instructions goes like this:Oh, and if you're up for a closer look at the game's inventory management, we have a brand new screenshot depicting as much over in our image gallery.
'¢ the creatures have exact targets; they have to reach it and fast using the shortest possible way
'¢ the creatures should avoid each other (unless it slows down the game)
'¢ the creatures have to be able to find distant targets (and the hero must do it very quickly, (without hesitation))
'¢ gamepad controls
.and we shouldn't forget my favorite guideline of all times: it must look fabulous! =)
I went straight for my bag of tricks to solve the tasks above, and I succeeded. In case you wondered the most useful trick for this occasion is called multilevel pathfinding! Which basically means that on the first level the creatures try to avoid obstacles by following an ancient and secret formula =). They only calculate a pathway to a temporary target at one time, which hopefully leads them closer to their targets.
Unfortunately we can't grant multilevel pathfinding to a few hundred all creatures at the same time we would need a power plant! Which basically sucks, because all creatures should be able to find pathways to distant targets. Fortunately this isn't a big deal: we only grant multilevel pathfinding to a few chosen creatures at the same time, while the others are restricted to the second level. We constantly rotate the lucky ones, so no one could monopolize the opportunity. With this solution I reached the given goal, namely that all creatures will find their way to any reachable destination sooner or later and without reducing the FPS significantly.