Announcement

Collapse
No announcement yet.

Custom PathNodes for each bot

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Custom PathNodes for each bot

    Hi,

    My problem is that I have pedestrian bot and a car bot. I want them to move around city model using PathNodes. I also want pedestriants to walk only on sidewalks (crossing street allowed only on zebra crossing) and cars to move only on the streets (obeing traffic rules). My city model is quite big and creating Navigation system is very boring... anyway... I want to create pathNodes that will be used ONLY by pedestrians (PedestriansNodes) and that will connect only with other PedestriansNodes, same thing for cars.

    Is it possible to do it? Or is there any way to tell your bot what kind of nodes he must use to reach destination? All path generation code is native and thats why I'm asking.

    Also my bots seems to not use green paths (described as Normal Width in UDN documentation), why is that?

    For now I'm using PathBlockingVolume to deny connecting nodes on street and sidewalk but it's not good solution when it comes to create crossroad and zebra crossing. You can see it on image below, those thin pink blocking volumes at the middle of the road

    #2
    use pathblockingvolumes between the road and the path
    edit:
    sorry i didnt read it all
    you quickly reach native functions with the path finding code, i dont know if its possible unless you write your own navigation stuff
    if anyone knows different?

    you could maybe use a dynamic volume for the crossings, dont know how..
    but you can chose the actor class that the volume affects

    Comment


      #3
      I'm not sure if I explained my problem propely. I want to create my own path node, lets name it MyNode, that when I'll build paths in editor will connect ONLY with other MyNode's. I also want them to be used ONLY by MyPawn, controlled by MyController.
      Then I want to make MyNextNode class that will connect with other MyNextNode's after building paths and that will be used ONLY by MyNextPawn, controlled by MyNextController.

      I just want to make two independent path systems.

      Comment


        #4
        Originally posted by bayzel View Post
        I just want to make two independent path systems.
        good luck with that one
        as i said, it dont take long before you reach native functions, if you dont have a licence you cant get beyond that.
        the navigation system is locked inside native functions like MoveToward, and this wont allow you to specify anything that isnt a navigation point, and pathnodes are extended from them. so if you really wanted 2 independent nav systems you would have to write your own, extending from Actor.
        heres a summary of the furthest back you can get with the ai.
        http://wiki.beyondunreal.com/UE3:Controller_%28UDK%29

        something you can try is this, found in NavigationPoint.uc
        /** indicates vehicles cannot use this node */
        var(VehicleUsage) bool bBlockedForVehicles;
        /** vehicles with bUsePreferredVehiclePaths set (large vehicles, usually) will prioritize using these nodes */
        var(VehicleUsage) bool bPreferredVehiclePath;

        Comment


          #5
          I thought so. Anyway, is there any possibility to build always only white paths?

          Comment


            #6
            i just came across 'RequiredClass' in NavigationPoint
            Code:
            static final function NavigationPoint GetNearestNavToActor(...
            blah...
            if (ChkActor != None) // this bit is just checking for actors
                {
                    // iterate through all points in the level
                    foreach
             //this bit is the class filter
            ChkActor.WorldInfo.AllNavigationPoints(class'NavigationPoint',Nav)
                    {
                        // if no filter class specified, and
                        // if nav is available to the check actor, and
                        // if the nav isn't part of the excluded list,
                        if ((RequiredClass == None || Nav.class == RequiredClass) && ExcludeList.Find(Nav) == INDEX_NONE)
                        {...blah
            im not sure if you can just put class'myspecialnavthing' or whatever in the class filter, try it
            if it works please report back

            Comment


              #7
              Thanks for reply.

              Unfortunately this function is not used during building paths and I can't afford using this function everytime my bots want to move somewhere since I want to have 250+ of them, so going through all navPoints every time it's not a good idea, at least for my computer: )

              I found something iteresting that seems to be temporary solution. I just surround all sidewalks with PathBlockingVolumes to prevent connection them with nodes on streets. After that I forced paths on opposite sides of the street to connect two sidewalks. All looks like this and works pretty good for now. Yellow paths are forced.

              Comment


                #8
                If anyone interestd in solution: I used splines to create paths for cars and regular pathnodes for people on sidewalks. It works perfect and is much more comfortable to adjust and create

                Comment


                  #9
                  hello bayzel
                  ive been trying to use splines for a while without success
                  if you dont mind me asking, how did you do it?

                  Comment


                    #10
                    Hi,
                    I can't paste my code here but I can explain how to do it. I read about it on forum and I dont know why people find this difficult, anyway what you need is:

                    1. 2 Splines actors (start and goal)
                    2. in MyAIController get reference to both of those Splines
                    3. function that will find path from start to goal and save this path in array (its in SplineComponent.uc: ) )
                    4. function that will give you location along spline with given Distance (in SplineActor.uc; ) will return DestinationMovePoint)
                    5. increase Distance and get new DestinationMovePoint every tick or every 0.3 second to make your move progress
                    6. Function that will move your Pawn to DestinationMovePoint (just look at AI technical guide at UDN and decide which one will be best)
                    7. few more improvements; )

                    thats the basic idea, hope you get it now, if not just let me know

                    Comment

                    Working...
                    X