PDA

View Full Version : Using Multiples PathNode



Francescu
09-01-2011, 01:19 PM
Hey there,

We put PathNodes on our map we have 2 types of Pawn following them :
- Enemies (mice)
- NPC (humans)

We want the NPC to follow one type of PathNode (to walk in the street)

We want the mice to follow another PathNode type (to walk near the building, at the bottom of houses walls)

Is it possible ?

AndyPandy
09-01-2011, 01:37 PM
There are 3 ways to get this done, by using the different scout class pathsize values. Basically making it impossible for the humans to use the narrow mouse paths. Than there is the "NetworkID" member in the NavigationPoint class, u can try to derive a new PathNode and manually set this ID to whatever. See if this prevents the 2 networks from connecting to each other, this is theoretically and i don't know if this may work.
The next option are the transientCost/ExtraCost members. They can be used to make the specific nodes so expensive that either the humans or mice cant use them. Its a bit tricky to get this right without adding a cost for every FindPathXY call for the mice and humans, just check the comments end experiment with those values and no there is no documentation on those cost members and how to use them.

bye Andy

Francescu
09-02-2011, 03:11 AM
Hi Andy,

Thanks for the tricks we'll try them, specially the one with NetworkID because it let us add a third type of Pawn. (ie. bats enemies).

How to say to a pawn to follow only one NetworkdID ?

AndyPandy
09-02-2011, 04:41 AM
Hi Andy,

Thanks for the tricks we'll try them, specially the one with NetworkID because it let us add a third type of Pawn. (ie. bats enemies).

How to say to a pawn to follow only one NetworkdID ?

I'm not really sure, but the idea would be to let the mice/human only start with a anchor on one of the nets. The other idea still involves to simply add a high transientcost to all nodes of one network so findpathXY can practically only use one of the 2 networks. U have to get a little creative here if the id really works and only allows connections between the same networkID.

I'm just switching from navmesh to nodes again, so i'm still starting to work with all those costXY members in pathnode.


bye Andy

PS: I just remembered that u can also manually forbid connections, select 2 or more nodes and select the "Pathing" options, there is a force and forbid option. So u can setup your networks like 2 railway lines and only at the beginning have to make sure your "trains" aka mice/human select the correct matching anchor entry. A cheap hack would be to make the anchor points for mice really small so humans cant use them and add a static extraCost (via editor) to all human nodes, so its "unlikely" that the mice would use them. Try ExtraCost of 10000.

AndyPandy
09-02-2011, 05:37 AM
I also just found "native function bool IsUsableAnchorFor( Pawn P );" and "event int SpecialCost(Pawn Seeker, ReachSpec Path);" both can be overridden, so u can deny specific pawn types and also add special cost to them. The only drawback is that u have to derive your own pathnodes to alter those.

Francescu
09-02-2011, 08:05 AM
native function bool IsUsableAnchorFor( Pawn P )

Thanks a lot !! That seems to be what we were looking for !!!

I'll let you know