Тёмный
No video :(

DOTS Gameplay: Collision Events 

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

In this episode, we review syntax for setting up a Collision Event, where we crash the Chasers into our Asteroids. First we create a couple of Components, HealthData and DeathColliderTag. Then we create two Systems, one to remove "dead" Entities and one to handle the collision between Chaser and Asteroid.
Starter project:
bit.ly/2XvPrcU
Final project:
bit.ly/2A2WO2z
This is a longer episode. Use the timestamps below:
TIMESTAMPS
0:44 Package Versions
1:14 Revised Asteroid Setup
1:55 Revised Chaser Setup
2:13 Starter Project: CollisionEvent Scene
2:31 Chaser Physics Authoring
3:11 HealthData
4:09 RemoveOnDeathSystem
7:46 DeathColliderTag
8:26 DeathOnCollisionSystem
9:49 DeathOnCollisionSystem: Setup Physics Worlds
11:25 DeathOnCollisionSystem: ComponentDataFromEntity
12:52 DeathOnCollisionSystem: Execute method
15:29 PlayTest
16:37 More Entities
17:23 Outro
Software: Unity 2019.3.15f1 (MacOS) with Unity Physics 0.3.2, HybridRender Version 0.4.1 and Entities Version 0.9.0 from the PackageManager.
Also check out the previous videos in this series:
DOTS Gameplay: Basic Player Input and Movement:
• DOTS Gameplay: Basic P...
DOTS Gameplay: Tags:
• DOTS GamePlay: Tags
DOTS Gameplay: ComponentDataFromEntity:
• DOTS Gameplay: Compone...
DOTS Gameplay: EntityQuery
• DOTS Gameplay: EntityQ...
DOTS Gameplay: Trigger Events
• DOTS Gameplay: Trigger...
Want to learn more about DOTS and ECS? Sign up for our mailing list to get notified when the premium course releases:
gameacademy.sc...
Want to support this channel? Subscribe to our premium courses at GameAcademy.school:
gameacademy.sc...
Let’s build something cool together!
Ready to go Pro? Get Unity Pro here (affiliate link):
prf.hn/click/ca...

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

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@yellemonster
@yellemonster 4 года назад
You have the single best DOTS educational resource on the internet. Thank you for your work!
@GameAcademySchool
@GameAcademySchool 4 года назад
Joshua Abraham Thanks! Please share these videos to help get the word out.
@steveoddjobs8974
@steveoddjobs8974 4 года назад
Totally agree, understand so much more because of this channel.. ​ Game Academy.school could you give an example on how to use CollisionWorld.OverlapAABB? Use case relevant to your content example, being an asteroid spawner and dont want them spawning so close that they intersect and have an automatic collision.
@steveoddjobs8974
@steveoddjobs8974 4 года назад
Figured out where I was going wrong, you cant detect colliders that were created in the same frame, as there is no current BuildPhysicsIncrementalPhase step? something to that effect, so you can only detect existing colliders... I've had to change to an incremental spawner, 32 at a time for less chance of initial intersects, and then each new batch can check for existing colliders... however this will always have the chance that some of each batch can end up intersecting..
@YouReyKarr
@YouReyKarr 4 года назад
@@steveoddjobs8974 Sounds like you'll need to detect them your self using the positions. You know where you are spawning and you know how big it is. The most optimal strategy is to use grid spawners, then you just check if something is being spawned in a cell if it is pick a new position. You can get as clever as you like or just have some pretty broad rules, either will work for asteroids I reckon.
@andrewcraswell4117
@andrewcraswell4117 3 года назад
Watching these months later and they're still the best info on DOTS out there for beginners. I scoured the Unity docs, RU-vid, and plenty of other sources. This is the most up-to-date and pretty much the only source I would recommend to others. Really hope you can eventually put out a course when DOTS is farther along, I'll be the first to pay for it. But after watching these I feel I have enough context to start reading the Unity documentation and understanding the API at a deeper level, thank you!
@Arkaen-AI
@Arkaen-AI Год назад
This looks like a great educational project/resource. I'm training new C#/Unity engineers right now, as I am simultaneously learning DOTS-style programming! I've been developing engines and games for well over a decade, but DOTS/ECS is new technology to me too! However, it makes a whole _lot_ of sense to me, and I am really starting to love the concepts and the elegance and scalability of it! Thanks so much, I plan on making some videos on the new 1.0.8 package releases! I've already got a 3D spaceship flight sim prototype underway :D 💞
@qin6409
@qin6409 2 года назад
Thank you, Willmer, even though I am using ECS0.51, most of the cases are the same, your classes are very attractive, and I can learn your video for whole days, wait for your new courses. I will recommend your videos to others too!
@MrMorvar
@MrMorvar 4 года назад
This series have been just pure gold so far. Thank you much! I understand that the topic might not be the best for catching views but more than ever do I feel like you'd deserve some money for the effort. Looking forward to that GameAcademy course!
@GameAcademySchool
@GameAcademySchool 4 года назад
Morvar Thanks for the positive vote. If you can share this video it would help.
@spiderman233
@spiderman233 4 года назад
I can't thank you enough for these tutorials, some of the best tutorials i have seen in YT ever.
@lamnt7608
@lamnt7608 3 года назад
Please update more , this is best DOTS series I've ever seen
@SoulDragonXI
@SoulDragonXI 4 года назад
Hey Game Academy.school, I really appreciate this course and it's structure. Coming from Web-Dev, your course reminds me of classes I took to learn MVC. You are doing amazing job of teaching hierarchy/structure ,and orienting the concepts before the goal (goals being collision, healthsystems, etc.). I was having a hard-time grasp-ing DOTS workflow and relationships, until I've watched your videos. Thank you so much for your work!
@GameAcademySchool
@GameAcademySchool 4 года назад
Glad you enjoy it!
@LucGendrot
@LucGendrot 3 года назад
Lest you think demand for a full course has died down, let me add to the chorus of folks saying I would enthusiastically pay for a full ECS/DOTS course. I even signed up for the mailing list and I *never* do that. Waiting on baited breath over here!
@GameAcademySchool
@GameAcademySchool 3 года назад
Thanks for the feedback. Unfortunately I’m not sure if DOTS is really far enough for a full course. After falling off the Roadmap for 2021, it feels like we should wait.
@LucGendrot
@LucGendrot 3 года назад
@@GameAcademySchool Any chance for a few more one-offs in this playlist then? I don't mean to sound pushy or demanding, but frankly with Unity being so bad about documentation the community is clamoring for DOTS resources as good as this.
@CollMomo1
@CollMomo1 3 года назад
omg, what a tease... still thanks for the classes....
@samyam
@samyam 3 года назад
Great series!! Super helpful 🙂
@MrKalapoika
@MrKalapoika 4 года назад
I have a performance issue with this last system and I wonder if you have it too? Earlier in the project I added 10k independent chasers and still had 200fps. Now it's dropping to 30fps with 50 chasers. From the profiler the main culprit seems to be DeathOnCollisionSystem with 14.5ms. Did I miss some optimizing bit or is there maybe a design flaw somewhere? Thanks for the series it has been awesome!
@paradisefallen8385
@paradisefallen8385 4 года назад
Wow. Just in time. Btw how to imliment UI in DOTS? I need UISystem or what? =)
@GameAcademySchool
@GameAcademySchool 4 года назад
See above comment. It's more practical to make a "bridge" script to send some data back and forth to the Monobehaviour world.
@polygonware6469
@polygonware6469 3 года назад
were there be more DOTS tutorials?
@clfarina
@clfarina 3 года назад
@Wilmer Lin GA School Thank you very much. I just purchased some of your courses on Udemy to support this work! In the preview images for this series, several of the entities have trails. How did you accomplish this in DOTS? I would very much like have a trail renderer equivalent in DOTS.
@Kaei7
@Kaei7 4 года назад
Any estimation on when the full course will be released? I just want to say I'd be more than willing to pay for a continuously up-to-date resource regarding the optimal ways to leverage DOTS at any particular point in time, since the API changes so much and it's so poorly documented and exemplified.
@GameAcademySchool
@GameAcademySchool 4 года назад
It's looking like late July, but I expect some updates later this year as the packages update. Quite a lot of re-recording and editing is in progress. The API has settled down now. Inevitably there will be changes but they feel smaller each iteration.
@kennethgriffin5761
@kennethgriffin5761 3 года назад
Can't find the full course about DOTS on your website when I click your link.
@GameAcademySchool
@GameAcademySchool 3 года назад
Ah, I guess you're not on the mailing list. Yeah, I pulled the plug on the course a few months ago after DOTS dropped off the Roadmap for Unity 2021. It didn't leave Preview this year, and was pushed to a longer-term project. While the core ECS package seems to have mostly settled down, a lot of the surrounding stuff for the game engine is missing. In particular, Animation is a big glaring hole that needs more development before this can be useful to most people.
@muggleboya
@muggleboya 4 года назад
May I ask, burst in unity 2020.1.01f. What can it be done with?
@user-ll4eh9sl2l
@user-ll4eh9sl2l 4 года назад
good ! good!
@GameAcademySchool
@GameAcademySchool 4 года назад
Thank you! Cheers!
@Dream_Wood
@Dream_Wood 4 года назад
How to control cameras and IU in DOTS?
@GameAcademySchool
@GameAcademySchool 4 года назад
If you mean UI, you would use Monobehaviours still and use some scripts to bridge the "classic" world and the DOTS world. Same thing for the camera. You can create an ECS Camera, complete with camera settings for the view frustum, but at some point you need a bridge script to send this data back to the "classic" camera. Otherwise, just make some Entities that follow the action and then send that data back to the classic/Monobehaviour camera. Maybe that will change in the future, but that's what you need to do at the moment. Also, some ambitious folks have written their own UI systems completely in DOTS (with significant performance gains) but I am not sure how necessary that is. Feels like overkill.
@Dream_Wood
@Dream_Wood 4 года назад
@@GameAcademySchool Can you show it in future videos?
@nemosisstudios2673
@nemosisstudios2673 4 года назад
hi ! just one question , can I make rigging animation using ECS ? because i don't see any documentation about that, perhaps its not already released ?
@GameAcademySchool
@GameAcademySchool 4 года назад
You can but it is better to wait. The Animation module is still very very early and will inevitably change. It’s really clunky at the moment and will probably be streamlined.
@tehuster
@tehuster 4 года назад
Any ETA on the course? I'm really looking forward diving deeper into this subject.
@GameAcademySchool
@GameAcademySchool 4 года назад
Thomas Huster Sorry I’ve had a shortage of free time lately so it keeps getting pushed back later. But still under construction...
@GameAcademySchool
@GameAcademySchool 4 года назад
Based on Unity's latest roadmap, it looks like DOTS is not out of preview as originally expected (obviously). This full course is getting super pushed until DOTS is farther along. Anyway, I will post an update on this later this week.
@tehuster
@tehuster 4 года назад
@@GameAcademySchool very understandable, I've been running into issues because of the incompatibility of the different preview packages. I will just be patient and wait for the release :).
@SkullekTV
@SkullekTV 4 года назад
Is it possible to mix mono collisions with DOTS Physics collisions? I want to write only one system in DOTS and everything else in classic Mono
@shirosurfer8864
@shirosurfer8864 4 года назад
I think it would be clumsy you would have to create GO and entity dictionaries and I think it would be hard to maintain determinism
@GameAcademySchool
@GameAcademySchool 4 года назад
It's possible. You may need to write a "bridge" script to pass data to and from the ECS world to your Monobehaviours. That makes sense for stuff like camera and UI -- but you can do that for anything else really. For example, in the RayWenderlich.com tutorial, I just used a Monobehaviour Player Character and then sync'ed the results to ECS using a static method that is a accessible from any script. Not great but it works.
@shirosurfer8864
@shirosurfer8864 4 года назад
Can there be a video about path finding with dots in the course? Or would that be another course in the near horizon? ... I notice you have also a course about path finding do you think there could be a way to implement it on dots? I want to take the dots course first but can you tell me a way you can see it implemented ? I know if a way to use navmesh with gameobjects and dots-physics in background but I would like to use pathfinding with pure dots what do you think friend
@GameAcademySchool
@GameAcademySchool 4 года назад
I wasn't planning on it. That's a whole separate project by itself. But you are correct, the NavMesh system does not work with DOTS. You would need to write your own version of it. And yes, another thing that is a PITA with DOTS-- however, I squarely think this is on Unity's To-Do list. They probably need to work on the DOTS Animation API first. It feels like the Core and Physics are nearly done; the rest of the Engine still needs to migrate over.
@shirosurfer8864
@shirosurfer8864 4 года назад
@@GameAcademySchool what about this I create rows and columns separated by distance in a plane like fashion Then add colliders to such entities and some path node tag.. at generation time depending on number each node ends up with some set of identifiers ... Row 11.. column 2.. I make the resolver system to transform those numbers into navigation and direction concepts This nodes only collide with relevant pathing units or any relevant entities ..can this be done like in classic? Selecting physics layers? Would that be Like world's? Anyway path entities can be tagged as obstructed First path query would be a basic mathematical approach like straight line. This would Give a rough sense were the direction is Next I would do basic heuristic in order following row column method advancing and pruning nodes approaching the first primitive line/direction data I'd create foward left right up down direction prospecting request/command by couples in steps.. I'd say prospect right given desired direction and current position.. in order excepting/removing and circumventing obstructed-tagged-nodes result which is saved on a entity until arrive to destination reading resulting nodes I could calculate distance and know where a unit exactly is by nav position with row and column identifier data easily What do you think this could work right even if the terrain on uneven I could just raycast downwards until they got terrain and adjust some distance, yeah right
@kil98q
@kil98q 4 года назад
oof sounds kind of like alot of work like you said indeed not streamlined ...
@simon000winter
@simon000winter 4 года назад
"Not Listed" but still, here i am!
@GameAcademySchool
@GameAcademySchool 4 года назад
How did you find this?
@simon000winter
@simon000winter 4 года назад
@@GameAcademySchool It showed up when i checked your profile for this tutorial series. Dunno why i could access your not listed video like that... a bug from RU-vid i suppose. I also saw the "this video is getting processed" thumbnail from youtube^^
@TheGenis1234
@TheGenis1234 4 года назад
Hello again! I would be very greatful if you could gave me answers on an issue I have on my project. In a SystemBase i use the Entities.ForEach to execute a code on every entity with a tag. The problem i have is that if i use Run() it runs on the main thread so it blocks the execution. Correct. If i use Schedule it runs on a background thread but the main thread idles until it finishes so it doesn't help very much. Finally, and here it comes the problem is that ScheduleParallel does not parallelise the job for every entity and it seems to do the same as Schedule on the profiler analysis. I'm using Blob assets for getting information and they should be compatible with burst and jobs (there is no complain on the console). Could you give me some advise? Thank You very much!
@GameAcademySchool
@GameAcademySchool 4 года назад
If it's something that has to run on the Main Thread, then, yes, you'll just have to Run it (structural changes). Otherwise, you can Schedule it. Other tasks will run on the Main Thread while that's running on a Worker Thread. If that's the only thing you're doing, then yes, there isn't much efficiency to be gained. Not every job is suitable for ScheduleParallel. It's usually when you have do the same small task for a lot of things, like when we were moving the boxes with the sine wave in the earlier videos.
@TheGenis1234
@TheGenis1234 4 года назад
@@GameAcademySchool I have a bunch of entities and I want to execute code in every one independently (parallel). My problem is that i see no difference between Schedule and scheduleParallel. On the Unit documentations it sais the following """ ScheduleParallel() -- schedules the work to be done in parallel using the C# Job system. Each parallel job instance processes at least one chunk of entities at a time. In other words, if all the selected entities are in the same chunk, then only one job instance is spawned."""" So, that's what happening to me, I have like 20 entities in my subscene but the job is not parallelised, it only schedules one job for everyone. What are exactly those CHUNKS? that was my question if i didn't explain me well. Thank you for your job. Well Done Wilmer!
@GameAcademySchool
@GameAcademySchool 4 года назад
@@TheGenis1234 I am going to guess that you don't have enough Entities to really notice the effect of it parallelized. You'll have to trust Unity how it splits off the parts of the parallel job. Again not every Job is really appropriate. If you have certain things in the Job, it might not be able to split the Job up (I think the ECB is one thing but don't quote me) . One of the cube files in the Basic DOTS examples shows off the ScheduleParallel. In the Profiler, you'll see the Job split over multiple Worker Threads if possible. Realize there is some overhead to scheduling the job on the worker threads, so if you have 20 Entities, it won't necessarily try to split the Job into 20 parallel tasks. It tries to group them for efficiency. A chunk is 16kb chunk of unmanaged memory. When you have a bunch of Entities with the same archetype, DOTS/ECS tries to fill up the memory in 16kb chunks. Pretty much all of the data is organized by 16kb chunk. In fact, though I didn't mention it in these lectures, there is a ChunkComponent that allows you to associate an Entity to a specific chunk. Then you can iterate by Chunk instead of using the Entities.ForEach. This can be useful in specific situations (like if you want to group Entities by position and put a bounding box around them -- a chunk component is a good for stuff like that).
@TheGenis1234
@TheGenis1234 4 года назад
@@GameAcademySchool Thank you very much! You are awesome!
Далее
Unity DOTS: C# Job System
19:47
Просмотров 20 тыс.
DOTS Gameplay: Trigger Events
25:02
Просмотров 12 тыс.
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11
Unity DOTS: Components And Systems
18:50
Просмотров 16 тыс.
Unity DOTS: System Base
12:47
Просмотров 15 тыс.
How Games Have Worked for 30 Years to Do Less Work
23:40
Unity DOTS: Creating an Entity
15:59
Просмотров 49 тыс.
Unity DOTS: Conversion Workflow
15:55
Просмотров 22 тыс.
EA Won't Let Me Play This Game - So I Hacked It
8:49
Просмотров 310 тыс.
The AMA Club Model is Failing. Here's Why.
16:10
Просмотров 42 тыс.
DOTS Gameplay: ComponentDataFromEntity
18:54
Просмотров 8 тыс.
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11