Chunks! Where Unity ECS Data is Stored - Unity DOTS 2022

  Рет қаралды 4,864

Turbo Makes Games

Turbo Makes Games

Күн бұрын

💬 Join our Discord community: tmg.dev/Discord 💬
💻 My Game Development Setup: tmg.dev/GameDevPC 💻
📸 My Camera Gear: tmg.dev/CameraGear 📸
🎮 Let me know what other topics you want to learn about 🎮
⌚ Time stamps for key topics ⌚
- 0:00 - Archetype Chunks
- 0:42 - Definition
- 1:30 - Chunk Memory Structure
- 2:56 - Preallocation
- 6:08 - Parallel Arrays
- 6:51- Things to Keep in Mind
- 7:23 - Chunk Utilization
- 8:26 - Wrap-up and Final Thoughts
🌐 Find Me Online! 🌐
📄 Blog: tmg.dev
👨‍💻 GitHub: github.com/JohnnyTurbo
🎮 Games: johnnyturbo.itch.io/
🦅 Twitter: / turbomakesgames
📺 Twitch: / turbomakesgames
🎵 Music by: Joakim Karud / joakimkarud
#️⃣ #GameDevelopment #UnityECS #Chunks

Пікірлер: 27
@zurrutikGames
@zurrutikGames 2 жыл бұрын
sooooo much better than the official Unity documentation. Outstanding job!!
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Glad to hear this was helpful, cheers 😊
@Wbjpen
@Wbjpen 2 жыл бұрын
Thanks a bunch. You're one of the few sources for introducing and interpreting DOTS and I couldn't be more appreciative. No doubt that good things will come to you for all of your hard work.
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Appreciate the kind words, glad to hear the videos have been helpful to you 😊
@simulation3120
@simulation3120 Жыл бұрын
Agreed. Above and beyond the best resource for something so powerful and with very little coverage. DOTS is truly the way forward and Turbo has given early adopters such an easy introduction.
@adamodimattia
@adamodimattia 2 жыл бұрын
The best DOTS channel, came back to this video for a quick review :)
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Hehe, I definitely rewatch some of my own videos to jog my memory from time to time 😁
@adamodimattia
@adamodimattia 2 жыл бұрын
@@TurboMakesGames they can serve as really good notes!
@wlsmdltn
@wlsmdltn 2 жыл бұрын
Deeply thank you that you make for concept of ecs serise. Very Very Thank you!
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
You're welcome, glad they've been helpful to you!!
@4rcant
@4rcant 2 жыл бұрын
Awesome video Johnny!
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Thanks Antonio, glad you enjoyed!!
@Dominik-K
@Dominik-K 2 жыл бұрын
Thanks for the video, is very interesting to see how Unity actually implements ECS under the hood
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Thanks for stopping by! Glad to hear you found this interesting 😊
@LukeClemens
@LukeClemens 2 жыл бұрын
Great info! I've heard many times that creating entities is fast and that there's no need to pool. It now makes perfect sense after seeing the diagram at 5:33. I guess I'm a little fuzzy on how deleting an entity could be fast (I'm not even sure if it is). I doubt Unity set it up so that deleting leaves "holes" in the arrays. My best guess is that they swap the last entity into the deleted spot, which would be fast, but it would require changing the index of the last entity (which I guess in this case would just be Entity.Index ?)
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Cool glad this helped! Deleting entities is interesting and it's something I'd like to pick apart a bit more. I say it's interesting because if you watch the entity debugger when adding and removing entities, you'll see that there is one "active" chunk that new entities are added to until it is filled up. Even if you delete an entity from a previously full chunk, new entities get added to that active chunk until it is full, then it goes back and fills the other partially full chunks before allocation a new one
@LukeClemens
@LukeClemens 2 жыл бұрын
@@TurboMakesGames wow I never would have guessed it would work like that!
@hhgnehcom7672
@hhgnehcom7672 2 жыл бұрын
entities 0.50 finally lets go
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
😀😀😀
@watercat1248
@watercat1248 2 жыл бұрын
I understand what those chunk's don't what I do understand if use different components like for example let's I use one entity the have health and 1 entity the have damage those 2 are completely different entity's with different components what i will happen on that case with the chunk's system ?
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
If two entities are built of different components, they'll be associated with different archetypes, therefore the data will live in separate chunks
@watercat1248
@watercat1248 2 жыл бұрын
@@TurboMakesGamesokay
@triplebog
@triplebog Жыл бұрын
Whats the interaction between chunks and Dynamic buffers?
@TurboMakesGames
@TurboMakesGames Жыл бұрын
Good question - so when you define a dynamic buffer, there is an optional attribute you can set called "Internal Buffer Capacity." In there, you define how many elements of that type should be stored in the chunk. When an entity with that dynamic buffer is instantiated, it allocates for the max allowed elements in the dynamic buffer. If you end up adding more elements to the buffer than are allocated for in the chunk, all data in the buffer is moved out of the chunk and into the heap - there is now a reference pointing to the memory location of where the data was moved to. Ideally you want to set this number so that most of the time data is being stored in the chunk for the fastest access, but no so big that you end up having wasted space in the chunk. Hope that clears things up for you! (Nice Journey profile pic btw 😊)
@yevhenii3562
@yevhenii3562 2 жыл бұрын
16 KiB not 16 kb
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
I use KB as it is the generally accepted notation for kilobyte. Thanks for stopping by!
@yevhenii3562
@yevhenii3562 2 жыл бұрын
@@TurboMakesGames The only difference that i noticed) Good work. Im waiting for more ecs
How to Use Dynamic Buffers in Unity ECS - DOTS Tutorial [ECS Ver. 0.17]
16:28
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Рет қаралды 116 МЛН
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 51 МЛН
What an Entity REALLY is in Unity ECS - Unity DOTS 2022
7:21
Turbo Makes Games
Рет қаралды 6 М.
What Does DOTS and ECS Mean? - Overview of New Unity Concepts
11:48
Turbo Makes Games
Рет қаралды 12 М.
Get Data from Other Entities - Unity DOTS Tutorial [ECS Ver. 0.17]
11:38
Turbo Makes Games
Рет қаралды 6 М.