Тёмный

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

Turbo Makes Games
Подписаться 26 тыс.
Просмотров 6 тыс.
50% 1

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

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IO6_6Y_YUdE.html 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
@rockyshark3281
@rockyshark3281 3 года назад
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 3 года назад
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 3 года назад
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 3 года назад
@@TurboMakesGames You're welcome - in return you can share some video about System State Components ;D
@rockyshark3281
@rockyshark3281 3 года назад
@@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
@seyedmortezakamali2597
@seyedmortezakamali2597 3 года назад
every fisherman should learn Dynamic Buffers
@TurboMakesGames
@TurboMakesGames 3 года назад
Haha yes indeed!!
@로물루스-e5p
@로물루스-e5p 3 года назад
I've been waiting for this subject
@TurboMakesGames
@TurboMakesGames 3 года назад
Awesome, yeah they are super useful 😀
@wlsmdltn
@wlsmdltn 3 года назад
Oh. Thanks for video ~ :)
@TurboMakesGames
@TurboMakesGames 3 года назад
Oh. You're welcome 😁😁
@TheMasterAram
@TheMasterAram 3 года назад
Thanks, I needed this
@TurboMakesGames
@TurboMakesGames 3 года назад
You're welcome, it is a super useful feature!
@gavinfuchs
@gavinfuchs 2 года назад
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 2 года назад
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!
@GoodNewsJim
@GoodNewsJim 2 года назад
Yo Turbo, is there a way to test if an entity has a IBufferElementData attached to it?
@seyedmortezakamali2597
@seyedmortezakamali2597 3 года назад
What is the difference between NativeList and DynamicBuffers?
@TurboMakesGames
@TurboMakesGames 3 года назад
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 3 года назад
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 3 года назад
I believe it is problematic with 2021.x best stay on early LTS of 2020.x
@TurboMakesGames
@TurboMakesGames 3 года назад
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 3 года назад
You're adorable.
@TurboMakesGames
@TurboMakesGames 3 года назад
Just out here having fun 😀
Далее
V16 из БЕНЗОПИЛ - ПЕРВЫЙ ЗАПУСК
13:57
У КОТЯТ ОТКРЫЛИСЬ ГЛАЗКИ#cat
00:26
The Most Legendary Programmers Of All Time
11:49
Просмотров 569 тыс.
What are BlobAssets ? How to use them ?
8:02
Просмотров 2,8 тыс.
The Value of Source Code
17:46
Просмотров 51 тыс.
Should You Use DOTS in 2024? (plus what is Unity ECS)
30:15