Yandros on 28/11/2015 at 04:00
You may recall a year or so ago, I posted a screenshot of a (
http://www.wearytaffer.com/screens/dcedev/MechClassroom.jpg) Mechanist classroom in DCE. Tonight, I tried to have an AI patrol over to the podium, and she couldn't find her way there because the chairs were a bunch of small pathfinding obstacles. You might also recall a year or two ago I mentioned I had found a handy, simple solution to certain pathfinding issues, and I would post about it soon, but never did. I remembered that tonight when I used it to solve the classroom problem.
It's pretty simple, really - AI are much better at navigating one large obstacle than a dozen small ones close together, like those chairs. The trick then is to have one large object with a single physics model surrounding those chairs, so that from a pathfinding standpoint they are a large block to be pathed around, but the problem is I don't want the player to run into that object, I want him to be able to bump into individual chairs and such. Sometimes, unlike this example, the player might be able to walk between the chairs, but I don't want an AI to, or I want to block off entire paths for them so they avoid certain areas, or I want to make sure they don't get stuck on, say, a rail post, but I don't want to make its collision model bigger.
What I do is make a RailPost1 object (which already has suitable path avoid props on it), size it how I need and adjust its
Physics > Model > Dimensions to match, and perhaps set its
alpha to like 0.1 so it's barely visible in the camera viewport. But Yandros, won't the player still see it and bump into it? No! Because the other properties you add to it are
Tweq > Delete =
Destroy Obj and
Tweq > DeleteState =
On. So what that means is, its physics model counts when the pathfinding database is calculated, but as soon as you enter game mode it's gone.
I've mostly used this technique in the last scenario I mentioned above - keeping an AI from getting stuck on an object by enlarging it from a pathfinding perspective without actually enlarging the object's collision model. Yes, this does add extra objects of course, but it's well worth it to solve some annoying pathing issues like these.
My Mechanist is now happily strolling up to the podium and delivering a very long, boring sermon about Father Karras. :bored:
Beltzer on 28/11/2015 at 09:07
Thats a nice one Yandros :thumb: Its so cool when Dromed can be tricked. Thanks.
LarryG on 28/11/2015 at 14:32
Cool idea!
Too bad there isn't an approach which works the opposite. In Finals I had a need for rats to run about under some furniture that Garrett would bounce into. The solution was to give the furniture AI > Pathable Object: False and Physics > Misc > Collision Type: Bounce, and then move the furniture into solid when pathfinding and back again afterwards. That way the little rats' paths didn't know about the furniture being there, but Garrett did at game time.The problem was remembering to put the furniture back before shipping every beta build. It would be nice to have a way built in to get that done after pathfinding and before game mode the way that you can get yours deleted automagically. I forget why Physics > Misc > AI Collides With: False wasn't a solution, but I believe I tried it and it didn't work in this case.
john9818a on 28/11/2015 at 23:17
Neat idea! I've done the same with solid brushes but it was so much more work moving those brushes in and out of the player's area.
Larry I have done something similar with rats and a rat hole in the wall. I simply pathfind a regular sized doorway and then added solid brushes above the "hole" to make it look like only the rat hole was there.
LarryG on 29/11/2015 at 00:12
:laff: You posted about what you had done way back when, and it was my searching for a better solution than your approach which led me to mine! So thank you. I still hope for a better way.
FireMage on 29/11/2015 at 22:35
Yep! I know this method because I used it in chalice of soul! And Yandros didn't expect it I guess, but this method is genious because you can also use it to make AI to walk IN AIR!
The pathfinding don't care at all the gravity! Just the calculate path count. Player don't care about pathfinding but gravity.
Then, place an object exactly like Yandros did over a pit, put some AI over this object and then you'll have a guard walking in the air who will NEVER fall! :)
Yandros on 29/11/2015 at 22:55
I did know that about the pathfinding database, although I only used to do it with the solid brush > portalize > pathfinding > move solid and reportalize method. I used it in 2006 to have the haunt scouts "fly" across the canals in What Lies Below.
Tannar on 29/11/2015 at 23:54
Cheater!
FireMage on 1/12/2015 at 03:22
Quote Posted by Yandros
I did know that about the pathfinding database, although I only used to do it with the solid brush > portalize > pathfinding > move solid and reportalize method. I used it in 2006 to have the haunt scouts "fly" across the canals in
What Lies Below.
Indeed! :) But the brush method have a bad point: If you compute again the pathfinding later because you add a new room... That is avoid thanks to the object that disapear when game is starting! :)
Of course Tannar! It is cheating! xD But Dromeding
is cheating! :P
darthsLair on 2/12/2015 at 20:23
Nice Russ, and thanks. I remember this being done inside a room in "The Hammerite Developement Kit"
a large wooden bowl inverted.