Detour ist not Detouring right menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    berlinermauer's Avatar Master Sergeant
    Reputation
    3
    Join Date
    Mar 2010
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detour ist not Detouring right

    Hello Guys,
    I now have completed the Building of Navmeshes, however the walking does not work very fine.

    Code:
    UInt32 startref = q.FindNearestPolygon(Start.ToRecast().ToFloatArray(), new MyVector3(1.5f, 1.5f, 1.5f).ToFloatArray(), f);
    if (startref == 0)
    {
         Log.Output(rtbMain, "ERROR: FindNearestPolygon() failed for Startref. Position was: {0}", Start);
         Application.DoEvents();
         return;
    }
    
     UInt32 endRef = q.FindNearestPolygon(Temp.ToRecast().ToFloatArray(), new MyVector3(1.5f, 1.5f, 1.5f).ToFloatArray(), f);
     if (endRef == 0)
    {
         Log.Output(rtbMain, "ERROR: FindNearestPolygon() failed for Endref. Position was: {0}", Temp);
         Application.DoEvents();
         return;
     }
    
    
    status = q.FindPath(startref, endRef, Program.objectManager.CurrentPlayer.Location.ToFloatArray(), Temp.ToFloatArray(), f, out hops);
    if (status == DetourLayer.DetourStatus.Failure || hops == null)
    {
       Log.Output(rtbMain, "FindPath failed, start: " + startref + " end: " + endRef);
       Application.DoEvents();
       return;
     }
    
    if (status.HasFlag(DetourLayer.DetourStatus.PartialResult))
    {
       Log.Output(rtbMain, "Warning, partial result: " + status);
        Application.DoEvents();
     }
    
    float[] finalPath;
    DetourLayer.StraightPathFlag[] pathFlags;
    uint[] pathRefs;
    status = q.FindStraightPath(Start.ToRecast().ToFloatArray(), Temp.ToRecast().ToFloatArray(), hops, out finalPath, out pathFlags, out pathRefs);
    if (status.HasFlag(DetourLayer.DetourStatus.Failure) || (finalPath == null || pathFlags == null || pathRefs == null))
       Log.Output(rtbMain, "FindStraightPath failed, refs in corridor: " + hops.Length);


    I tried to trace that error back and ended up with this:


    Sorry for the bad video quality :/

    Detour ist not Detouring right
  2. #2
    ostapus's Avatar Active Member
    Reputation
    60
    Join Date
    Nov 2008
    Posts
    180
    Thanks G/R
    3/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what exactly you don't like there ? from video - hard to tell what's wrong, on the picture however i dont see any issues, if you refer to the area you circled - just dont display (hide) original geometry to clearly see if area you circled out is walkable (and most likely it is walkable).

  3. #3
    berlinermauer's Avatar Master Sergeant
    Reputation
    3
    Join Date
    Mar 2010
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I don't like that the whole abbey doesn't seem to contain polygons (as you see in the video).
    As well: You see on the picture some kind of detours (red) the character does instead of using the path RecastDemo generates. It walks some kind of Triangle, where the hypothenusis (?) is the correct path, and it is walking the other two.

    Is the Quality the Problem? (I am about to upload a new one, but it takes aprox. 4 hours :/)

    As well if the Path is just straight walking forward it sometimes cannot generate the whole path.
    Last edited by berlinermauer; 11-02-2012 at 04:41 PM.

  4. #4
    ostapus's Avatar Active Member
    Reputation
    60
    Join Date
    Nov 2008
    Posts
    180
    Thanks G/R
    3/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    regarding abbey - try to dump geometry to .obj file and generate mesh in recastdemo with same parameters. if walkable area is there - well, then something wrong with mesh generation in meshReader (or w/e you use to generate mesh), another approach - hack recastDemo to load not .obj text files but rather to load .mesh files generated by meshReader. 3rd approach - try to load mesh in meshDisplay , to visually check what has been generated.
    5. try to increase extend (Y) value, maybe you findpolygon failed coz extends are too small.

  5. #5
    berlinermauer's Avatar Master Sergeant
    Reputation
    3
    Join Date
    Mar 2010
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used the third approach:


    Somehow It doesn't look good valid. It looked similar to the Error where the Triangles where wrong indiced, but I couldn't repair it...
    Does anyone know the solution?

    Edit: According to meshDisplay I have it working
    The obj-File needs Triangles to be one-based and Recast-Itself needs them to be 0 based?!

    Edit: Now I am only stuck at every edge in a Building. How can I fix this?
    Last edited by berlinermauer; 11-02-2012 at 08:21 PM.

  6. #6
    ostapus's Avatar Active Member
    Reputation
    60
    Join Date
    Nov 2008
    Posts
    180
    Thanks G/R
    3/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by berlinermauer View Post
    I used the third approach:


    Somehow It doesn't look good valid. It looked similar to the Error where the Triangles where wrong indiced, but I couldn't repair it...
    Does anyone know the solution?

    Edit: According to meshDisplay I have it working
    The obj-File needs Triangles to be one-based and Recast-Itself needs them to be 0 based?!
    , meshDisplay is not looking good. looks alike you have not overlapping tiles

  7. #7
    berlinermauer's Avatar Master Sergeant
    Reputation
    3
    Join Date
    Mar 2010
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I fixed it. The Problem was that Recast wants 0-based Triangles but RecastDemo wanted 1-based Triangles.
    Now I am having the Problem, that Recast always generates the perfect path, hence it is moving along the walls.
    I could increase the Radius again, but that will cause that I cannot walk through some doors.
    Is there maybe a Parameter like "MindDistanceToWall = 5.0f"?

    And What If I am walking through several Tiles. How to get the Tiles in between (Like If I have three Tiles: Start, End and some inbetween?)

  8. #8
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    If you are asking how to know which tiles need to be loaded in order to complete an arbitrary path, there is no nice way to do it. The simplest method would be to have a steadily increasing radius around your current and destination positions. Keep loading tiles within that radius and incrementing the radius until the pathfinding is successful. That is a bit of a kludge, though. Why not just load the entire continent?

  9. #9
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ostapus View Post
    Why not just load the entire continent?
    Pff we live in the the time where we have 32Gb of RAM and even more, huh?

    First of all does he have to increase the buffer and all these settings because Recast isn't able to create long paths on its own, so there's no need to load that kind of many tiles since the pathgeneration would fail anyways

  10. #10
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    If loading the entire continent is consuming 32Gb of RAM, you're doing it wrong. If memory serves, all of Azeroth was around 300Mb for me.

  11. #11
    berlinermauer's Avatar Master Sergeant
    Reputation
    3
    Join Date
    Mar 2010
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok so if there is no easy way to do, I will have to mess around a bit.

    But how can I force some Distance to Obstacles using Detour? The easiest way would be setting Radius to 4.0f but then I wouldn't be able to enter any building, so is there a way to force a Wall Distance?

  12. #12
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    If loading the entire continent is consuming 32Gb of RAM, you're doing it wrong. If memory serves, all of Azeroth was around 300Mb for me.
    ... That actually should show that the RAM isn't such a limited ressource anymore. But now multiply your 300Mb with 15 Bots and you reach a total RAM-Usage of 4,5 Gb...

  13. #13
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As It was said in some thread by some cool guy, you can dramatically reduce the size of navmeshes excluding unreachable (from some point like start location) polygons.

  14. #14
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Empted View Post
    As It was said in some thread by some cool guy, you can dramatically reduce the size of navmeshes excluding unreachable (from some point like start location) polygons.
    I've also read that in the past, but that will cause some trouble in areas where you're able to use a flymount. Just think of the area above the Plateau of Elements in Nagrand where the 4 types of Elements are located. This area is only reachable via flymount and would be eroded with your way.
    Of course would it be possible to manually add or remove areas, but I don't think that it would be worth the effort. I've thought about various methods to reduce the size of the meshs and achieve a longer path while keeping low costs, but came to no good solution.

  15. #15
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Frosttall View Post
    ... That actually should show that the RAM isn't such a limited ressource anymore. But now multiply your 300Mb with 15 Bots and you reach a total RAM-Usage of 4,5 Gb...
    Why would you load the same data 15 times?

Page 1 of 2 12 LastLast

Similar Threads

  1. All bots down, GOOGLE API not stable right now
    By Alfandi91 in forum Pokemon GO Hacks|Cheats
    Replies: 13
    Last Post: 08-08-2016, 03:57 AM
  2. Do not have rights for contributor forums anymore
    By Dragonef22 in forum Report Bugs
    Replies: 1
    Last Post: 12-04-2014, 04:55 AM
  3. Frozen Shadoweave Robe -> Nightmare Vestment Robe (Why not done right? :S)
    By R0w4n in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 08-18-2007, 05:02 AM
  4. BLPs not working right
    By kody_ in forum WoW ME Questions and Requests
    Replies: 9
    Last Post: 08-08-2007, 01:04 PM
All times are GMT -5. The time now is 11:36 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search