How to Use Shared Components in Unity ECS - Unity DOTS Tutorial [ECS Ver. 0.17]

  Рет қаралды 6,481

Turbo Makes Games

Turbo Makes Games

Күн бұрын

❗❗ Caution: This video was made with an older version of ECS. See pinned comment for further Details ❗❗
📌 Download the project files from this video: tmg.dev/SharedComponents 📌
👨‍💻 Code used in this video: tmg.dev/SharedComponents-Code 👨‍💻
📕 Book: Data Oriented Design by Richard Fabian: tmg.dev/dod-book 📕
💬 Join the conversation tmg.dev/Discord 💬
💻 My Game Development Setup: tmg.dev/GameDevPC 💻
👇 See below for time stamps 👇
- 0:00 - Shared Data Components
- 2:26 - What is a Shared Data Component?
- 4:20 - How Shared Data Components Work
- 6:01 - Modifying Shared Components
- 6:49 - When to Use Shared Components
- 8:05 - [Tutorial] Sample Project Overview
- 9:02 - [Tutorial] Solution Without Shared Components
- 10:44 - [Tutorial] Setting up Shared Components
- 11:41 - [Tutorial] Using Shared Components
- 15:01 - [Tutorial] Using RenderMesh Shared Component
- 17:22 - [Tutorial] Optimizing Win Conditions with Shared Components
- 23:51 - Other Considerations with Shared Components
- 26:10 - Wrap-up
Links:
Blog: tmg.dev
Twitch: / turbomakesgames
Twitter: / turbomakesgames
Game Studio: homecookedgames.com
GitHub: github.com/JohnnyTurbo
Music by: Joakim Karud / joakimkarud
📸 My Camera Gear: tmg.dev/CameraGear 📸
🎮 Let me know what other topics you want to learn about 🎮
#UnityECS #SharedComponents #MadeWithUnity
Please 'Like' this video and share it with anyone who is interested in video game development.
Subscribe to the channel for much more independent video game developer related content including tutorials, design breakdowns, industry events, VLOGs, and much more fun stuff!

