Dijkstra: How are calculations done by custom classes treated by Unity?
Helo there,
I have been working on a graph project, that is supposed to apply the Dijkstra path algorithm. My idea originally was to have a Monobehaviour Script, that takes all the necessary graph data and starts calculating the single shortest path from a start node, to a destination node. All of that is supposed to happen, while the player is waiting for the next possible input (which can be done once the path result has been calculated).
Seeing how there is potentially a lot of data to process, I've decided to write an IEnumerator that applies Dijkstra as a coroutine.
So far it works with no issues, but seeing how my Project has become quite bloated with redundant code and a few grave mistakes in different areas, I've decided to redo it all.
I've thought about this quite a lot and have done a few searches, but haven't found anything about this topic: How are calculations done by custom classes treated by Unity?
Are they run on a sepperate thread?
Are they run on the main thread?
How performant are they?
Do they impede the frame rate?
So seeing how I'm not even working with actual MonoBehaviours, I've been thinking about writing a custom class that applies dijkstra on these ScriptableObjects. But if the calculations done by this class impede performance, I'd just stick to coroutines that calculate the necessary result.
Thanks in advance!
Your answer
Follow this Question
Related Questions
Can't animate custom property 2 Answers
How do I highlight all available paths with Dijkstra's algorithm on a tile based map? 2 Answers
How to know which point that AI picked to move to? (A* Pathfinding) 0 Answers
Pathfinding Flow Fields 0 Answers
Making the AI to reach the destination without a Navmesh? 0 Answers