gamecreator Posted February 9, 2018 Share Posted February 9, 2018 The below code works fine. It shows a debug nav mesh. However, if you uncomment the SetViewRange line, the nav mesh no longer shows. I don't know if it no longer generates or if SetDebugNavigationMode just doesn't display nav meshes for InfiniteViewRange objects. I also don't know if SetDebugNavigationMode is an official function (that's why I didn't put this in the bug forum). It's not documented but this example uses it anyway: https://www.leadwerks.com/learn?page=Tutorials_Lua-Scripting_Introduction-to-Lua So at least a heads up for Josh. Maybe it's an easy fix or I'm doing something wrong. Model *tempfloornavmesh; tempfloornavmesh = Model::Box(50, 1, 50); tempfloornavmesh->SetPosition(0, -0.2, 0, true); tempfloornavmesh->SetColor(1.0, 1.0, 0.0); // tempfloornavmesh->SetViewRange(Entity::InfiniteViewRange); // Anything lower will make things disappear Shape* shape = Shape::Box(0, 0, 0, 0, 0, 0, 50, 1, 50); tempfloornavmesh->SetShape(shape); shape->Release(); tempfloornavmesh->SetNavigationMode(true); camera->SetDebugNavigationMode(true); world->BuildNavMesh(); Spent quite a bit of time trying to figure out what was wrong. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 9, 2018 Author Share Posted February 9, 2018 Wait. Navmesh stops generating after a while? Why?? How do I extend that by code? Looks like it's at 512x512. Josh, is this some arbitrary limitation you put in? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 10, 2018 Share Posted February 10, 2018 Try World->SetSize() to increase size of world. Also make sure the navmesh isn't hiding under polygons, it tends to get a little inaccurate at greater distances. 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...
macklebee Posted February 10, 2018 Share Posted February 10, 2018 7 minutes ago, Josh said: Try World->SetSize() to increase size of world. Was going to suggest this as it was available in LE2, but I didn't see it in lua or the documentation so I was unsure if it existed anymore. Can we please get this exposed to lua? 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 February 10, 2018 Author Share Posted February 10, 2018 world->SetSize(4096) worked for me though the navmesh generation is now about 30+ seconds with 1 pillar per room (for 100 rooms). Not a problem so far with doing the generation at the start of the game. Quote Link to comment Share on other sites More sharing options...
macklebee Posted February 10, 2018 Share Posted February 10, 2018 13 minutes ago, gamecreator said: world->SetSize(4096) worked for me though the navmesh generation is now about 30+ seconds with 1 pillar per room (for 100 rooms). Not a problem so far with doing the generation at the start of the game. Are you creating worlds that large? If they are about the same size as shown in your pictures then a world size of 1024x1024 should be enough. 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 February 10, 2018 Author Share Posted February 10, 2018 SetWorldSize is doing something weird. Without it (or if I use it and specify the default 1024 size), the navmesh on the left is generated. If I specify a larger size, it takes significantly longer and it generates a mesh that looks like the one on the right. That's all that is changed but maybe Leadwerks is changing other factors/defaults as well internally. I haven't tried changing the BuildNavMesh parameters yet so I'll play with that next. macklebee, I'll give you a detailed answer with some screenshots in a few minutes but the short answer is yes an no. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 10, 2018 Author Share Posted February 10, 2018 Right now, each room is 60 units wide and 40 high to accommodate a character that's the standard 1.8 meters high. It's not a big room and I was hoping for bigger, and for different shapes other than a rectangle. There's a space of 20 units between rooms to the right and 40 above, just some arbitrary numbers for testing. So every 80 right or up, there's space for a new room. So if a 100 room dungeon is generated in a perfect square (which will never happen), that's 800x800 (10x10 grid) plus the height and width of the last room. The plan was to make it multiplayer and a host running the simulations for each room there's a player in but the players shouldn't see any other rooms ... ... so I was gonna spread the rooms out further but I think I'm going to need to either cover up the rooms somehow with some blocker or show/hide the other rooms with players in them and everything else in them every frame. Probably not a big deal but this would have been much easier if I could just spread out the rooms more (though people with dual or more monitor setups might still end up seeing them anyway so hiding the other rooms some way is probably for the best, if show/hide isn't too expensive). And the reason I gave you a yes and no answer above is because for simplicity's sake I'm cheating. The rooms generate only in the positive space and even then, I start the first room to branch off of at about 800, 800 so that rooms can branch in any direction and still stay in the positive space to be represented easier in an array. In this I can definitely improve the program. I can just start at 0,0 and branch in any direction from there but represent the rooms in an array with an offset. That should help a ton. So, some insight into the madness. I'll keep at it but some interesting bumps along the road. Thank you for the help. Edit: thinking about it further, I can keep doing the array as I've been doing and just offset the model positions so that the middle of the array positions the room at 0,0,0 in global space. Not hard at all. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 11, 2018 Author Share Posted February 11, 2018 Any thoughts about why a larger world->SetSize would the increase the minimum distance from the pillar? I've tried all sorts of BuildNavMesh numbers (maxedgelength and maxedgeerror) up and down and nothing gets closer. I even tried to seriously reduce the shape size but that didn't help either (i.e. Shape::Box(0,0,0, 0,0,0, 0.002,2.0,0.002)). Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 15, 2018 Author Share Posted February 15, 2018 One-time bump. I'd really love to work on this and maybe even submit something for the tournament (with less than 2 weeks to go) but I can't have large areas be blocked off from navigation and enemies not approaching players who are standing next to pillars. Quote Link to comment Share on other sites More sharing options...
Defranco Posted June 26, 2018 Share Posted June 26, 2018 Hey Gamecreator, Did you ever resolve this? We're going through the same issue after updating our project file from 4.4 to 4.6 beta. Our map size is 4096 and has the exact issue you describe with Navmesh generation Quote Link to comment Share on other sites More sharing options...
gamecreator Posted June 26, 2018 Author Share Posted June 26, 2018 Josh said he will "hopefully" fix it here: https://www.leadwerks.com/community/topic/17334-and-leadwerks-4/?do=findComment&comment=112819 Quote 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.