Пікірлер: 28
@TurboMakesGames
@TurboMakesGames Жыл бұрын
❗❗ *Caution:* This video was made using an older version of Unity ECS. While the core concepts remain the same, some of the API and workflows have changed as of ECS version 1.0. I would recommend checking out my ECS 1.0 tutorial video for a good overview of the latest standards for Unity’s DOTS: kzbin.info/www/bejne/f4CZkGmPlL6Imqc Once again, the theory behind the concepts of this video are still relevant, however the API has changed. Stay tuned for further updated videos on this subject. Please let me know if you have any questions either here or in our Discord community: tmg.dev/Discord
@DanielKierkegaardAndersen
@DanielKierkegaardAndersen 2 жыл бұрын
Always a pleasure to get this conversation going, would be interesting with more of a perspective on the copying of data n.n
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Awesome, definitely going to be doing more research and experimentation on that in the coming weeks, so It'll be exciting to have some more videos out about that soon 😊
@DylUrem
@DylUrem 2 жыл бұрын
Reading Data-Oriented Design on your recommendation. Thanks! Very illuminating, even though some of it is whooshing over my head.
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Great! It's a good read 😊 Some things were definitely above me as well, but it's interesting to get some more insight into the DOD mindset and how things work at a low level
@Songfugel
@Songfugel 2 жыл бұрын
Enums of entity/data component for typing, like say creature type, seem like a perfect target for this. This feels like the poor man's version of relational db's indexes
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
In a sense, yeah!
@martinmaurer
@martinmaurer 2 жыл бұрын
Awesome! Just in time! Thank you.. I have millions of entities on a very large grid and was just about writing the filters. This gave me the idea to group them into downsampled grid positions based on the maximum distance they could affect each other. This should speed things ups considerably.
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Great to hear, hope that all works out! Feel free to come share your progress and ask any questions to other ECS developers in our Discord community too - tmg.dev/Discord
@martinmaurer
@martinmaurer 2 жыл бұрын
​@@TurboMakesGames This should work..Quick calculation: For my purposes I only have to check 9 "proximity clusters" out of 4096. For this, I gladly lose Multithreading and Burst :-)
@mufelo
@mufelo 2 жыл бұрын
Kinda feel like giving ECS another shot. I've done Data Oriented Design and development outside of game dev and this style clicks for me way more than than standard OOP approach. Seems like ECS is now more stable both actually and in terms of APIs. Just need those Animations to land. :D
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Yeah it's kinda fun to think about the different ways you can structure your data to optimize for different problems you come across in your game. I'd agree, I think the "core" of ECS is pretty solid (of course there are many minor improvements that could/will be made) but then they still have a number of things to build on top of all that i.e. animation 😊
@nomadshiba
@nomadshiba 2 жыл бұрын
at first its different then you cant do without it
@thegnosticatheist
@thegnosticatheist 2 жыл бұрын
Is there a way to get all already existing values in shared component? Let's say I want to run a job for each mesh used by currently existing mesh renderers. Do I track all assignment manually or is there a convenient function?
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Great question, yes there is! docs.unity3d.com/Packages/com.unity.entities@0.17/api/Unity.Entities.EntityManager.GetAllUniqueSharedComponentData.html
@thegnosticatheist
@thegnosticatheist 2 жыл бұрын
@@TurboMakesGames thanks!
@jakehix8132
@jakehix8132 2 жыл бұрын
Any reason to not use the RenderMeshUtility in initial RenderMesh creation?
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Great question, and yes that is the correct way to setup the RenderMesh. For this tutorial I just wanted the focus to be on Shared Components
@jakehix8132
@jakehix8132 2 жыл бұрын
@@TurboMakesGames I'd brought it up in the discord, but I was mainly curious as I notice the RenderMeshUtility adds quite a bit of data to each entity. Though, I guess that may be the trade-off for highly configurable dynamic rendering? No clue.
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
@@jakehix8132 Hmm, yeah I haven't looked into it too closely, but it might lead to some interesting topics and discussions
@datcong974
@datcong974 2 жыл бұрын
hey can u make a video or series about networking in ECS
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Great to know you're interested in that topic. Might be a while until I get to networking topics though, lots of important concepts to go over first 😊
@GoodNewsJim
@GoodNewsJim 2 жыл бұрын
Yo, I'm releasing a MMO I want to take on every other Space MMO in a few months. You want on board or later, let me know. I used some of your ECS knowledge!
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Sounds ambitious! Glad to hear you've been finding these videos helpful 😀
@firecrothc67
@firecrothc67 2 жыл бұрын
You lie, there's no way you enjoy a book like 'Data Oriented Design by Richard Fabian'.
@davtam
@davtam 2 жыл бұрын
I read the first chapter a few months ago, it was interesting, but it started to get very technical fast which at times I felt lost. There's another publication on Data Oriented Programing through Manning publishing coming out soon. I hope to jump back into reading more about this framework. I look forward to these conversations.
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
😆😂😂 Fire, you've read it!?!
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Thanks Dav, I'll take a look out for the Manning book!
How to Use Change Filters in Unity ECS - Unity DOTS Tutorial [ECS Ver. 0.17]
11:42
How to Use Dynamic Buffers in Unity ECS - DOTS Tutorial [ECS Ver. 0.17]
16:28
Why? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 46 МЛН
Когда на улице Маябрь 😈 #марьяна #шортс
00:17
Ну Лилит))) прода в онк: завидные котики
00:51
System State Components in Unity ECS - Unity DOTS Tutorial [ECS Ver. 0.17]
14:25
Chunks! Where Unity ECS Data is Stored - Unity DOTS 2022
9:27
Turbo Makes Games
Рет қаралды 4,9 М.
Generate RANDOM VALUES in ECS - Unity DOTS Tutorial [ECS Ver. 0.17]
14:52
Turbo Makes Games
Рет қаралды 4,9 М.
Unity ECS: Click to Select Units - Unity DOTS Tutorial [ECS Ver. 0.17]
19:40
Separating AI Hype from AI Reality
19:49
IAmTimCorey
Рет қаралды 3,4 М.
RTS Dev in Unity DOTS #1 - Performances Tests
1:25
Indie Island Studios
Рет қаралды 76
Devlog #17 - Sickle UI Themes Progress
13:41
UmbraLuminosa
Рет қаралды 428
Why? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 46 МЛН