No video

Watch this if you've never tried JOBS in Unity (Tutorial)

  Рет қаралды 7,234

Sasquatch B Studios

Sasquatch B Studios

Күн бұрын

Пікірлер: 29
@naolshow
@naolshow 3 ай бұрын
The overhead at the end is not from job side, you are not disposing the rotation native array. And also you should not allocate and dispose the arrays each time since you are using the Persistent allocator, so either keep their reference by creating them at awake and disposing them in on destroy or simply allocate them and dispose them in update with a temporary allocator.
@RobLang
@RobLang 3 ай бұрын
Really cool overview. Really appreciated the look at 15,000 individual jobs because I think the overhead would catch many out!
@majin2909
@majin2909 3 ай бұрын
I know you since 1k subs, I am glad u didn't gave up and are that far on youtube, hope you are making a good living now, at least good enough to survive
@bcreusot
@bcreusot Ай бұрын
Side note on performance improvement, (the rotation not being disposed and persistant have already been addressed). You should swap using Distance for DistanceSquared (ie : comparing the squared distance instead of the normal distance). The normal distance, include a squareRoot in its calculus which is def more costly that squaring the constant you are comparing it to.
@b5fan504
@b5fan504 3 ай бұрын
A good video. I suspect some people may benefit from clarity that, essentially, every time you say 'thread' you could say 'core'. That's what you're allowing here; to spread more work across more CPU cores. I also like that you touched on their being no free lunch; it comes with its own overhead as everything does.
@janseenvideogaming
@janseenvideogaming 3 ай бұрын
Okay.. Im going to give this another shot. I need to start showing viewers how to make cool games and get more viewers. tough. Great video man
@TheArghnono
@TheArghnono 3 ай бұрын
Excellent tutorial!
@OIndieGabo
@OIndieGabo 3 ай бұрын
Just to add my take on "why 2 libraries for Jobs exist" and also why we keep seeing libraries (namespaces) with the same name. I am not sure if this is exactly the case but the JOBS library is an isolated solution. It might not necesserally been written to work solely for the UnityEngine. It is a solution on multithreading in a specific scenario. So you have the solution "Unity/Jobs" (using slashs so youtube does not mistake it with a link). It contains everything to make Jobs work. And then you need an implematation that actually takes advantage of that system and applies its usage in the way it needs to its own solution. That's why you have the "UnityEngine/Jobs". It is basically the UnityEngine having an implementation on how to use the Jobs library, wich happens to be made by Unity (the company).
@danielwertz8724
@danielwertz8724 3 ай бұрын
Im a godot developer but love your videos. Feel like i still got a little out of it. Helps that I use c# in my day job and use threading frequently. Thanks for the vid!
@AliHosseiniDev
@AliHosseiniDev 3 ай бұрын
Oh boi that was a nice explanation.
@redragon1229
@redragon1229 3 ай бұрын
Cool video. I want to point out that although the ~x2 boost in your example does not look that impressive, actually, excluding rendering and other processes, Jobs can be HUNDREDS of times faster than the same single-threaded calculations. In this example the difference is not so significant because, I think, most of the performance hit is the rendering. Also, as @naolshow pointed out: this can be further optimized.
@user-uk9er5vw4c
@user-uk9er5vw4c 2 ай бұрын
nice content, thanks!
@lightbug6103
@lightbug6103 16 күн бұрын
Why are you using that _isDone flag? Regarding the MonoBehaviour code, there are small things that can be changed in order to improve performance: 1. Using a list of enemy transforms instead of GOs, so you don't need to access the transform for the 50k enemies. 2. Grabbing the player's position before entering the loop instead of calling "_playerTransform.position" every time. 3. Using Tansform's "SetPositionAndRotation" instead of ".position" and ".rotation". 4. The following operation "direction * dt * moveSpeed" can be rearranged to improve performance like this: "dt * moveSpeed * direction" or just "direction * (dt * moveSpeed)" 5. I know Time.deltaTime is not a big deal, but I usually cache that as well. I'm not saying this is gonna beat Jobs, but it could make a difference nonetheless.
@Dragoncro0wn
@Dragoncro0wn 3 ай бұрын
Is it a bad idea to make the thread function like an update loop? Always running in the background doing its own tasks
@HumanityAsCode
@HumanityAsCode Ай бұрын
You would probably run into a race condition doing that
@privatdetektivenkant5975
@privatdetektivenkant5975 3 ай бұрын
Give me more!!!!!
@HumanityAsCode
@HumanityAsCode Ай бұрын
Isn't this ECS with more steps? If you're operating on a list of 'entities' as it were why not skip the job and go full ECS
@PhiLudo
@PhiLudo 3 ай бұрын
cool stuff
@k-6353
@k-6353 2 ай бұрын
Hi, I've seen JOB system when I started using Unity but i thought it was way too advance for me (i still do). All in all, Does this mean i cant implement JOB system into AI bots? or is there another way to optimize? Currently, I reach 20fps after spawning nearly 100 AI bots, equipped with Movement(patrol, chase many more), Combat etc. I get 15 fps with 350+ bots with their main AI script disabled. Would be greatly helpful if someone could lead me into a direction
@user-rm2pj9jf8s
@user-rm2pj9jf8s 3 ай бұрын
I love it
@rrainix
@rrainix 2 ай бұрын
How are you instaniating 15 thousand enemies so fast?
@Coco-gg5vp
@Coco-gg5vp 3 ай бұрын
First
@frankrenzulli4354
@frankrenzulli4354 2 ай бұрын
I CAN'T FKING HEAR YOU, TURN UP YOUR VOICE PLS :(((((
@GostGostcic
@GostGostcic 3 ай бұрын
this video is so bad, he could make this code 10x faster with jobs but he made so many mistakes in the video lol
@OIndieGabo
@OIndieGabo 3 ай бұрын
This comment means nothing if you are not pointing out how the solution would actually be improved. There is no harm on pointing mistakes out and explaining them so everybody can grow on it. What you did here is just offensive. And if this is was your intention it becomes clear why we should not listen to what you are saying and just ignore you in the future.
@GostGostcic
@GostGostcic 3 ай бұрын
@@OIndieGabo [ReadOnly] works only on native containers not the normal variables, boid Transforms should have null parent (this is extremely important) and updated only with TransformAccess.SetLocalPositionAndRotation(...), then he should show profiler because this is not the bottleneck (because can handle 100k+ updates per frame easily), he is doing something else wrong. i could go on... but the point is, dont watch this, he is missing the point of the JOBS and what they do.
@ehabelbwab1783
@ehabelbwab1783 2 ай бұрын
@@OIndieGabo Agree
Make a MiniMap with NO CODE (Unity Tutorial)
8:46
Sasquatch B Studios
Рет қаралды 2,4 М.
OPTIMIZE your Unity game using these performance tips | Tutorial
11:20
Sasquatch B Studios
Рет қаралды 14 М.
Meet the one boy from the Ronaldo edit in India
00:30
Younes Zarou
Рет қаралды 19 МЛН
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 22 МЛН
Dad Makes Daughter Clean Up Spilled Chips #shorts
00:16
Fabiosa Stories
Рет қаралды 3,3 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 57 МЛН
SIMPLE Tip For Better Unity Game Architecture
12:57
git-amend
Рет қаралды 30 М.
What it's Like Making Money with Indie Game Dev
8:24
Sasquatch B Studios
Рет қаралды 11 М.
Best FREE Software for Game Development in (2024)
8:01
anyDev
Рет қаралды 38 М.
Get started with UI Toolkit in Unity
12:29
Sasquatch B Studios
Рет қаралды 31 М.
The Power of Scriptable Objects as Middle-Men
17:41
samyam
Рет қаралды 124 М.
SPEED UP Your game development with these 10 TOOLS! (Unity)
13:25
Sasquatch B Studios
Рет қаралды 9 М.
Unity Playables is Actually a Game-Changer
13:47
git-amend
Рет қаралды 28 М.
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,4 МЛН
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 179 М.
Meet the one boy from the Ronaldo edit in India
00:30
Younes Zarou
Рет қаралды 19 МЛН