Unity Jobs System Update

Hi all,

Welcome back to the dev log of Project Hunter. The last update went over the massive fps increase gained from transferring to the Universal Render Pipeline (URP) in Unity but I still wanted to improve on the performance and optimizations that can be done to gain a smoother and more consistent 30 fps on the mobile platform.

I took a look back at the code I had already completed for the Unity Job System for the A* Pathfinding algorithm as I know the algorithm works within a standard operation and I had already designed the code to work within the Unity Jobs System. After some more debugging seeing that the path is found but not set when finishing the job, deciding to cut out some functions and write the code within the Execute function of the Unity Job instead of the private functions within the Job Struct called to be used. To my big surprise this actually fixed the issue for returning the data out of the A* Pathfinding but there was still another issue which is now the full list was not being set and I knew from previous multi-threading work that it takes times to execute these operations. To allow the job time to execute gave me an idea to create a Pathfinding System which is the manager for the animals to send their starting and ending positions and this system then adds each animals job to the queue and then the animal is alerted to change state when their pathfinding job is complete and the data passed back is valid to traverse down or invalid and needs to get a new start and end position for the job to calculate a path again.

Since the change over the fps has become more consistent but the fps increase I thought would be achieved has not been fully accomplished across all mobile platforms, this could be a number of things such as code that is dropping the frametime significantly or the amount of animations and effects happening within a frame or even the mobile device is not as powerful as the newer systems that can operate twice as fast. This could push me further towards the Unity Entity Component System (ECS) but a further restructure of the animal code will be needed to work with the ECS that is not to say it is impossible to restructure the code but will take a bit more time to transfer over versus changing code to work with the Unity Jobs System like I have done here.

Twitter: @LRProjectHunter

Facebook: @LRProjectHunter

Happy Hunting All