All modern CPUs have multiple cores, yet many games don’t take advantage of them. The Job System allows games to use all the CPU cores in a computer. Overall, it allows you to run processes over multiple cores safely and simply, without worrying about race conditions, deadlocks and other issues that usually arise. So what exactly is the Job System and what makes it different from just writing normal multi-threaded code? You’ll learn more about the purpose of these packages throughout the tutorial. In the Package Manager, select Advanced ▸ Show preview packages and install the following: Select Window ▸ Package Manager from the top menu. Installing Required Packagesīefore you begin using the Job System, you have to install some packages from the Package Manager. Multi-threading also comes with a bunch of limitations, which you’ll discover throughout this tutorial. Sometimes, code runs more slowly when it uses unnecessary threading. Note: Remember that not all problems require multi-threading. Each of the 1,000 to 2,000 fish gets a random destination and velocity to swim inside the water.The code loops through 10,000 vertices of the water mesh, applying a mathematical function to change its height.You’ll use it throughout the tutorial to benchmark the performance of the Job System.īy the end, you’ll have waves on the water with thousands of fish swimming inside. The FPS largely depends on the computer you have. Press the Stats button on the Game view and note the FPS. Press the Play button and… nothing happens. Open the Main Scene and look at the Game view. Scripts: Starter scripts ready for you to add your awesome code. Scenes: The Main Scene, which you’ll modify.Prefabs: A fish prefab, which you’ll instantiate hundreds of times.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |