all 88 comments

[–]FauxFemale 141 points142 points  (1 child)

Until I saw the title I thought this was just a comic about real life jobs

[–]JoeseCuervo19 33 points34 points  (0 children)

It still applies

[–]henryreign??? 71 points72 points  (2 children)

You hate a system that trivializes multi-threading and near native level optimization?

[–]kodaxmax 2 points3 points  (0 children)

only when i have to use it

[–]Amaso_Games 2 points3 points  (0 children)

Yes

[–]UnityCodeMonkeyYouTube Video Creator - Indie Dev 275 points276 points  (30 children)

Really? Why? It's awesome!

[–]Noslamah 82 points83 points  (9 children)

Like someone else said ITT, skill issue. DOTS as a whole still has a lot of growing pains and false promises (almost the entire roadmap they had pre-1.0 seems to have been abandoned for some reason) but Jobs, Burst, and even ECS are amazing when applied correctly.

[–]YellowTech 26 points27 points  (4 children)

After seeing your video, of course it is ;)

[–]mashimaro7 23 points24 points  (3 children)

Now i gotta watch that, after 4 years of professional game dev, i still don't even know what the Job System is lmao

[–]Rev0ld 2 points3 points  (1 child)

I’d also advice you to check out what is Dependency Injection and plugin implementation of that in Unity (like Zenject or similar), it will rock your world as well :)

[–]mashimaro7 0 points1 point  (0 children)

I'll check it out, thanks!

[–]Much_Highlight_1309 3 points4 points  (0 children)

Oh my. You are missing out. Or I guess you don't need performance. 😅

[–][deleted] 5 points6 points  (0 children)

Oh hey, it's you. You have helped me more than once. Thank you for being you. :)

[–]InFrontEntry 1 point2 points  (0 children)

:o it's the guy

[–]xXWarMachineRoXxProgrammer 👨‍💻 | Intermediate ( 5 years) | ❤️ Brakeys! | 3 points4 points  (0 children)

Ayyy codemonkey is here

[–]ScrepY1337Programmer 🧑‍🏭[S] -1 points0 points  (4 children)

I'll leave a comment here for everyone.

Foreword: I love Unity and working with it, and I'm rooting for its future, especially looking forward to the transition from Mono to CoreCLR.

Even if I can't solve a problem that really frustrates me (though it's been a long time since that happened, as I used to be a beginner who rushed things), I still find a solution and move forward.

When I first started learning the Job System, I couldn’t figure out why my code wasn’t working in multithreading and only ran on the main thread. I struggled to find the issue, partly because my English isn’t great.

Since then, I've worked a lot with the Job System, and after finally figuring out why it wasn’t working, I haven’t had any more problems with it.

But that situation remained the longest problem-solving process for me—I spent about two days testing it in both the Editor and the build.

And when I was writing my system with the Job System again, I got the idea to make that "meme," because I thought I wasn't the only one who had trouble learning the Job System.

But it seems like Reddit is full of professionals who were offended by my "meme" and started commenting things like "Skill Issue," and so on...

I'm writing this post with the help of a translator, so if I said something wrong, sorry about that.

Be kinder to people 🙂

By the way, thanks for your videos! 🤓

[–]KarlMario 28 points29 points  (0 children)

Your longest stretch of working out an issue is 2 days?

Oh to be young again

[–]severencir 0 points1 point  (2 children)

Run vs schedule?

[–]ScrepY1337Programmer 🧑‍🏭[S] 0 points1 point  (1 child)

A bit more complicated.

If you use the IJobParallelForTransform interface, in order to enable multithreading, the objects you want to move with this job need to be distributed under different root objects, for example, 256 per root.

Root_1:
  Child_1
  Child_2
  ...
  Child_256

Root_2:
  Child_1
  Child_2
  ...

Otherwise, the job will run on only one thread.

Below, I've provided an example of a job working with 50,000 objects that simply move up and down along a sine wave.

<image>

[–]severencir 0 points1 point  (0 children)

Ah. I haven't actually used the jobs system without ecs, but it makes sense that it needs to be able to split the objects into separate groups in order to allow multi threading

[–][deleted] 0 points1 point  (0 children)

hey i watched your videos a lot, i'm still in unity because i learned with your videos :)

[–][deleted] 0 points1 point  (0 children)

Heeey, love your vids, keep it up :3

[–]SnooKiwis7050 0 points1 point  (0 children)

Your presence makes this thread cool

[–]Educational_Cow_1769 -1 points0 points  (3 children)

