Jobs System Line of Sight Checking | AI Series Part 40 | Unity Tutorial

Опубликовано: 12 Июль 2022
на канале: LlamAcademy
6,775
222

Learn how you can implement the jobs system to improve the performance of Line of Sight checking for your AI!

In this Unity Tutorial you'll see the comparisons of the typical ways you might see line of sight implemented:
1. EnemyLineOfSightChecker.cs attached to each Enemy (worst performance, most likely this is what you'd start with)
2. EnemyLineOfSightManager.cs - Checking Line of Sight for all Enemies in a single Update() loop (better performance, but can be improved)
3. EnemyLineOfSightManager.cs - Checking Line of Sight via the Jobs system (best performance for large numbers of enemies!)

In this tutorial repository, all 3 methods are available for you to compare on your hardware.
You'll see that the jobs system is not a magic bullet, it solves specific problems such as tasks that can be highly parallelized. You can also use this to determine at which points the parallelization is more helpful than harmful (or just unnecessarily adds code complexity)!

As usual with the AI Series, we're using the NavMesh Components: https://docs.unity3d.com/Manual/NavMe... not the built-in navigation system.

👨‍💻 As always, all code from this video is available on GitHub: https://github.com/llamacademy/ai-ser...

🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?sect...

📚 Resources:
⚫ Jobs System Manual: https://docs.unity3d.com/Manual/JobSy...
⚫ Spherecast Command: https://docs.unity3d.com/ScriptRefere...
⚫ Allocator Types: https://docs.unity3d.com/Manual/JobSy...
⚫ Unity Performance: https://docs.unity3d.com/Manual/BestP...

🧡 Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
🌟 Patreon:   / llamacademy  
🌟 YouTube Member:    / @llamacademy   or click the Join button on any video
📚 Take my Unity ShaderGraph Course:
https://www.gamedev.tv/p/unity-shader...
👕 Get yourself some LlamAcademy merch: https://llamacademy.myspreadshop.com/
💸 Use my Affiliate Link for Humble Bundles https://humblebundleinc.sjv.io/9g4ak4
💸 Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! https://assetstore.unity.com/publishe... (affiliate)
💸 Save up to 50% on NEW Assets: https://assetstore.unity.com/?new_sal... (affiliate)

Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.

Chapters:
00:00 Topic Introduction
03:28 Scene Overview
04:26 How you'd probably implement it (no jobs) - EnemyLineOfSightManager.cs
06:23 Jobs System Implementation (with explanations) - EnemyLineOfSightManager.cs
11:10 Performance Comparison - Inspecting Performance Without Jobs
12:10 Performance Comparison - With Jobs
15:03 Performance Considerations & Final Thoughts


Смотрите видео Jobs System Line of Sight Checking | AI Series Part 40 | Unity Tutorial онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь LlamAcademy 12 Июль 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 6,775 раз и оно понравилось 222 людям.