Pathfinding with Recast/Detours and NPC on different Level menu

User Tag List

Results 1 to 6 of 6
  1. #1
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pathfinding with Recast/Detours and NPC on different Level

    Is it possible with Recast/Detours to take into account the Z-variable?
    From the source-code:
    /// Intersection tests occur in 2D. All polygons and the search circle are
    /// projected onto the xz-plane. So the y-value of the center point does not
    /// effect intersection tests.

    My biggest problem is pathing to a vendor on the second floor. The path ends right under the Vendor on the first Floor!
    How would you go about implementing a solution to this? Traceline up the stairs?

    From another Forum post people shot down another users idée of using Recast/Detour in a Pixelbot. This works really well most of the time. Considering the pathing is mostly done in 2D.
    Now I'm working on another project and I'm inprocess and got Traceline working if needed.

    Just wanted to bounce of some ideas.

    Pathfinding with Recast/Detours and NPC on different Level
  2. #2
    Bogie's Avatar Member
    Reputation
    11
    Join Date
    Apr 2020
    Posts
    17
    Thanks G/R
    8/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I haven't worked with Pixel bots before, so just to understand - is your issue that you cannot find out the z-coordinate of yourself and/or your target (vendor, in this case)?

    In principle, if you specify the start and end points correctly (including correct z values), Detour should be able to find the path just fine, including having to e.g. walk up stairs to get to the desired level, i.e. recast/detour will absolutely take z-values into account for navmesh & path generation.

  3. #3
    badusername1234's Avatar Active Member
    Reputation
    26
    Join Date
    Apr 2017
    Posts
    47
    Thanks G/R
    18/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you trying to find a path by raycasting..? Don't do that, that's not what it's for

    You need to use one of the polygon finding methods to find the polygon you're standing on and the polygon the vendor is on, then findPath will get the polygons that your path goes through. Then findStraightPath will turn that into your 'actual' path to follow.

    Whether or not you're using a pixel bot is irrelevant as long as you have all three of your position coordinates - it's extremely difficult to get them accurately by just looking at the screen, though

  4. #4
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by badusername1234 View Post
    Are you trying to find a path by raycasting..? Don't do that, that's not what it's for

    You need to use one of the polygon finding methods to find the polygon you're standing on and the polygon the vendor is on, then findPath will get the polygons that your path goes through. Then findStraightPath will turn that into your 'actual' path to follow.

    Whether or not you're using a pixel bot is irrelevant as long as you have all three of your position coordinates - it's extremely difficult to get them accurately by just looking at the screen, though
    I've been using Pathfinding with a Pixelbot before with good results. But this specific problem is with using Detour and I'm in process I got the X,Y,Z coordinates from player and destination.
    This might be a Mesh problem I'm just not that experienced with Detours Pathfinding to know why it fails to path up the flight tower in ogrimmar for example but pathing to Azhara from Ogrimmar works just fine.
    It then creates a perfect Path and uses the Flighttower to get there.

    My problem is: Pathing to Flightmaster with known XYZ and player XYZ Fails. BUT! Pathing to XYZ at the same elevation as the flightmaster but for example right outside Halls of Legends works just fine. (Path will go right up the flighttower as expected)

  5. #5
    Bogie's Avatar Member
    Reputation
    11
    Join Date
    Apr 2020
    Posts
    17
    Thanks G/R
    8/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    My problem is: Pathing to Flightmaster with known XYZ and player XYZ Fails. BUT! Pathing to XYZ at the same elevation as the flightmaster but for example right outside Halls of Legends works just fine. (Path will go right up the flighttower as expected)
    It's probably quite hard to identify the issue just with the infos given, but what I can definitely say is that Detour absolutely supports this, so it should indeed work. Meaning, it will be an issue with either your nav mesh, our your navmesh query.

    I'm assuming you're using dtNavMesh->findPath.

    First, I would double check that the end poly + the position on the end poly is the one you're looking for, i.e. the one on which your target NPC actually stands. (Presumably, you're querying the target poly + target position on navmesh throuhg dtNavMeshQuery->findNearestPoly).

    If poly & position on poly are indeed correct, have a look at the return value of your dtNavMesh->findPath call. Is the return status == DT_SUCCESS, or does it have any other flags set (eg DT_PARTIAL_RESULT)? The previous check would already encompass that, but you could also keep an eye whether the last dtPolyRef in the path you're getting from findPath() is indeed your target poly.

    As a side note, if you're using the navmesh generation tools that come with any of the usual emus (cmangos etc) - those include a customized version of the RecastDemo which allows you to debug/visualize your generated navmesh.

  6. #6
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nvm it works now... I don't know why or how but I sent the same Z-value as start and destination but right x, y values...
    Last edited by hjalplos; 07-01-2020 at 02:16 PM.

Similar Threads

  1. Path Generator – Recast/Detour and WowMapper – Step
    By RivaLfr in forum WoW Memory Editing
    Replies: 32
    Last Post: 05-13-2022, 05:38 AM
  2. [Selling] Account with a priest and warlock on Sylvanas EU
    By Gandza in forum WoW-EU Account Buy Sell Trade
    Replies: 0
    Last Post: 12-22-2015, 12:54 PM
  3. [Selling] wow account with 90 shaman and SC2 on same battlenet
    By eswa in forum WoW-EU Account Buy Sell Trade
    Replies: 2
    Last Post: 03-18-2014, 12:45 PM
  4. Stuck with Recast/Detour C# (3.3.5)
    By haku43 in forum WoW Memory Editing
    Replies: 6
    Last Post: 06-09-2012, 08:00 AM
  5. A little tip and question for gameobject's and npcs on the gameobjects
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-26-2007, 12:08 AM
All times are GMT -5. The time now is 06:08 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search