I have some pathfinding code that jobs might be able to speed up. I haven’t really been able to “get it” though. My thinking is maybe if I try to make something with jobs, it might make more sense. Is there something light I could start off with to try and convert to jobs?
This is how I have traditionally introduced people to the features: GitHub - Dreaming381/HeartPromoDOTS: Repo used to teach fundamentals of DOTS for GameObjects
here is a pretty nice tutorial on jobs
and here:
https://github.com/stella3d/job-system-cookbook
is repo from early days, but still should work with current jobs I think
Well, not every programming problem naturally lends itself to being solved with jobs. I would say that regular pathfinding is one of them. This doesn’t mean you can’t jobify it. This just means that you’ll have to think up an out-of-the-box approach to pathfinding.
Generally speaking, the easiest things to jobify are those problems where you want to do one thing very often. Particle systems would be a great example. You could turn every module (e.g. color over lifetime) into a job. Then use it to do the same logic on thousands of particles very quickly.
Jobs are similar to compute shaders in this regard. If you can do it with one, you can do it with the other.
I would disagree. Pathfinding is one of the easiest things to jobify, because you don’t need large amounts of entities to see performance improvements. The reason people find it hard is because they only know one really awful data structure for representing their navigable space and that data structure is not easily representing in a Burst-compatible format.
That’s what I meant though: you have to rethink the way you structuring your data.
Things like particle systems translate nearly 1 to 1.
I can see why someone who never did anything with jobs would have trouble with the former.