gamecreator Posted October 8, 2014 Share Posted October 8, 2014 I'm working on pathfinding and my character often doesn't take direct routes to the target (shown here as a red circle), even though the floor is generated from a completely flat plane (minus the middle column). As you can see it takes the long way around the left and right side of the middle column even though it can clearly go through those areas. This may have to do with bad path weighting but I don't know. Is there a way to force the goblin to always cut the direct path? This is the shape/navmesh code, if it helps: // Set ground navigation shape shape = Shape::Box(0, 0, 0, 0, 0, 0, 28, 16, -0.1); room->SetShape(shape); shape->Release(); room->SetNavigationMode(true); // Set column navigation shape column1=Model::Load("Models/column1.mdl"); shape = Shape::Box(0, 0, 0, 0, 0, 0, 0.3, 0.3, 4); column1->SetShape(shape); shape->Release(); column1->SetNavigationMode(true); world->BuildNavMesh(); Quote Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2014 Share Posted October 8, 2014 I would ask this on the Recast Google Group: https://groups.google.com/forum/#!forum/recastnavigation There are optional parameters in the navmesh build dialog, but I must confess I don't know the details of how this code works. It looks to me like maybe the AI finds a path that goes through fewer polygons, so it thinks that it the shorter route. I've always attributed this kind of behavior to them having minds of their own and not always acting the way you expect. You also might want to mess with the acceleration value to stop that rubber-banding behavior. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 8, 2014 Share Posted October 8, 2014 I see this same problem. It seems our ability to interact with recast in LE is limited though. Just 2 parameters in the generate navmesh. Quote Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2014 Share Posted October 8, 2014 I don't have much more control over Detour (the pathfinding library) than you do. I just use the commands it provides, and it finds the path. That's why I'm saying to ask Mikko for an explanation, he will know much better than I. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
gamecreator Posted October 8, 2014 Author Share Posted October 8, 2014 I threw a post up there. Feel free to chime in if you have more to add as it'll definitely make more sense to you than me. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted October 8, 2014 Author Share Posted October 8, 2014 Mikko responded: https://groups.google.com/forum/#!topic/recastnavigation/jMf59hFNs_Q Quote Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2014 Share Posted October 8, 2014 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 8, 2014 Share Posted October 8, 2014 Does this mean you fixed it or that when you run build navemesh this is what you get? How did gamecreator get the mesh he got which looks drastically different? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted October 8, 2014 Author Share Posted October 8, 2014 No, that was his example to Mikko of what looks wrong (per the Google Groups thread he posted it in). I wonder what it looks like after his fix. Quote Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2014 Share Posted October 8, 2014 Just squares. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
gamecreator Posted October 8, 2014 Author Share Posted October 8, 2014 Ooooh. That sounds promising. I'm happy to test it for you and upload the results. I'm not on beta though. Not sure if it would risk anything in my project if I switch to it. Any chance you could sneak it into a release build this week? Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 9, 2014 Share Posted October 9, 2014 Just squares. Thats interesting to me because your development video that shows the navmesh generation was essentially squares but when I got LE3.2, the navmeshes were like your picture above. Its like something was lost or corrupted between then and now. Also, it seems the dynamic navmesh generation was removed (or apparently only available to c++). Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted October 9, 2014 Share Posted October 9, 2014 The dynamic stuff stopped being practical when world sizes got bigger. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
macklebee Posted October 9, 2014 Share Posted October 9, 2014 The dynamic stuff stopped being practical when world sizes got bigger. That is understandable - if everyone that uses LE was trying to create large terrain scenes, but there are plenty of people that are making corridor shooters or small CSG maps that this would be a useful feature. Seems like that could have been left in but with a warning on usage. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
gamecreator Posted October 9, 2014 Author Share Posted October 9, 2014 True. From our perspective the option would be nice, especially if you already have the code. Just disable it by default and give a fair warning in the documentation. Quote Link to comment Share on other sites More sharing options...
Olby Posted October 9, 2014 Share Posted October 9, 2014 The dynamic stuff stopped being practical when world sizes got bigger. Wait, so it means there is no way to regenerate the navmesh in real time? Oh boy, I thought things like dynamic boxes and debris will obstruct enemies automatically. [Edit] After watching this video it feels like we moved backwards at least in terms of AI path-finding I also like how the nav-mesh layer is semi-transparent. Easier to debug that way. Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
Rick Posted October 9, 2014 Share Posted October 9, 2014 +1 for dynamic navmesh Quote Link to comment Share on other sites More sharing options...
gamecreator Posted October 9, 2014 Author Share Posted October 9, 2014 Wait, so it means there is no way to regenerate the navmesh in real time? Oh boy, I thought things like dynamic boxes and debris will obstruct enemies automatically. This is a mixed bag. You can call BuildNavMesh any time but it's too slow to use on large levels. I'm not clear how obstruction works but I think anything put in the way of a character stops it (going from the gate in Rick's videos) or pushes it. Quote Link to comment Share on other sites More sharing options...
Guppy Posted October 9, 2014 Share Posted October 9, 2014 Couldn't you just recalc a sub selection - I mean you will know roughly where you obstruktion / new path is Quote System: Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k Link to comment Share on other sites More sharing options...
macklebee Posted October 9, 2014 Share Posted October 9, 2014 This is a mixed bag. You can call BuildNavMesh any time but it's too slow to use on large levels. I'm not clear how obstruction works but I think anything put in the way of a character stops it (going from the gate in Rick's videos) or pushes it. Well thats the issue - the navmesh building in the video I posted said he was using multithreading so I assume that would help remove the lag you would encounter by calling BuildNavMesh(). And there is a difference between the character not being able to move forward because something is in its way (which is what we have now) and that character finding a new path to its destination because the navmesh was dynamically rebuilt to incorporate an obstruction (which is what the video shows above). 2 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted October 9, 2014 Share Posted October 9, 2014 The proper way to manage this is to make a system for static and dynamic geometry. The static geometry data can be cached, so that rebuilding a tile doesn't require rebuilding the entire geometry. This will come in time, but it's not high priority right now. I only know of one game on the Workshop that's even using pathfinding right now. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Olby Posted October 9, 2014 Share Posted October 9, 2014 The proper way to manage this is to make a system for static and dynamic geometry. The static geometry data can be cached, so that rebuilding a tile doesn't require rebuilding the entire geometry. This will come in time, but it's not high priority right now. I only know of one game on the Workshop that's even using pathfinding right now. Good to know it is planned, however, is there a way to 'thumbs-down' a post? Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
gamecreator Posted October 9, 2014 Author Share Posted October 9, 2014 I only know of one game on the Workshop that's even using pathfinding right now. How many here: http://steamcommunity.com/sharedfiles/filedetails/?id=259041136 Quote Link to comment Share on other sites More sharing options...
Josh Posted October 9, 2014 Share Posted October 9, 2014 2 or 3 more, none that can be played right now. I don't think not having enough pathfinding features is a big bottleneck right now. The way I make decisions is to look for the thing I can do with the least effort that will result in the most amount of games being made. I consider Workshop games (or published games) the most valuable because they can be played here and now today. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted October 9, 2014 Share Posted October 9, 2014 The updates are now available on the Steam beta branch, BTW. Increase the max edge to like 50 and that tesselation will go away. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.