Тёмный

Unity DOTS: Conversion Workflow 

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

In this episode, we create Entities using the "hybrid" Conversion Workflow for DOTS. First we define a GameObject and then add a ConvertToEntity utility. Data from the GameObject then gets transferred to a corresponding Entity at runtime.
We can also define an EntityPrefab and generate many more Entities using our Monobehaviour script.
Download the starter or final projects on GitHub:
Starter project:
github.com/UnityGameAcademy/D...
Final project:
github.com/UnityGameAcademy/D...
Software: Unity 2019.3.2 with HybridRender Version 0.3.4 and Entities Version 0.6.0 from the PackageManager.
Also check out the previous video:
Unity DOTS: Creating an Entity
• Unity DOTS: Creating a...
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/

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

 

19 фев 2020

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@MikevomMars
@MikevomMars 4 года назад
This is by far the *best* ECS tutorial out there - looking forward for more episodes 👍
@GameAcademySchool
@GameAcademySchool 4 года назад
Mike vom Mars Thanks! Now we, uh, just gotta get some more viewers...
@workflowinmind
@workflowinmind 3 года назад
@@GameAcademySchool He is right, I'm not new to any of this tech stack outside Unity, but I had a hard time wrapping my head around Unity's implementation, your videos cover the most basic aspects that are completely ignored in other videos (even the ones made by Unity themselves)... This playlist should be featured on Unity's website
@abedanilo
@abedanilo 4 года назад
You....ROCK! Concise, clear, no babbling and poor jokes. I pour myself a bourbon, hit play and enjoy your lessons. Keep up the good work!
@lkhprime
@lkhprime 4 года назад
Thanks and please keep making videos, your tutorials are one of the clearest and beginner friendly on RU-vid
@GameAcademySchool
@GameAcademySchool 4 года назад
Thanks! Please share the videos!
@iliachebotarev4071
@iliachebotarev4071 3 года назад
Sir! I'm concerned, your language is one of the clearest on youtube tutorial space, and the approach of teaching also very simple to understand the subject! The watching of your tutorial is the purest pleasure! Wish good luck with the growth of your channel audience. From Russia, with love:)
@diliupg
@diliupg 3 года назад
You can easily be the best Unity Master on RU-vid. This is the best ECS Tutorial here and this is better than some paid courses on Udemy! FANTASTIC!
@RaoulWB
@RaoulWB 4 года назад
I've spent quite some time trying to learn about ECS and these two video finally put me in the right path. Thanks a ton!
@Orinocoe
@Orinocoe 4 года назад
Best ECS tutorial! Simple and only what is need.
@kelvinkk577
@kelvinkk577 3 года назад
Great tutorial, very clear and easy to follow. Subscribed!
@nickprice6644
@nickprice6644 4 года назад
Hi, Thanks for the videos. As soon as I started watching this I immediately thought of the MVC design for creating GUI applications. Regards, Nick
@LukeAps
@LukeAps 3 года назад
Very well done sir, quality educational content.
@piyushdamania2087
@piyushdamania2087 4 года назад
By far the easiest way ,kudos ! Please make physics interaction and translation updation
@GameAcademySchool
@GameAcademySchool 4 года назад
Yes, we will cover the basic parts of DOTS... still working on the Component + Systems video...
@deadly_artist
@deadly_artist 4 года назад
dude wtf, 100k standard cubes, by just enabling gpu instancing, the performance went from 30fps to 80... Amazing tutorial dude (the last one as well). Already watched brackeys and code monkeys tutorials, but they always only showed the how's and not the why's. Finally found motivation to dig into ecs again!
@qin6409
@qin6409 2 года назад
please let me know how to tip you, I searched a lot of videos which were totally wasting my time, this video is best video!
@HOSTRASOKYRA
@HOSTRASOKYRA 4 года назад
Please continue
@GameAcademySchool
@GameAcademySchool 4 года назад
SENJORTOPOR another video coming soon!
@angel1st007
@angel1st007 4 года назад
Hi there. I must say - it was a crystal clear and comprehensive ESC lesson!. One question though - is it possible to expand the tutorial by adding a different color per each instantiated entity? If that's possible, how should the code look like?
@GameAcademySchool
@GameAcademySchool 4 года назад
If you want to use the Conversion workflow, I suggestion you setup multiple Prefabs with different materials. Then in the Spawner add a method to randomly select a prefab, instead of having the EntityManager always selecting the same Prefab.
@ves3219
@ves3219 4 года назад
I'm sorry I forgot the translation in the previous comment - corrected
@gndevelopment6798
@gndevelopment6798 4 года назад
I was getting memory errors when using 2019.4 had to change gameObjectConversionSettings call to : void Start() { ... BlobAssetStore blobAssetStore = new BlobAssetStore(); GameObjectConversionSettings settings = GameObjectConversionSettings.FromWorld(defaultWorld, blobAssetStore); ..... blobAssetStore.Dispose(); }
@r.i.p.4485
@r.i.p.4485 3 года назад
I like how the video skips forward , right when this problem arises. I Thank you for posting the answer, my eyes were beginning to bleed.
@-.._.-_...-_.._-..__..._.-.-.-
@-.._.-_...-_.._-..__..._.-.-.- 3 года назад
Now I'm getting "A Native Collection has not been disposed, resulting in a memory leak. Allocated from: Unity.Entities.BlobAssetStore:.ctor()". All I can find are people from 2019 saying this will be fixed soon.
@neoplumes
@neoplumes 3 года назад
So I'm really loving this series. It's the best I've found for explaining how to actually get started with DOTS... I'm a little bit concerned about teaching younger programmers that fields are lowercase and function-scoped variables require a "my" prefix. In my codebase at work, it's flipped and I've thought that was the Microsoft standard for C#. Am I off on that?
@GameAcademySchool
@GameAcademySchool 3 года назад
My understanding is that public identifiers are PascalCase and parameters are camelcase. With private variables you have some latitude. docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions
@neoplumes
@neoplumes 3 года назад
@@GameAcademySchool that's an interesting article. A parameter would typically be anything passed into a function... But I guess you could sort of make the case that unity passes in a value to that class and so call it a parameter even though it's technically not... I tried looking myself for any documentation of when to use my, and it doesn't seem to be standard, so you could use it in either case I guess. I've just always heard PascalCase for public class level variables, myCamelCase for private class level variables, and camelCase for function-scoped variables. But again, since it's not part of C# docs, I guess it's up to the developer. And I love the tutorial, I'm just being nitpicky
@whiitehead
@whiitehead 4 года назад
This is amazing. I'm definitely going to pay for the premium course when it comes out. Any idea when that might be?
@GameAcademySchool
@GameAcademySchool 4 года назад
Sorry, unfortunately some other obligations have delayed the course's release. I will post an update some time in July to see where it stands...
@whiitehead
@whiitehead 4 года назад
@@GameAcademySchool Thanks
@atsimourtos
@atsimourtos 4 года назад
Really nice explanation! But I have a question my friends...is it faster in terms of performance to use Pure ECS than Conversion Flow? Because it seems that using Conversion Flow is a nice to have (easy translating prefabs to entities)
@GameAcademySchool
@GameAcademySchool 4 года назад
A tiny bit, but you'll probably use the conversion workflow most of the time. Note that you'll probably do the conversion using SubScenes, which is better than the ConvertToEntity utility described in this video. Stay tuned for a future video where we show that.
@gm_000
@gm_000 4 года назад
Thanks for the tutorial, it is much more cleaer than the official one (if we can call that a tutorial or a guide). I tried to replicate, but in GameObjectConversionSettings it required me to pass new BlobAssetStore() as second argument, it works, but after 6 seconds the application is running it crashes with the following error: "A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details." I do not know why...
@GameAcademySchool
@GameAcademySchool 4 года назад
Are you using the same versions of the packages ?
@gm_000
@gm_000 4 года назад
@@GameAcademySchool Actually I discovered that this issue arises because I have Physics package installed...
@gm_000
@gm_000 4 года назад
With physics package a reference to a BlobAssetStore must be provided. Finally, the BlobAssetStore must be disposed in the method OnDestroy().
@ves3219
@ves3219 4 года назад
@@GameAcademySchool I have the same problem. Physics package is also installed, but I need it, how do I solve the problem?
@GameAcademySchool
@GameAcademySchool 4 года назад
VES you need packages that are compatible with each other. Check the dependencies in the package manager. Don’t try to upgrade above the required version number.
@dacifdaj
@dacifdaj Год назад
by this path it's duplicating convert IconversionGameObject
@p4u1
@p4u1 4 года назад
How can I convert a GameObject with a collider attached to it? Is it possible to have a ECS GameObject collision detection?
@GameAcademySchool
@GameAcademySchool 4 года назад
Yes GameObjects with Colliders get converted into Entities with Unity Physics components. Keep going through the series
@stephanbusse1044
@stephanbusse1044 4 года назад
Does converting GameObjects to Entities only take place while the game is being built or every time it is started?
@GameAcademySchool
@GameAcademySchool 4 года назад
Stephan Busse this video shows the old way. Using SubScenes is preferred and stores the conversion as a binary in the project
@user-wl8my7oi1m
@user-wl8my7oi1m 3 года назад
ECS Conversion gives 0 gain when even classic mode gives like +2 fps more. Only Pure worked for me for gaining FPS???
@bovineox1111
@bovineox1111 2 года назад
I don't understand why you ended up with two entities? One appeared to be auto converted the other generated by the script. Where did the former come from? Did the prefab just get converted and added to the scene?? That would be odd. I'll go back and re-watch...
@bovineox1111
@bovineox1111 2 года назад
I'll code it up and check, but I am guessing we get an entity from the prefab but this is not visibile in the scene?
@ves3219
@ves3219 4 года назад
I'll ask you another question if you don't mind how do I add a new component here " " Entities.ForEach((Entity entityEnemy, ref TargetData targetData, in TeamTag team, in Translation translation) => { float distance = 10000000000; for (int i = 0; i < entitys.Length; i++) { int teamTag = GetComponent(entitys[i]).team; if(teamTag != team.team) { Translation translationEnemy = GetComponent(entitys[i]); float mathDistance = math.distance(translation.Value, translationEnemy.Value); if (distance > mathDistance) { distance = mathDistance; targetData.target = entitys[i]; targetData.position = translationEnemy.Value; } } } }).ScheduleParallel(); " for "entityEnemy " while still being able to use SystemBase?
@championsofodin9868
@championsofodin9868 3 года назад
So is the gameobject and monobehavior way of programming being deprecated or whats the deal?
@GameAcademySchool
@GameAcademySchool 3 года назад
No, not at all
@sergeydroba
@sergeydroba 3 года назад
Unfortunately, this is not about the conversion of the game, it is pure ECS tutorial mostly. Just one mention about ConvertToEntitiy compoment
@GameAcademySchool
@GameAcademySchool 3 года назад
Сергей Дроба yes, it about using the conversion workflow with ECS/DOTS versus the pure ECS. Unfortunately it’s already out of date and the SubScene workflow replaces it since ConvertToEntity is getting phased out.
@r.i.p.4485
@r.i.p.4485 3 года назад
WOW, i didnt do the math correct and put in 400 by 400 when i meant 40 by 40 to get 400. I JUST GOT 160,000 CUBES WITH BRICK NORMAL MAP AND ALBEDO HIGH DEF ANDALL ON 45 TO 60 FPS. I JUST NULLED IN MY PANTS.
@tbunreall
@tbunreall 2 года назад
outdated already
Далее
Unity DOTS: Components And Systems
18:50
Просмотров 16 тыс.
Unity DOTS: C# Job System
19:47
Просмотров 20 тыс.
skibidi toilet multiverse 039 (part 2)
08:58
Просмотров 5 млн
Unity DOTS: Creating an Entity
15:59
Просмотров 49 тыс.
Unity DOTS: System Base
12:47
Просмотров 15 тыс.
Unity DOTS Entity Manager And Command Buffer
8:32
Просмотров 1 тыс.
Unity Job System - A Practical Code Example
13:50
Просмотров 81 тыс.
Converting your game to DOTS - Unity at GDC 2019
25:51