• gm_navigation - All in one navigation solution
    254 replies, posted
  • Avatar of Grocel
  • Is there a chance that we get the Nav:FullGeneration() threaded? Also if you try Nav:Save(filename) in a folder that don't exist yet it fail to save instead of creating the folder.
  • Avatar of Spacetech
  • I updated the module with a fix for the Nav:RemoveNode(node) function. After that function is called all of the node ID's will update which fixes many errors/crashes.
  • Avatar of MadDog986
  • Thanks for this great module! I'm working on making a better AI for non-noded maps. A weird issue ive come across though. (simple code) [code] print("test") FoundPath, Path = Nav:FindPath() print(Path[1]:GetPosition())[/code] console outputs: [code]test gm_navigation error: Not a function: 0 -269.0000 -92.0000 4612.0313[/code] As you can see it outputs the position just fine... so i'm not sure what is causing the module error.
  • Avatar of Spacetech
  • [QUOTE=MadDog986;32248163]Thanks for this great module! I'm working on making a better AI for non-noded maps. A weird issue ive come across though. (simple code)[/QUOTE] The module tries to get a reference to the lua function Vector() so that it can create lua vector object's faster. That error happens when it fails to get the reference, it will then use a fallback method so it will still work. I'm not quite sure what would cause the reference to fail. I could hide that message if it happens too often.
  • Avatar of MadDog986
  • [QUOTE=Spacetech;32254581]I'm not quite sure what would cause the reference to fail. I could hide that message if it happens too often.[/QUOTE] I spent at least 3 hours last night trying different things and i kept getting this error. Its probably because i'm using SetStart and SetEnd to often. Would it be possible to modify the module to allow something like FindPath(StartPosition, EndPosition) for quicker lookups? The idea is a SNPC could use FindPath(self:GetPos(), self:GetEnemy():GetPos()) and use SetLastPosition in a think.
  • Avatar of MadDog986
  • Is there a way to generate more nodes without having to reset? In other words, could i generate nodes at one spot, then move away and generate at another spot?
  • Avatar of MadDog986
  • Spacetech could you please add a method for disabling nodes? The idea is if there is a prop above a node, it can be disabled so FindPath can work around moving objects.
  • Avatar of Spacetech
  • [QUOTE=MadDog986;32446070]Spacetech could you please add a method for disabling nodes? The idea is if there is a prop above a node, it can be disabled so FindPath can work around moving objects.[/QUOTE] Done. Added Node:IsDisabled() Added Node:SetDisabled(bool)
  • Avatar of MadDog986
  • Thanks for the addition!!! I was able to get a fully working SNPC follow me around section of a map. I will work on getting something released soon but here is a video i came up with (ill get a full version of fraps soon for longer video). [video=youtube;TGDH7pFjpOQ]http://www.youtube.com/watch?v=TGDH7pFjpOQ[/video] In the video you will see a prop that im moving around (with color alpha low so i can see the npc). I created a tool to allow me to add/edit/delete nodes and show the path of the NPC in real time. The white are active nodes, and the yellow are "disabled". The red is the path calculated by FindPath. I still have some improvements to be made but it sure beats the stock npcs.
  • Avatar of disseminate
  • "gm_navigation: Missing IVEngineServer interface" - happens on the beta. I don't know if you have beta but it's something to look out for.
  • Avatar of Nexus435
  • [QUOTE=Disseminate;33600851]"gm_navigation: Missing IVEngineServer interface" - happens on the beta. I don't know if you have beta but it's something to look out for.[/QUOTE] Caused by a new interface version. Try compiling with a redefined version. [code] #define INTERFACEVERSION_VENGINESERVER "VEngineServer022" [/code] [editline]7th December 2011[/editline] Here, I uploaded a new version. The only change is the redefine. [url]http://www.mediafire.com/?3k9f1d7tde8ms0j[/url] If it doesn't work, tell me the error and upload the beta's engine.dll and I'll get a corrected update.
  • Avatar of disseminate
  • [QUOTE=Nexus435;33604809]Caused by a new interface version. Try compiling with a redefined version. [code] #define INTERFACEVERSION_VENGINESERVER "VEngineServer022" [/code] [editline]7th December 2011[/editline] Here, I uploaded a new version. The only change is the redefine. [url]http://www.mediafire.com/?3k9f1d7tde8ms0j[/url] If it doesn't work, tell me the error and upload the beta's engine.dll and I'll get a corrected update.[/QUOTE] [url]http://filesmelt.com/dl/server1.7z[/url] gm_navigation: Missing IVEngineServer interface. Looks like the new engine version is VEngineServerGMod021 Edit: I have no idea how to change it though, can you compile a dll?
  • Avatar of Nexus435
  • [QUOTE=Disseminate;33606879][url]http://filesmelt.com/dl/server1.7z[/url] gm_navigation: Missing IVEngineServer interface. Looks like the new engine version is VEngineServerGMod021 Edit: I have no idea how to change it though, can you compile a dll?[/QUOTE] Here: [url]http://www.mediafire.com/?i5dhj6whwbnvwlk[/url] Had to change VFileSystem to version 019 as well.
  • Avatar of disseminate
  • [QUOTE=Nexus435;33616860]Here: [url]http://www.mediafire.com/?i5dhj6whwbnvwlk[/url] Had to change VFileSystem to version 019 as well.[/QUOTE] Works! Thanks.
  • Avatar of Guewen
  • Hi, How to make the plot is not sticking to the wall? because the NPC is found to block [img]http://www.gtacity.fr/rp_downtown_v20000.jpg[/img] [img]http://www.gtacity.fr/rp_downtown_v20001.jpg[/img]
  • Avatar of Grocel
  • You will have to loop through the table of nodes and to check with TraceHull if they are blocked. If they are blocked then you can remove them. But I think it would be better if we could enter the size of the NPC in the path finding function.
  • Avatar of Grocel
  • [QUOTE=Disseminate;34516169]Gatekeeper[/QUOTE] Wrong thread? Also Spacetech is aware of the breaking of gm_navigation, once he said to me that he will fix it when the beta is out.
  • Avatar of Delremos
  • In the beta again: (like Disseminate said) [quote=GMOD 13]gm_navigation: Missing IFileSystem interface[/quote] I don't really know how to check what version the interface is, or anything like that, but it would be great if someone could take a stab at getting this up and running again. [editline]16th February 2012[/editline] Not sure, but could very well be "VGModFileSystem019" [editline]16th February 2012[/editline] Yeah, VGModFileSystem019. [url]http://dl.dropbox.com/u/952291/modules/gm_navigation.zip[/url]
  • Avatar of Phoenixf129
  • I'm pretty confused, is this "out of the box" functionality, or is it for developers to mess around with? (After generating nodes. I'm trying to make Pathfinding zombies.)
  • Avatar of MadDog986
  • [QUOTE=Phoenixf129;35036120]I'm pretty confused, is this "out of the box" functionality, or is it for developers to mess around with? (After generating nodes. I'm trying to make Pathfinding zombies.)[/QUOTE] Its for developers.
  • I'm somewhat confused here, how long is it supposed to take to generate the nodes? [lua] require("navigation") NAV = { } NAV.Mesh = CreateNav(64); NAV.Mesh:SetDiagonal(true) concommand.Add("snav", function(ply) ErrorNoHalt("Creating Nav\n") NAV.Mesh:StartGeneration() local StartTime = CurTime() hook.Add("Think", "NavUpdateGeneration", function() if(NAV.Mesh:UpdateGeneration()) then ErrorNoHalt("Generated in ".. string.ToMinutesSeconds(CurTime() - StartTime) .. "\n") hook.Remove("Think", "NavUpdateGeneration") NAV.Mesh:Save("data/".. game.GetMap() .. ".nav") else ErrorNoHalt( "Did Step: ".. string.ToMinutesSeconds(CurTime() - StartTime) .. "\n" ); end end) end)[/lua] At this point it's been running for about 4 hours and still isn't done.
  • Could someone please post some more example scripts? I'm confused by the code used in the example, like it calls functions twice (Set Grid Size?) for an unknown reason, and on the whole it's a very cryptic example script. Just a basic pathfinder with no flowery functions that puts the used nodes into a table sorted by closest first would be amazing :)
  • Avatar of Grocel
  • Example addon: [url]http://xp-dev.com/svn/wire_navigator/[/url] Documentation is in the OP or here: [url]http://xp-dev.com/svn/wire_navigator/gm_navigation_documentation.txt[/url] You would need sure lua knowledge.
  • Avatar of Delremos
  • Just in case anyone wants it, here's a working version for the beta (updated for update 14). [url]http://dl.dropbox.com/u/952291/modules/gm_navigation.zip[/url] [editline]22nd March 2012[/editline] Source is in the zip by the way. The new interface name is "VGModFileSystem020".
  • Avatar of Delremos
  • And another update for version 16: [url]http://dl.dropbox.com/u/952291/modules/gm_navigation.zip[/url] Interface name is "VFileSystem019" Let me know if there's anything wrong with it.
  • Avatar of creec
  • Decided to have a little comeback on gmod lua by finishing my rts gamemode. Got this: gm_navigation: Missing IVEngineServer interface. (tried latest file)