Тёмный

Unity DOTS: System Base 

Wilmer Lin GA School
Подписаться 12 тыс.
Просмотров 15 тыс.
50% 1

In this episode, we apply the C# Job System to ECS WaveSystem. This gives us the benefits of multithreading with the example ECS System using the newer SystemBase.
Starter Project:
github.com/UnityGameAcademy/D...
Software: Unity 2019.3.2 with HybridRender Version 0.4.0 and Entities Version 0.8.0 from the PackageManager.
Also check out the previous videos in this series:
Unity DOTS: Creating an Entity
• Unity DOTS: Creating a...
Unity DOTS: Conversion Workflow
• Unity DOTS: Conversion...
Unity DOTS: Components and Systems
• Unity DOTS: Components...
Unity DOTS: C# Job System
• Unity DOTS: C# Job System
Want to learn more about DOTS and ECS? Sign up for our mailing list to get notified when the premium course releases:
gameacademy.school/1109-2/
Want to support this channel? Subscribe to our premium courses at GameAcademy.school:
gameacademy.school/portfolio/
Let’s build something cool together!
References:
Blittable types:
docs.microsoft.com/en-us/dotn...
CORRECTIONS/UPDATES: You do not need [AlwaysSynchronizeSystem] when invoking Run on the Main Thread.

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@behnamrasooli8801
@behnamrasooli8801 4 года назад
I really love to see someone like you explain how to implement gameplay logic with ECS. Because spawning 10,000 cubes is not the whole part of making a game. I heard that ECS is not only good for performance but also making the gameplay logic easier to write, debug, and extend.
@GameAcademySchool
@GameAcademySchool 4 года назад
Well, it's different. The classes are shorter, so that makes them easier to debug. You don't have so many classes and subclasses so it's easier to read and debug in that aspect. But honestly it's six of one, half a dozen of the other at the moment. It's just a different way of organizing your logic. The performance aspect is a big part of it...but the architecture change is needed for a more long-term evolution of Unity. Eventually the Editor will catch up to the current state of using GameObjects and Monobehaviours as far as ease-of-use. Anyway, we'll see if enough people are interested in building a complete DOTS mini-project.
@jakehix8132
@jakehix8132 4 года назад
@@GameAcademySchool Wud love a DOTS project video. Not even a finished mini-project, though... like a rushed dive into doing like a rough RPG or something, showing the bare bones of what different completed systems could look like. Variety > thorough. Great vids.
@martin_isla
@martin_isla 3 года назад
I never comment on RU-vid, but you just explained the differences so well I felt like I had to let you know. Thank you.
@GameAcademySchool
@GameAcademySchool 3 года назад
Thanks! Glad you enjoyed it. Still waiting on DOTS to mature before we make any more videos...
@martin_isla
@martin_isla 3 года назад
@Game Academy.school Yeah, I started learning last week and found things from 6 months ago that are already obsolete. In any case, the content in your channel is more than enough for devs to get the idea behind DOTS (even if things change) and be better prepared when it's officially out. Thanks again!
@washynator
@washynator 4 года назад
Another excellent video! Loving your DOTS-videos, please keep them coming! :)
@unclerandy398
@unclerandy398 3 года назад
Brilliant explanations, I think if you made a full course there would be a lot of interest.
@RomanNaumov
@RomanNaumov 3 года назад
You made best DOTS-videos I've ever seen. Thank you.
@gndevelopment6798
@gndevelopment6798 4 года назад
Take a bow son! Excellent series many thanks.
@thalysantana
@thalysantana 2 года назад
I have searched a lot for DOTS content and this is undoubtedly the best one I found. Great explanations. Amazing series.
@ataro4x
@ataro4x 4 года назад
Absolutely lovely series for DOTS and it would be really awesome to see a complete DOTS mini-project. It would motivate me to start project using dots.
@richerlecool
@richerlecool 3 года назад
Your videos are great for people who actually wanna learn. Someone who needs a quick "how to" would get bored here, but people like me and many others who need to understand the fundamentals before trying to do stuff on our own really appreciate your lessons :) So thank you!
@xinrutang6883
@xinrutang6883 3 года назад
I like your Unity videos, speaking very clearly and English accent is nice too. Hope you can make more Unity tutorial videos!
@wrinklymon
@wrinklymon 4 года назад
I actually think I understand the job system in Unity now, thanks! First video that's really clicked with me.
@GameAcademySchool
@GameAcademySchool 4 года назад
Thanks!
@shakofarhad876
@shakofarhad876 4 года назад
This DOTS series is great! Thank you very much! Please keep them comming. :D
@GameAcademySchool
@GameAcademySchool 4 года назад
Shako Farhad please share them. Not enough viewers to justify more...
@shakofarhad876
@shakofarhad876 4 года назад
@@GameAcademySchool I understand. I'll do my part. Thanks for making such informative videos. They are much appreciated!
@christofstanits
@christofstanits 4 года назад
excellently well explained! great channel
@maezir1808
@maezir1808 4 года назад
Great series so far. ECS in Unity was daunting for me at first but you've explained things really clearly. Also +1 for seeing an implementaiton of these concepts in a real game, even if it's just something small like an Asteroids clone.
@Forjugadname
@Forjugadname 4 года назад
Really great tutorial, I've been using this stuff, but with barely understanding it, great explanation.
@huangrichard8466
@huangrichard8466 3 года назад
Thanks for all the high quality videos. Hope there'll be more courses from you.
@RyanDB
@RyanDB 4 года назад
THANK YOU! With everything changing so quickly, this is the first I've even heard about this, and it's super useful to know
@Ankhtepot
@Ankhtepot 3 года назад
I bought several of your courses because how you teach is really valuable. Thanks! This mini series was awesome too :)
@afarman87
@afarman87 3 года назад
Went through the whole series before leaving a comment. I just want to say thank you so much for the great tutorial. Your explanation is so clear and concise. Very easy to digest. Thank you!
@Songfugel
@Songfugel 3 года назад
This video was amazing in clarifying the varying techniques in various tutorials
@DmitriNanaktaev
@DmitriNanaktaev Год назад
Awesome! Keep doing what you are doing.
@lkhprime
@lkhprime 4 года назад
Yeah!!!
@starburstdragon
@starburstdragon 4 года назад
Excellent stuff on this channel thx for sharing
@aaaAaAAaaaaAa1aAAAAaaaaAAAAaaa
@aaaAaAAaaaaAa1aAAAAaaaaAAAAaaa 4 года назад
Seriously amazing tutorial, you have taught me more about DOTS and ECS than any of the unity documentation!
@GameAcademySchool
@GameAcademySchool 4 года назад
Arcanine300 Thanks! Please share with anyone interested :)
@AM-dj4vp
@AM-dj4vp 3 года назад
wow, AMAZING!
@ajnabi-
@ajnabi- 3 года назад
You are an amazing teacher! Very clear and very detailed explanation. Waiting for a full DOTS course on Udemy by you. :)
@GameAcademySchool
@GameAcademySchool 3 года назад
Sorry I guess you’re not on the mailing list. Since DOTS fell off the Unity Roadmap so did the course. It’s delayed by at least a year. Just waiting and seeing since DOTS is not leaving preview for a while.
@denissachkov6693
@denissachkov6693 4 года назад
bless you
@JxcksonSF
@JxcksonSF 4 года назад
Cant wait to dots be fully implemented. Even if i try now, every tutorial on the internet use a different sintax 😂😂😂 so i will wait the 1.0 and than convert my project.
@smgvlad
@smgvlad 4 года назад
Excellent. Please show a basic game whenever possible, using SystemBase approach. thanks
@LukibillyBase
@LukibillyBase 4 года назад
Do you have to complete the jobs in SystemBase? Amazing series btw
@w-hellhaus
@w-hellhaus 4 года назад
Thank you so much for these videos, they've been really helpful for learning. I'm using the 0.11 for entities right now though, and my worker threads aren't doing any work with the JobComponentSystem, it's still all being done in the main thread. I've tried looking at the changelogs between versions, but I haven't really found a reason why this is happening, Is there anything you could point me towards to explain what might've changed in between versions? Update: Nevermind, turns out I was viewing my profiler wrong and wasn't scrubbing correctly to see what was happening while it was actually in play mode and was just seeing what was happening before and after exiting play mode
@shirosurfer8864
@shirosurfer8864 4 года назад
Please do more, make one using triggers and command buffers to add components please When does the course come out?
@lizkimber
@lizkimber 4 года назад
Id love to see how to make a system that runs on one lot of entities such as turrets, and finds each ones nearest entity of type mob
@GameAcademySchool
@GameAcademySchool 4 года назад
That is actually the perfect type of thing to use this for
@shenshaw5345
@shenshaw5345 3 года назад
So I should just use system base instead of jobs?
@omgawesomeomg
@omgawesomeomg Год назад
Is there any reason to Jobify a System when running it on the main thread with .Run() ? There wouldn't be any performance benefit, right?
@iamarugin
@iamarugin 4 года назад
You do not need [AlwaysSynchronizeSystem] in the SystemBase when using Run
@GameAcademySchool
@GameAcademySchool 4 года назад
Missed the memo.
@richardbiely
@richardbiely 4 года назад
Just a note - it’s not C# job system. It’s Unity3D job system. Those are two very different things.
@GameAcademySchool
@GameAcademySchool 4 года назад
docs.unity3d.com/Manual/JobSystem.html Sorry, I didn't name it. Unity calls it the "C# Job System" -- you'll need to take it up with their Marketing and Tech Documentation departments. :)
@chenbin0802
@chenbin0802 3 года назад
Thanks for the video. 5:31 when I change ref to in, I got a compile error.
@chenbin0802
@chenbin0802 3 года назад
Also 6:21, also converted from ComponentSystem to JobComponentSystem. the job still only run on mainThread. my fps is still low, even lower than ComponentSystem way.
@sconosciutosconosciuto2196
@sconosciutosconosciuto2196 4 года назад
:D
@sconosciutosconosciuto2196
@sconosciutosconosciuto2196 4 года назад
You explain very well how it works :D
@simon000winter
@simon000winter 4 года назад
Hey, inb4 nice clean tutorials! I have a bunch of questions i hope you or someone else can explain me: 1. Having Time.ElapsedTime outside the job implies, that all jobs use the same time stamp. So is it guaruanteed that all the jobs get executed that very frame i shedule them? 2. Does a ECS only game make sense? i mean, i have no grasp on how to apply ECS and the jobsystem to character control for example. Is combining ECS and the old way a thing? like exclusivley use ECS for things that get updated/used often, but things that exist just once can still be normal GameObjects? 3. As concrete question, let's say i want to implement the marching cube algorithm (voxels), where do i actually put the instiantion of the mesh? does that belong into a system if i create topology? do i have to split up the voxel grid into chunks to make use of the jobsystem? Thank you in advance for every comment and help!
@GameAcademySchool
@GameAcademySchool 4 года назад
1. You're passing the timeElapsed as a float into the Job. The Job is not correlated to the World clock. It's just passing in a value as you throw the Job into the Job Queue when you Schedule. You would hope that it can run the same frame but there's no guarantee of that. It's just done when it's done. If it's super critical and absolutely needs to match the World clock, you should run on the MainThread instead of using a Job. 2. From what I have seen, you'll still need some Monobehaviours as a jumping off point. Some degree of game management that ties you back to the Editor. Often you will have some static settings or values. You can still use methods from the UnityEngine within ECS. For example, you can pass Input as data into a System. That way you can drive your player using ECS. But those need to execute those on the Main Thread, so just use Run() instead of Schedule or ScheduleParallel
@GameAcademySchool
@GameAcademySchool 4 года назад
3. You can definitely use the EntityManager to Instantiate Entities at runtime. I think we just used the Spawner Monobehaviour in this example because it was simpler. But yes, you can just make a System for that. I mean all Logic runs in a System, so that's where you put it.
@GameAcademySchool
@GameAcademySchool 4 года назад
Also what I didn't mention in these videos, you don't have use the Entities.ForEach query for everything. It's just a common way to do stuff to check on the existing Entities. You also could schedule a single Job.WithCode if you just want to schedule a single bit of logic. Or just do whatever you want in the other parts of a SystemBase. Just like a Monobehaviour has Awake/Start/Update/etc, a SystemBase has OnCreate, OnStartRunning, OnUpdate, OnStopRunning, OnDestroy. Use those the same way. OnUpdate is the only method that is mandatory to implement. That's why we show it here.
@nanami-dl7eh
@nanami-dl7eh 4 года назад
Using Entities.Foreach will burst automaticaly?
@GameAcademySchool
@GameAcademySchool 4 года назад
If you’re using the Jobs System, Burst enabled is default. But stuff running only on the main thread is not Burst compiled
@Ziboo30
@Ziboo30 4 года назад
With the new SystemBase I don't think you need the [AlwaysSynchronizeSystem]
@GameAcademySchool
@GameAcademySchool 4 года назад
Robin Bonhoure correct. Sorry that was an error on my part
@lizkimber
@lizkimber 4 года назад
interesting when I do an JobHandle jh = Entities.Foreach ... it tells me it returns a void and I cannot get the job handle for it....
@GameAcademySchool
@GameAcademySchool 4 года назад
Make sure you are using a Job and not running it on the Main Thread
@lizkimber
@lizkimber 4 года назад
@@GameAcademySchool well schedule and scheduleparrallel are supposed to return jobhandles right?? .. Im also finding major restrictions in what i can do inside the foreach, even more than before.. as an example, I want to get a list of entities, positions and health points, and then itterate through turrets and pick the closest to each turret and zap it down 5 health, and then obviously update the original entities with health points to say how many they lost....
@GameAcademySchool
@GameAcademySchool 4 года назад
@@lizkimber You need to use this.Dependency when using Schedule or ScheduleParallel if you want a JobHandle back. e.g. ScheduleParallel(this.Dependency); Then you will need to use the JobHandle methods to combine them and set this.Dependency to whatever your final JobHandle is. Otherwise, use the automatic dependency by just putting the Entities.ForEach queries in order, which is probably what they are pushing us to do.
@mrbinggrae5954
@mrbinggrae5954 4 года назад
I need Korean subtitles.
@GameAcademySchool
@GameAcademySchool 4 года назад
binggrae Mr unfortunately somebody will need to contribute those. RU-vid creates English only by default
Далее
Unity DOTS: C# Job System
19:47
Просмотров 20 тыс.
DOTS Gameplay: Trigger Events
25:02
Просмотров 12 тыс.
Дьявол - ТРЕШ ОБЗОР на фильм
19:10
Unity DOTS: Components And Systems
18:50
Просмотров 16 тыс.
Unity Asset Store: Spring 2020
9:32
Просмотров 11 тыс.
Getting Started with the Job System in Unity 2019
25:54
Simulating the Evolution of Rock, Paper, Scissors
15:00
DOTS GamePlay: Tags
19:09
Просмотров 10 тыс.
Unity Job System - A Practical Code Example
13:50
Просмотров 81 тыс.
What are Subscenes in Unity? (Massive Worlds!)
15:51
Просмотров 95 тыс.