From .obj to .navmesh menu

User Tag List

Page 1 of 6 12345 ... LastLast
Results 1 to 15 of 77
  1. #1
    Millow's Avatar Member
    Reputation
    5
    Join Date
    Mar 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    From .obj to .navmesh

    Hi guys,
    I've manage to convert single .obj file to .navmesh using the Sample_TileMesh.cpp file and calling SaveAll at the end of the handlebuild function in the recast demo code. It works fine but it would be way too long to convert each object file this way. The object files were extracted using wowmapper.

    I've been trying to do it with my own code but I can't seem to get it working properly. I'm not setting the parameters correctly. Here's the code I'm using. I know that somewhere in the I should set the parameters but I don't know where to avoid having recast reset them to other values...
    int _tmain(int argc, _TCHAR* argv[])
    {
    std::cerr <<
    "Création de la mesh !" << std::endl;
    dtNavMesh* m_navMesh =
    new dtNavMesh();
    Sample_TileMesh* STM = new Sample_TileMesh();
    BuildContext ctx;
    STM->setContext(&ctx);
    InputGeom* geom =
    new InputGeom;
    std::cerr << "Load l'objet" << std::endl;
    geom->loadMesh(&ctx,
    "C:\\Users\\Millow\\Desktop\\Azeroth\\32_48.obj");
    Sample* SampleInstance =
    new Sample();
    STM->handleMeshChanged(geom);
    STM->handleBuild();
    STM->saveAll("C:\\Users\\Millow\\Desktop\\Azeroth\\32_48.navmesh",m_navMesh);
    std::cerr <<
    "Succes !" << std::endl;
    char c;
    c = getchar();
    return 0;
    }
    Now my question is, where should I set the parameters. I'm using the ones suggested by namreeb and I tried setting them inside the handlesbuild() function, but it doesn't work properly. The mesh is created but it's always 1k, so there is a problem with the params somewhere in the params structure creation.
    Anyone has any suggestions/tips/code snippet that could help me. And yes, I did read pretty much everything I could find about navmesh creation, I'm still working on fixing this but it's long ans frustrating ! So any help is welcome.
    Cheers !
    "What can be asserted without proof can be dismissed without proof." --- Christopher Hitchens

    From .obj to .navmesh
  2. #2
    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)
    You shouldn't really be using Sample_TileMesh.cpp. You should use it as a sample to show you how to write your own code to interface with the API.

  3. #3
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd be interested to know more about this as well. I'm a bit confused on how to generate a nav mesh for an entire area, or an entire continent.

    Mainly b/c I don't know how to stich all of these .obj files together
    https://tanaris4.com

  4. #4
    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're making .obj files, you're doin-it-wrong. You can hook your parser directly up to Recast to generate a mesh. A continent will be divided up into tiles. Each file will be a file you save by basically copying the mesh structure from within Recast bit-for-bit to the disk. Then later you can read it in by reading bit-for-bit.

  5. #5
    Millow's Avatar Member
    Reputation
    5
    Join Date
    Mar 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Namreeb,
    I was first generating .obj because I was following RivalFR tutorial on the subject. I was under the impression that you first had to generate the object files then the navmesh with them. Obviously, I know you could all do it in one step, but didn't know you could skip the object part entirely.
    I'm pretty much in the same position as Tanaris4 I think. The "literature" is pretty blurry about the linking of invidual mesh into one navigation mesh which lead to a path calculation. I think from what I've read that you got to use the addtile method and recast does the rest, am I right ?
    I'm still looking at the code of SampleTileMesh to use it as a template, still no luck but I'm still trying.
    Even then, if and when my mesh is properly created, it seems like I will still have problems with dynamics objects and there doesn't seem to be a simple workaround for this judging from the Onyx thread.
    Anyhow, thx for the heads up about the .obj files, and don't hesitate if you have any other suggestions/tips, I'm all ears.
    "What can be asserted without proof can be dismissed without proof." --- Christopher Hitchens

  6. #6
    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)
    A couple of things. First, it sounds like you might be confusing Recast with Detour. Basically, Recast builds the meshes and Detour uses them. Recast takes the input geometry (provided by your parser) and creates a mesh file. I have previously been reluctant to get specific because a) I don't use Recast+Detour anymore and b) the API is in a rather constant state of flux, so what I say now may already be out of date, since I'm drawing on my experience from approximately two years ago. And if it isn't out of date yet, it undoubtedly will be in the future.

    Nevertheless, the basic process in Recast for generating a mesh is as follows:

    1. Get geometry for the area you want to mesh from your parser
    2. Create rcConfig structure with your config values
    3. Determine bounding box for the tile you want to create
    4. Call rcCreateHeightField, passing in the geometry from the parser
    5. Call rcMarkWalkableTriangles
    6. Call rcRasterizeTriangles
    7. Call rcFilterLowHangingWalkableObstacles
    8. Call rcFilterLedgeSpans
    9. Call rcFilterWalkableLowHeightSpans
    10. Call rcBuildCompactHeightField
    11. Call rcErodeArea
    12. Call rcBuildDistanceField
    13. Call rcBuildRegions
    14. Call rcBuildContours
    15. Call rcBuildPolyMesh
    16. Call rcBuildPolyMeshDetail
    17. Call dtCreateNavMeshData. This will give you the structure to save to the disk. This will be the mesh for the tile you've just created. Later you can load these files and use dtAddTile (or something similarly named) to load the tiles for use in pathfinding.


    The parameters for these functions are well documented both by comments in Recast.h and example in the samples.

    There are some restrictions on the config values you pass. I have already posted details on that somewhere in this forum, but I will leave it to you to find the post.

    Edit: As for dynamic objects, take a look at the DetourCrowd folder. He has added some local navigation code since I've stopped using R+D.

  7. #7
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally, I create 4 tiles per ADT (maybe it's not enough)

    as you can see on this video : New autoapth system. - Blogs - GPBot : new free bot for wow. I'm able to walk throw multiple ADT without problem.

    I use quite same method namreeb describe.

    I just have a big problem with trees as you can see on this picture :


    I'm pretty sure these trees ain't dynamic object as I can't find them anywhere in memory, but I don't understand why they ain't there.

    If I can help you, let me know, and if you've some ideas for my problem do not hesitate to share them

  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)
    I had this exact same problem. In my case, it was because I was reading the scaling and casting it to an integer. So for trees whose ratio was < 1, it was being set to 0, effectively removing them from the scene.

  9. #9
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx for the tip, but I've verify, I've no scale = 0

    I used to use wowmapper dumper, and it has same problem.

    Any ideas?

  10. #10
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    There are some restrictions on the config values you pass. I have already posted details on that somewhere in this forum, but I will leave it to you to find the post.
    http://www.ownedcore.com/forums/worl...ml#post2015848

  11. #11
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by guizmows View Post
    thx for the tip, but I've verify, I've no scale = 0

    I used to use wowmapper dumper, and it has same problem.

    Any ideas?
    Cause wowmapper had the same bug.

    iirc, it was like (scale / 1024) which results in an int rather than a float, thus it's truncated.

    Edit: Yes, it's unchanged... see line 225 in Sample_D3dByAreaId.cpp - wowmapper - World of Warcraft MAP ParsER - Google Project Hosting . Added a patch for it.
    Last edited by Bananenbrot; 08-14-2011 at 11:36 AM.

  12. #12
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol I havn't seen that. I've check my scale every where but I forgot to check this div result.

    +rep man.

    I now have to figure how I can handle phased zones.
    Last edited by guizmows; 08-14-2011 at 12:35 PM.

  13. #13
    cvccbum's Avatar Member
    Reputation
    1
    Join Date
    Sep 2009
    Posts
    26
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you explain how to find which ADTs to load to make the path (from X/Y/Z game Loc to X/Y/Z game Loc) ? right now I've been dumping the whole zones and doing it that way. I can connect two zones and do a big path but sometimes it doesn't work. If I reverse the order in which I load the zones it won't work sometimes.. guess it's all trial and error

  14. #14
    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)
    There is no simple way to do this. I believe that we kept an entire continent loaded at a time. A slightly less RAM expensive way to do it is to increase the loaded tile radius around yourself until you are successful in getting a path to the destination. Note that this will not necessarily be the shortest path (in other words, a shorter path may exist using tiles further away), which is why we kept the entire continent loaded.

  15. #15
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by cvccbum View Post
    Can you explain how to find which ADTs to load to make the path (from X/Y/Z game Loc to X/Y/Z game Loc) ? right now I've been dumping the whole zones and doing it that way. I can connect two zones and do a big path but sometimes it doesn't work. If I reverse the order in which I load the zones it won't work sometimes.. guess it's all trial and error
    Encorporate your tile loading into Detours A* algorithm (FindPath). Works perfectly and you will still get the most optimal path.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Page 1 of 6 12345 ... LastLast

Similar Threads

  1. Making Cash from Lv. 10
    By Cush in forum World of Warcraft Guides
    Replies: 10
    Last Post: 09-02-2006, 10:52 PM
  2. Free Marks from Battle Grounds
    By Matt in forum World of Warcraft Exploits
    Replies: 10
    Last Post: 06-19-2006, 11:21 AM
  3. Add-ons from curse-gaming.
    By volcom in forum World of Warcraft General
    Replies: 5
    Last Post: 05-16-2006, 11:50 AM
  4. Raid Griefing Exploit (kick anyone from any group)
    By Matt in forum World of Warcraft Exploits
    Replies: 5
    Last Post: 04-28-2006, 09:26 AM
All times are GMT -5. The time now is 04:16 AM. 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