[ZScript Library] ZNav - Navigation Mshes in ZDoom!

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
Post Reply
User avatar
Custodian
Posts: 63
Joined: Fri Jan 29, 2021 8:24 pm
Graphics Processor: ATI/AMD (Modern GZDoom)
Location: Minneapolis MN, USA
Contact:

[ZScript Library] ZNav - Navigation Mshes in ZDoom!

Post by Custodian »

ZNav - Navigation meshes in GZDoom

ZDoom-Pathfinding is a zscript library for navigation mesh pathfinding in GZDoom.



This library has two components. Actors use the navigation mesh for pathfinding, allowing them to more easily move to the player and avoid getting stuck. The nodes on the navmesh can also store additional data about actors and generate paths which avoid clumping up and large obstacles.

This toolkit aims to be a 1-click solution for better AI in your UDMF maps. The interface runs externally from Doom Builder and can generate robust navigation meshes in seconds. The navmesh generation can be adjusted with easy controls to better suit your needs.

How to Use this:

You will first need to set up and install ZDoom-Navmesh-Generator, a Node.js application that generates navigation meshes. This program generates the navigation meshes and exports them as JSON files. Once you're satisfied with your nav meshes, you can integrate the pathfinding library into your project. This library provides no movement code for your actors, you will need to create that yourself. Here's an example of how this is intended to be used.

Additional Reading:



A* Pathfinding
Recast Navigation Mesh
Digesting Duck's Simple Stupid Funnel Algorithm
Last edited by Custodian on Sun Nov 13, 2022 7:21 pm, edited 6 times in total.
User avatar
22alpha22
Posts: 303
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: [ZScript Library] GZPathfinding

Post by 22alpha22 »

Holy crap this looks absolutely amazing! What fortuitous timing, I needed a custom path finding system for some enemies in my project and was going to try tackling it on my own pretty soon but this looks way better than anything I could come up with.
popguy12
Posts: 42
Joined: Fri Jan 19, 2018 1:44 pm
Location: Planet SOPHIA

Re: [ZScript Library] GZPathfinding - ZDoom Nav Meshes!

Post by popguy12 »

if no nav mesh is present would it default to standard A_Chase procedures?
simply to make sure something will work outside of maps without a generated navmesh?
XLightningStormL
Posts: 384
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here
Contact:

Re: [ZScript Library] GZPathfinding - ZDoom Nav Meshes!

Post by XLightningStormL »

Frankly, the use of Node JS and all the npm shenanigans are just completely counterintuitive for getting navmeshes in GZDoom, so apart from 10 people crazy enough to do so, this'll mostly go unused.

EDIT: You should specify that people will need to use Powershell not Node JS to actually install and start the .JS start (not github though) But I'm assuming there's an NodeJS addon/s required that isn't specified
User avatar
Custodian
Posts: 63
Joined: Fri Jan 29, 2021 8:24 pm
Graphics Processor: ATI/AMD (Modern GZDoom)
Location: Minneapolis MN, USA
Contact:

Re: [ZScript Library] GZPathfinding - ZDoom Nav Meshes!

Post by Custodian »

XLightningStormL wrote: Sun Nov 06, 2022 3:50 am Frankly, the use of Node JS and all the npm shenanigans are just completely counterintuitive for getting navmeshes in GZDoom, so apart from 10 people crazy enough to do so, this'll mostly go unused.

EDIT: You should specify that people will need to use Powershell not Node JS to actually install and start the .JS start (not github though) But I'm assuming there's an NodeJS addon/s required that isn't specified
The README specifies the steps required to launch the application. You don't need anything beyond Node.js and bash to launch this. If you follow the directions, it will install all the necessary dependencies.
User avatar
Custodian
Posts: 63
Joined: Fri Jan 29, 2021 8:24 pm
Graphics Processor: ATI/AMD (Modern GZDoom)
Location: Minneapolis MN, USA
Contact:

Re: [ZScript Library] GZPathfinding - ZDoom Nav Meshes!

Post by Custodian »

popguy12 wrote: Sun Nov 06, 2022 1:54 am if no nav mesh is present would it default to standard A_Chase procedures?
simply to make sure something will work outside of maps without a generated navmesh?
I don't provide any kind of monster movement or attack code in this library. The assumption is that people will tailor the library to suit their needs. After you've called 'findpath' from the nav mesh, what your actors do with the path data is entirely up to you!
User avatar
Custodian
Posts: 63
Joined: Fri Jan 29, 2021 8:24 pm
Graphics Processor: ATI/AMD (Modern GZDoom)
Location: Minneapolis MN, USA
Contact:

Re: [ZScript Library] GZPathfinding - ZDoom Nav Meshes!

Post by Custodian »

I don't provide any code showing how to integrate the pathfinding into your existing mods and games, so I wanted to show an example of how to create a function that behaves similarly to A_Chase using the pathfinding system:
Spoiler:
I will concede that using three.js + node.js is not an ideal solution for creating navigation meshes and that some people might struggle with figuring out how to use node/npm. my ideal solution here would be to create a plugin for Ultimate Doom Builder which can generate these navigation meshes, but frankly, I am not skilled enough to even know where to begin.
User avatar
Custodian
Posts: 63
Joined: Fri Jan 29, 2021 8:24 pm
Graphics Processor: ATI/AMD (Modern GZDoom)
Location: Minneapolis MN, USA
Contact:

Re: [ZScript Library] ZDoom-Pathfinding - Nav Meshes in ZDoom!

Post by Custodian »

Update!

We have included a working example file and some bugfixes! We also added a debug tool that lets you visualize your agent paths!



Post Reply

Return to “Resources”