#Navmesh + Jobs?

1 messages · Page 1 of 1 (latest)

signal garden
#

Hey everyone. I have quite a simple question with most probably a complicated answer which i have not been able to find yet.

I am making a project that will handle multiple GameObjects in the scene at the same time (hundreds of animated enemies, thousands of bullets, etc). This project will have multiple types of enemies and bullets/projectiles, meaning inheritance is a must. With that being said, I started to look into ECS and found the learning curve for my requirements a bit too complex, so i voted against using ECS. Instead, I opted to Jobify + Burst any heavy math/calculation area. This brings me to my question:

NavMeshAgent is managed, meaning it can not be used in jobs. I looked into NavMeshQuery which works in jobs and it seems to be deprecated and I have not been able to find good documentation on it.

Is there any real way to make this work without the need to re-invent the wheel and make a whole pathfinding system from scratch? Are there alternatives with a not-so hardcore learning curve? If you happen to have any repository or project to serve as a working example, I would greately appreciate it.

Thank you!

thorny ivy
#

if you search ecs navmesh/navigation etc on github you can find some examples of using the navmeshquery api with jobs to learn from. https://github.com/bustedbunny/Pathfinding might be the most recent one?

(note I dont recommend zulfa's or my own fork of zulfas either, really old outdated version if you happen to come across em)

signal garden
#

Thank you very much for the reply! I do notice this is fully ECS usage which i opted to avoid, specially considering my project will make use of multiple packages which dont work well with ECS.

#

Is there really no real example of using navmesh/any robust pathfinding logic only with jobs + burst?

torpid flame
#

To be honest, I think navmesh uses jobs and burst for the heavy calculations behind the scenes already. It would make sense if it did, as a lot of engines internals do.

Other than that, thelebaton said examples to learn from. Not that you need to use it as is. There's likely API that you can use outside of ECS.

thorny ivy
#

the api can 100% be used outside of systems and ecs, when reading the systems code, for how to use in a monobehaviour OnUpdate is Update, OnCreate is Awake, OnStartRunning is Start, the core PathfinderSystem in the repo I linked could easily just be turned into a monobehaviour.