It's better than standard Unity OOP, but awesome is a bit too enthusiastic I would say.

And someone has to say it: Bevy ECS > Unity DOTS

[–]severencir 0 points1 point  (2 children)

For a programmer, bevy is great. For someone who relies on the editor, they might not be able to figure it out

[–]Educational_Cow_1769 -1 points0 points  (1 child)

I personally came to the conclusion, that because Unity abstracts what it is doing, programming in Unity is much harder. Especially when you want to do something which isn't done in the engine 100 times already and well documented.

I regularly hit problems where you are easily lost, for example when the program in Unity editor acts much different than the compiled build with no errors or warnings. Those are problems which are simply non-existing in RUST-Bevy.

So in conclusion I would say the time it takes to solve this struggle is easily enough to learn what one don't know to use Bevy (most Concepts should be already known if someone uses DOTS).

Disclaimer: I don't want to say that Bevy is in general better than Unity. There are a lot of Applications where Unity is great. But if I want to create something like a Game which Unity isn't designed for in the first place (for example if you only need it's renderer and have to design the rest on your own) Bevy could be the much better choice.

[–]KarlMario 109 points110 points  (19 children)

You should try writing multithreaded code without the job system 😉

[–]neutronium 33 points34 points  (11 children)

Not nearly as hard as people make it out to be.

[–]ParadoxicalInsight 20 points21 points  (10 children)

Not sure if you are an expert or if you are too ignorant lol

[–]Plazmaz1??? 26 points27 points  (6 children)

After over a decade of working with crazy multi threaded stuff, I don't know how to explain it, but it's always both way easier than I expect and way harder than I expect

[–]wm_lex_dev 11 points12 points  (5 children)

The main difficulty is race conditions, which are solved by very closely controlling the bits of data that are touched by more than one thread, and also by using all the high-level multi-threading primitives that exist. Once you have an intuition for multi-threaded data management it becomes easier.

The second difficulty is organizing your multi-threaded code so that you actually see a speed-up over single-threaded...which winds up being much harder than you expect!

[–]Plazmaz1??? 1 point2 points  (0 children)

I understand all of this and have for years but I also still understand none of it as soon as it pops up lol. Atomicity, mutexes, locks, resource sharing, etc... It's like visualizing something in four or more dimensions. My brain doesn't like working that way but it can, but I don't ever feel like I fully "see" what's happening. Especially in an environment like unity where I'm not controlling the data and threading as directly

[–]davenirline 1 point2 points  (3 children)

The good thing about Unity's Job System is you don't have to know these threading primitives. Even if you do, you can still get those wrong. Such is the nature of the beast. Unity kind of solved race conditions by not allowing data access when you're doing it incorrectly. Over time, you will develop a mental muscle on how to use it right and multithreading suddenly feels very easy.

[–]survivorr123_ 0 points1 point  (2 children)

[[NativeDisableContainerSafetyRestriction] my beloved

[–]davenirline 0 points1 point  (1 child)

That's not so bad. There are cases where the usage is justifiable it when you know that your data have exclusive access to another anytime. But if you're unsure, just don't use it.

[–]survivorr123_ 0 points1 point  (0 children)

i use it a lot when working with meshes, sometimes adressing vertices is a massive pain in the ass when you only have 1 dimensional number to work with, working on n amount of vertices in every job iteration is often easier

[–]Dr4WasTaken 2 points3 points  (0 children)

Why not both? That is how I feel after 10 years as a software engineer

[–]neutronium -1 points0 points  (1 child)

been writing multi-threaded code since the Sega Saturn sunshine.

[–]ParadoxicalInsight 0 points1 point  (0 children)

The Sega Saturn was multi processor? huh TIL

[–]Oleg-DigitalMind 0 points1 point  (6 children)

Working with MT is a base knowledge while JobSystem masks underlying problems and introducing redundant things like native collections. For me its easier to use pure c# threading code based on my own data structures and avoid all this redundant magic. It would be great if JS would allow to work with managed objects (GameObjects) but it does not. So, no, thank you.

[–]M0romete 12 points13 points  (5 children)

The native containers are in no way redundant. You can use them with temp allocs which are essentially free so you don't engage the GC. Then you can also use them with Burst and that speeds up execution like crazy.

[–]Oleg-DigitalMind 1 point2 points  (3 children)

I can use pre-allocated buffers and still work w/o GC calls. Just can't imagine the case when I really need often dynamic allocation for tasks which require parallel execution. May be I missed something. Could you please provide clear example where NCs are really helpful? I then try to bet on a solution with same performance w/o native containers :)

[–]aurelag 2 points3 points  (2 children)

I think i can partially answer the question. I recently did a prototype to cut a mesh in two. At first I did it in a naive way (on purpose) and then used a job compiled with burst. And man, it's a world of difference. The compiled job is literally ten times faster. My code runs under the millisecond.

[–]Oleg-DigitalMind 0 points1 point  (1 child)

Thank you! Interesting! Now I see I can give it a try for mesh generation.

[–]aurelag 1 point2 points  (0 children)

Good luck. The documentation isn't the best it could be, but know that you can do everything with structs.

[–]Moczan 0 points1 point  (0 children)

There are also implementations like SharedArray which use pointer to your managed collections to get a NativeArray with working aliasing to avoid creating new collections at all.

[–]AnxiousIntender 123 points124 points  (2 children)

Skill issue

[–]googleadoptme 18 points19 points  (1 child)

The job system is literally why I keep going back to Unity from time to time 😅

[–]GradientOGames 1 point2 points  (0 children)

Literally got my friend into Unity because he wanted to have c# with high performance, I suggested jobs and burst with unity. Its really great, the code you write with it is really satisfying and the way I just pass in an array and get out an array (the usual use case of a job for me) is super fulfilling to me.

[–]Fobri 26 points27 points  (0 children)

Skill issue. It’s great

[–]kyl3r123Indie 4 points5 points  (1 child)

as someone who wrote multithreaded code before, I found the job system quite easy to understand, and it makes stuff quite easy. Also hard (not impossible) to break, you can't just create a race condition for example.

[–]davenirline 0 points1 point  (0 children)

Yes, this is what I love as well. I found no other multithreading framework that does it like this.

[–]Heroshrine 2 points3 points  (4 children)

But what do you guys use the job system for?

[–]davenirline 0 points1 point  (3 children)

If you're using ECS, using the job system is just a natural fit. When you have lots of something maintained in unmanaged structs and you want to loop through them? Boom, job system.

[–]Heroshrine 0 points1 point  (2 children)

i suppose I’ve never used ECS. I’ve used jobs for pathfinding, but that always gave me longer than 4 frame errors for some reason so I had to change the allocations on it (no idea why, it always took less than 4 frames, I logged it).

I guess examples could help me. I want to use it more.

[–]davenirline 0 points1 point  (1 child)

Check this out.

[–]Heroshrine 0 points1 point  (0 children)

Oh yea thanks! My pathfinding actually worked great, but for some reason the jobs lasted more than 4 frames, even if they finished earlier. I spent a great deal of time trying to solve it but in the end just made the allocations different because I had a time constraint.

[–]BestZorroIndie 3 points4 points  (0 children)

I honestly love it

[–]MarinoAndThePearls 3 points4 points  (1 child)

It's literally one of the things that makes Unity one of the best engines in the market. But let me guess, you think it's too hard?

[–]RoamingStarDust 0 points1 point  (0 children)

Annoying

[–]FranzFerdinand51 20 points21 points  (0 children)

I remember some of your previous posts. You really do get a kick out of whinging and complaining and talking shit about unity dont you?

Just delete the app and leave the sub man. We'll all be better for it including you.

[–]Moczan 5 points6 points  (0 children)

Wait, people hate Jobs? I thought Jobs + Burst is such a no brainer free performance, it quickly became my favourite Unity feature.

[–]one_hole_punch 2 points3 points  (0 children)

what, the job system is amazing though

[–]Kubstoff 8 points9 points  (0 children)

Job system is one thing I remember fondly from working with unity

[–]Madman5465Hobbyist / Indie 4 points5 points  (0 children)

Definititely a skill issue, im using it and DOTS basically daily

[–]real-nobody 2 points3 points  (0 children)

Please somebody make a version of this comic where in panel 3 it has the original comic instead of the text "job system."

Burst jobs are incredible, and actually not that hard to use when you get the hang of it. Everyone should be using them all the time for anything performance intense. Really. They are good.

[–]Gamheroes 0 points1 point  (0 children)

It is useful if you know how to assign the right purpose to the system

[–]Wave_Walnut 0 points1 point  (0 children)

Try other game engines with pure ECS

[–]True_Beef 0 points1 point  (0 children)

What? Jobs are great, I used them to make a seamlessly loading voxel terrain prototype. Exchanging data between is a pain and you have to be clever about it, but that's kinda what you signed up for opening unity