How to Use Dynamic Buffers in Unity ECS - DOTS Tutorial [ECS Ver. 0.17]

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

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/DynamicBuffers 📌
👨‍💻 Code used in this video: tmg.dev/DynamicBuffers-Code 👨‍💻
💬 Join the conversation: tmg.dev/Discord 💬
💻 My Game Development Setup: tmg.dev/GameDevPC 💻
ECS Random Tutorial Video: • Generate RANDOM VALUES...
Email Fishing Game: • Ludum Dare 41 Postmort...
👇 See below for time stamps 👇
- 0:00 - Dynamic Buffers
- 1:19 - What is a Dynamic Buffer?
- 2:13 - Internal Buffer Capacity
- 4:44 - [Tutorial] Project Overview
- 5:24 - [Tutorial] Defining Buffer Elements
- 7:45 - [Tutorial] Setting the Internal Buffer Capacity
- 8:49 - [Tutorial] Adding Dynamic Buffers to Entities
- 10:37 - [Tutorial] Adding Data to Dynamic Buffers
- 12:01 - [Tutorial] Adding to Dynamic Buffers Demonstration
- 12:41 - [Tutorial] A Cleaner Way to Add Data
- 13:48 - [Tutorial] Printing the Length of All Caught Fish
- 15:06 - Final Demonstration and 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 #Unity3D #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!

Пікірлер: 24
@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
@seyedmortezakamali2597
@seyedmortezakamali2597 2 жыл бұрын
every fisherman should learn Dynamic Buffers
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Haha yes indeed!!
@rockyshark3281
@rockyshark3281 2 жыл бұрын
You can always "hack" that limitation of having only one value by using custom struct. For example: using System; using Unity.Entities; [GenerateAuthoringComponent] public struct DynBufferComponent : IbufferElementData { public Workaround valuesSet; } [Serializable] public struct Workaround { public int valueInt; public char valueChar; } I very appreciate your content - in addition to next DOTS feature I was able to learn about custom operators for implicit and explicit conversions. Without it, I didn't even know that something like that exists! :D
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
That's a cool workaround, just tried it out, works as intended. Thanks for sharing! 👍 Also yeah making custom operators is a cool C# language feature you can use to clean up your code a bit 😊
@wasteurtime5677
@wasteurtime5677 2 жыл бұрын
REALLY COOL HACK! I was using a float3x3 data type for my buffer element and it was getting very annoying. I'm still wrapping my head around the theory of chunk utilization and structural changes. Is valueint and valuechar stored in the same chunk as valueSet?
@rockyshark3281
@rockyshark3281 2 жыл бұрын
@@TurboMakesGames You're welcome - in return you can share some video about System State Components ;D
@rockyshark3281
@rockyshark3281 2 жыл бұрын
@@wasteurtime5677 In the way I suppose you understand - the answer is "yes". Both values inside struct are together in memory, one near one. Or at least I understand this that way. Chunk in ecs is like a box made from colorized paper. Box is the chunk, color is archetype, stuff inside box (steel balls, made from elements, which are components) are entities, capacity of the box is size of chunk - if you have too much entities, you need another box/chunk to store more. Something like that, hope that's helpful and is NOT DOTS-heresy ;D
@user-ng6xz3uo9c
@user-ng6xz3uo9c 2 жыл бұрын
I've been waiting for this subject
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Awesome, yeah they are super useful 😀
@TheMasterAram
@TheMasterAram 2 жыл бұрын
Thanks, I needed this
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
You're welcome, it is a super useful feature!
@wlsmdltn
@wlsmdltn 2 жыл бұрын
Oh. Thanks for video ~ :)
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Oh. You're welcome 😁😁
@GoodNewsJim
@GoodNewsJim 2 жыл бұрын
Yo Turbo, is there a way to test if an entity has a IBufferElementData attached to it?
@gavinfuchs
@gavinfuchs Жыл бұрын
I would be interested if using the DynamicBuffer in a "IJobEntityBatchWithIndex" would be usable and how it's done :D Maybe you can make a tutorial about that @Turbo
@TurboMakesGames
@TurboMakesGames Жыл бұрын
Good to know you'd be interested in something like that! Is this something you've been having issues with? If so what? Also, what's your use case for using them in and IJobEntityBatchWithIndex specifically? Thanks!
@seyedmortezakamali2597
@seyedmortezakamali2597 2 жыл бұрын
What is the difference between NativeList and DynamicBuffers?
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Great question! They have many similarities, however there are situations where it makes sense to use DynamicBuffers over Native collections. DynamicBuffers are best used for "per-entity" storage as the data can live in the chunk for fast memory access inside jobs. They also have helper functions to convert them to NativeArrays if you ever need to store/access the data in a native collection anyways
@GiMiat
@GiMiat 2 жыл бұрын
Sorry to ask this noob question, but ECS still only works in Unity 2020.x and not in 2021 right? or did I miss something
@DecentralisedGames
@DecentralisedGames 2 жыл бұрын
I believe it is problematic with 2021.x best stay on early LTS of 2020.x
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
That is correct. Check out my video from a few months ago called "ECS Does NOT Work with Unity 2021" to learn about why this is 😊
@funlightfactory6031
@funlightfactory6031 2 жыл бұрын
You're adorable.
@TurboMakesGames
@TurboMakesGames 2 жыл бұрын
Just out here having fun 😀
КАРМАНЧИК 2 СЕЗОН 5 СЕРИЯ
27:21
Inter Production
Рет қаралды 538 М.
小路飞姐姐居然让路飞小路飞都消失了#海贼王  #路飞
00:47
路飞与唐舞桐
Рет қаралды 93 МЛН
КАКОЙ ВАШ ЛЮБИМЫЙ ЦВЕТ?😍 #game #shorts
00:17
How to Use SYSTEMS in Unity ECS 1.0 - Unity DOTS Tutorial
23:54
Turbo Makes Games
Рет қаралды 16 М.
Should You Use DOTS in 2024? (plus what is Unity ECS)
30:15
Turbo Makes Games
Рет қаралды 34 М.
System State Components in Unity ECS - Unity DOTS Tutorial [ECS Ver. 0.17]
14:25
Dynamic Buffers in Unity DOTS (Array, List)
18:24
Code Monkey
Рет қаралды 27 М.
How I Created 2D Pixel Art Water - Unity Shader Graph
14:11
jess::codes
Рет қаралды 92 М.
Data-Oriented Input in Unity ECS - DOTS + Input System 2023
19:24
Turbo Makes Games
Рет қаралды 13 М.
Generate RANDOM VALUES in ECS - Unity DOTS Tutorial [ECS Ver. 0.17]
14:52
Turbo Makes Games
Рет қаралды 4,9 М.