Пікірлер
@WelshGuitarDude
@WelshGuitarDude 11 күн бұрын
Could you please explain in a video how to bake managed data as prefabs but not for rendering. I have scriptable objects with a mesh asset and materials array for the submeshes and and id to uniquely identify the scriptable object, i need to bake it to ecs as a prefab, then in a system create an entity with a copy of the mesh, deform the mesh vertices then instantiate that entity with the new deformed mesh and materials array for rendering in the scene. I've got no idea how to really do that efficiently since the baking stuff is automated I'm not sure how they setup render mesh memory efficiently
@eah596
@eah596 28 күн бұрын
Sympa la petite musique !
@saito853
@saito853 Ай бұрын
You should definitely use UnityObjectRef<GameObject> instead of making a managed IComponentData
@錘哥雜談
@錘哥雜談 Ай бұрын
The Chinese subtitles error,may be video paired wrong subtitle
@WAYNGames
@WAYNGames Ай бұрын
Thank you so much for pointing it out ! Actually all the subtitles of this video were wrong :/ . This should be fixed now. Let me know if you have any other issues !
@galrose7165
@galrose7165 2 ай бұрын
D.raw at minute 43:37! Very cool!
@WAYNGames
@WAYNGames 2 ай бұрын
Works with burst and jobs if you use the git branch of the package
@galrose7165
@galrose7165 2 ай бұрын
So much time spent perfecting the jump! good job
@WAYNGames
@WAYNGames 2 ай бұрын
Not perfect yet, the air time isn't working and the symmetry still seems to affect the length of the jump. But it's already pretty good 😊
@galrose7165
@galrose7165 2 ай бұрын
@@WAYNGames For sure!
@AtmosMr
@AtmosMr 2 ай бұрын
Ah. I'm here!
@AtmosMr
@AtmosMr 2 ай бұрын
I really like the pace of the videos. Well done. You give time to watch what is happening. Well structured and well presented. Thanks.
@kostariev_vadim
@kostariev_vadim 2 ай бұрын
Hello again. I wrote a question about prefabs live. You must have misunderstood me. I mean the following:If I need to create an entity from a prefab at runtime, that prefab must be baked into this scene. For example, I have a player who selects a character in the menu, and accordingly I cannot know in advance which character he will choose That is, I need to bake all the characters on stage. And I would like to simply have access to the entity, for example, from a scriptable object, but it is impossible to add an Entity there. Therefore, I would like to know if it is possible to do something like this Resources. Load<Entity>() or Resources.Load<GameObject>() and then ecb.Instatiete ?
@WAYNGames
@WAYNGames 2 ай бұрын
Hi, sorry for that. You cannot load entities from ressources and you can't turn a game object to an entity at runtile using the bakers. Your only options are from simplest to most complicated IMO : 1) have a singleton entity with a baker that takes in a list of game object prefabs, that bakes all prefabs to entities and store the entity id in a dynamic buffer. You can also store a map in another component of the same singleton entity to have a <your_reference,buffer_index> map. Then you can use that reference and the singleton entity to load the desired prefab from your game logic. 2) try to figure out how the Content Management of ECS works 3) make a customer runtime conversion system of game objects to entity I strongly advise to use option 1.
@kostariev_vadim
@kostariev_vadim 2 ай бұрын
@@WAYNGames Thanks, in principle I did something similar to the first option with a singleton, but I liked the advice about the index map, I will try to add it. And immediately the question is when baking the buffer, will I get the correct index right away in the baker or do I need to do it already in the system?
@WAYNGames
@WAYNGames 2 ай бұрын
@@kostariev_vadim You should get the correct index in the buffer, even after entity remapping the index in the buffer should not change.
@galrose7165
@galrose7165 2 ай бұрын
Amazing video, thanks WAYN
@WAYNGames
@WAYNGames 2 ай бұрын
You are welcome don't forget to share and subscribe for more content ;)
@fangoerbayun2587
@fangoerbayun2587 2 ай бұрын
Could you elaborate on the drawback?
@WAYNGames
@WAYNGames 2 ай бұрын
Well the drawbacks of this approach is the added complexity of managing both representation (2 prefabs). It also bear a cost to sync the entity position with the go position. Both of these point should be solves by the next generation of unity where each go will have a backing entity and the transform for both will actually be the same eliminatiomng the need for syncing and the double memory allocation. If you want to discuss further you can join my discord server ;)
@ahmedhajjami2744
@ahmedhajjami2744 2 ай бұрын
Hi Wayn Thanks for the hard work , i want to spawn multiple enemies with different sprite , do i need to create a prefabs for each sprite ? or there is a method to change the sprite from ecs ?
@WAYNGames
@WAYNGames 2 ай бұрын
If the only difference between your enemies is the sprite you could have a list of sprites in the spawner and apply the sprite to your enemy after spawning. But if other data of the enemy are different (speed, health, d'amande dealt,...) then the one prefab per enemy would be easier.
@ahmedhajjami2744
@ahmedhajjami2744 2 ай бұрын
@@WAYNGames Thanks For the reply , yes the only difference is the sprite , i will use list of sprites and see how can i apply it after entity spawning
@josephseger6053
@josephseger6053 2 ай бұрын
HOOOLY crap this video mainly the DependsOn JUST Saved me soooo much !!! Thank YOU !!!!!!
@WAYNGames
@WAYNGames 2 ай бұрын
Glad it could help!
@josephseger6053
@josephseger6053 2 ай бұрын
@@WAYNGames Do you know if you could do somthing like DependsOn in a Baking System class ?
@WAYNGames
@WAYNGames 2 ай бұрын
You can use a baking system. In the baker you add a component to your entity this component can be marked with the attribute BakingType. Then a baking system can do additional processing and you can order baking system as you want.
@josephseger6053
@josephseger6053 2 ай бұрын
@@WAYNGames Is there any way you could show me an example? I am a visual learner. Like a quick git ?
@WAYNGames
@WAYNGames 2 ай бұрын
github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/EntitiesSamples/Assets/Baking Also join discord for easier code related discussion;)
@powow2120
@powow2120 3 ай бұрын
Really quick and helpful! I wish I could like your video twice.
@Digildon
@Digildon 4 ай бұрын
Thanks king
@jonathanthorpe4228
@jonathanthorpe4228 4 ай бұрын
Thanks for the great tutorials. Quick note, I had to double click / import the "Cartoon FX FREE (old legacy effects)" unity package in the "ThirdParty/JMO Assets" folder created in the first video of the series as the projectile prefabs were missing the VFX nested prefabs.
@WAYNGames
@WAYNGames 4 ай бұрын
Thanks I pinned your message to let others know about this update to the asset package.
@BlenderAddict
@BlenderAddict 4 ай бұрын
Sorry but one of your package seems to be missing, Cartoon FX (legacy), please could you tell me where i could find it ? Thanks
@WAYNGames
@WAYNGames 4 ай бұрын
Hello, The packages for this tutorial are all in the list linked in the description of the video. None of them should be Cartoon FX (Legacy). Either way, you can also pick any VFX pack you have in your possession as we won't do anything specific with the VFX itself.
@Cameronise1
@Cameronise1 5 ай бұрын
This is really great content, I am learning a lot about 1.0.16 from your videos! Keep it up! I notice on the documentation that Creating and Destroying entities are "Structural Changes" and can impact the performance when doing this at scale. Would you recommend some sort of pooling system if you know that the same prefabbed entities are going to be created -> destroyed -> created on masse? Thanks.
@WAYNGames
@WAYNGames 4 ай бұрын
Hi, thanks. Pooling in ecs is much less mandatory than in mono. Creating a new entity from a prefab is really fast as it's just a meme copy except in rare occasion where you need to allocate a new chunk. So before you start doing some pulling I would just try doing the creation of the entities directly. It will be much less complicated to handle. If you go the pooling way you'll need to keep track of active and inactive entities and if they are frequently activating/deactivated I would suggest the IEnableableComponent.
@방찬웅-y4x
@방찬웅-y4x 5 ай бұрын
hi, Thanks for your awesome video. I have a question. I'm making agent with ECS and having trouble setting path data to ECS system. what I want to do is make path data in MonoBehaviour at runtime and send it to agent spawn system to initialize agent and spawn. how can I send independent path data to each single agent in ECS? Is there any similar features in your videos?
@WAYNGames
@WAYNGames 4 ай бұрын
Interoperability between mono and ECS is simple when you only have to synch single player data, just use a singleton entity. When it comes to synching unit data (each individual entity having it's own data) would need to get more involved. You can look at the animation video as it provides a way to synch both ways. Entity to go and go to entities.
@kostariev_vadim
@kostariev_vadim 5 ай бұрын
Maybe I'm wrong, but it seems that Unity wants to move away from Aspects and not support it in the future. Correct me if this is wrong
@WAYNGames
@WAYNGames 5 ай бұрын
That is correct, although it will take some time as this change is breaking the API it needs to wait for 2.0 to be shipped and a suitable replacement. So you can't still use it in the meantime.
@ImminentDingo
@ImminentDingo 5 ай бұрын
Hi, just wondering with your "simulate in ecs and do presentation with game objects approach", do you use ecs physics? The fact that child components are all merged into one collider during baking doesnt seem viable. Cant do headshots, cant do a handle on a door, etc etc.
@WAYNGames
@WAYNGames 5 ай бұрын
Yes I'm using ECS physics and it's true that having the collider compounded to the parent entity is a pain. I haven't had to do this but there should be a way to handle it through the collider key I think. I just haven't had the opportunity to look into it.
@itr-dev
@itr-dev 6 ай бұрын
Eyy, nice to see more people streaming the jam. Good Luck!
@kostariev_vadim
@kostariev_vadim 6 ай бұрын
I have a problem, I don't know how to get access through the jobentity to the parallel record of the localtransform entity component, which is a child of the entity that I iterate over in the jobentity's execute method. How would you handle such a case?
@WAYNGames
@WAYNGames 6 ай бұрын
Instead of having the component in the execute of the job you can use the lookup to get read access to the child entities. If you want to parallel write you would need to use an attribute to disable the safety and assume responsibility for not causing race condition.
@kostariev_vadim
@kostariev_vadim 6 ай бұрын
@@WAYNGames That's exactly what I did, but I thought maybe there are other options that I don't know about.
@WAYNGames
@WAYNGames 6 ай бұрын
Rebooting the PC fixed the build issue but i don't know why ¯\_(ツ)_/¯ Also here are the 2 assets I mentioned/recommend in the stream: Asset Inventory 2 : assetstore.unity.com/packages/tools/utilities/asset-inventory-2-275893?aid=1100ltTgd NaughtyAttributes : assetstore.unity.com/packages/tools/utilities/naughtyattributes-129996?aid=1100ltTgd
@kostariev_vadim
@kostariev_vadim 6 ай бұрын
this is all good, of course, but for me, for example, particles work perfectly in the editor and are absolutely not displayed in the build for Android
@WAYNGames
@WAYNGames 6 ай бұрын
I would suggest you file a bug report and post it on the forums. You can also try to build for another platform to check if that works and narrow down the issue to android. You can also try to instantiate the VFX yourself or last option that comes to mind and that I need to have a look at too is to look at the megacity metro to see how they handled vfx
@kostariev_vadim
@kostariev_vadim 6 ай бұрын
@@WAYNGames Actually, I didn't look in the samples from unity how they do it, Thanks
@Godgon-vk8sr
@Godgon-vk8sr 6 ай бұрын
you can make example about Animate Physics in dots
@WAYNGames
@WAYNGames 6 ай бұрын
That is a tough topic. Animation is handled by game objects so to have a collider follow the arm movement of an animated characters would require you to synchronize a the go bone transform with the entity's collider. But in ECS physics child colliders are compounded to the parent which make this really hard to do. Honestly, if you need this feature, I would look into the community frameworks that handed animation like Latios framework or join the discord of Rukhanka asset publisher to ask if their solution supports your use case.
@shenshaw5345
@shenshaw5345 6 ай бұрын
could you make a vid on event system with Isystem
@WAYNGames
@WAYNGames 6 ай бұрын
You can achieve event like behavior with IEnableableComponent, or less efficiently by creating new amenities or adding new component. I would need to do some research on this to explain clearly why it's not exactly the same thing and see if something can be done with function pointers.
@TornSilverString
@TornSilverString 6 ай бұрын
It's totally an underrated video! Exactly what I was looking for, thank you!
@WAYNGames
@WAYNGames 6 ай бұрын
Thanks! Spread the word 😁.
@BlenderAddict
@BlenderAddict 6 ай бұрын
Are you french ? So why not french videos ?
@WAYNGames
@WAYNGames 6 ай бұрын
Hi, yes I am. All my videos are in english because a little under half of my audience is english speakers. They also represents a far larger audience pool than the french speakers. French is the second most spoken language amongst my user so that's why all my new videos, including the updated DOTS Master Class series, are subtitled in french as well as other top spoken languages from my audience. Hope you'll still enjoy my content and if you want to learn DOTS, I'd recommend starting here : kzbin.info/www/bejne/pavGe5mBesZ-jK8
@dhtpdud528
@dhtpdud528 7 ай бұрын
Thank you so much.
@GiMiat
@GiMiat 7 ай бұрын
Thanks for your videos! I was wondering, in the Update where you get all the singletons, could you cache them in the class or in a system you cant do that? Cause it seemed a little antipattern, in my amateur eye.
@WAYNGames
@WAYNGames 7 ай бұрын
The SystemAPI generated code does the caching for you ;)
@GiMiat
@GiMiat 7 ай бұрын
@@WAYNGames Thanks for your fast reply. So just to make clear, in the "TowerPlacementSystem.cs" if you moved the lines 28,29,30 to a callback like OnEnable() or something similar that only happens once, would that be wrong? is there a need to have these at the OnUpdate, like to always have the latest state? If you dont have time , is there anything ECS - Systems related that you would suggest to look up besides the Unity docs?
@GiMiat
@GiMiat 7 ай бұрын
@@WAYNGames I tried to actually implement an example project on my own. I was wondering, could you directly call a building iSystem through a mono, to place an entity? Is it dangerous to break? Because in this video, you have the singleton entity and the input buffer to stack the input and capture it ,all these inside the ecs world, and I was curious whether you are doing it this way to demonstrate how to capture input in ecs, OR is it the only safe way to do?
@WAYNGames
@WAYNGames 7 ай бұрын
Calling an ISystem from monobehaviour does not make sense. But you could create the entity directly from the monobehaviour by implementing the same code from the system in the monobehaviour using the default world's entity manager. But that may cause a sync point that you don't fully control and create poor performance. That's why I prefer to handle a singleton to store the input and then do the simulation in the ISystem where I get much more granular control over the execution flow.
@LukeClemens
@LukeClemens 7 ай бұрын
Great summary! Thanks!!
@adamodimattia
@adamodimattia 7 ай бұрын
Thanks for the update!
@ashrafzaman6774
@ashrafzaman6774 7 ай бұрын
I recently made a mobile game using dots, your channel helped me a lot understanding the basics of DOTS. Its not easy to find dots tutorials with updated information because it changes so frequently. Also, I would like to request you to make an updated video on "Structural Change". Coming from a OOP / GameObject background, i feel like we should be more careful on the structural changes and its use cases. There's so minimal information about this and I had to do a lot of internal forum reading to find out details about it. I faced several bottlenecks due to structural changes. I didn't know, there's a dedicated section on the profiler window for Structural changes that shows how much time it took for each change, it was a very important finding in my part because i managed to gain 30+ fps even on very low end devices with 200-500 entities living in the scene, for high-end mobile devices, i managed to get 60 fps. It helped me a lot figuring out bottlenecks. To remove those bottlenecks, i used ECB extensively so that all the structural changes happens in one place. Anyways, thank you so much for your videos, i feel like your videos has a good way of explaining things to developers who are already used to with Game Objects workflow. Keep up the good work!
@WAYNGames
@WAYNGames 7 ай бұрын
Thanks for the kind words. Feel free to come to the discord channel or tag me on twitter(X) to show off your game ! I'll try to draft a video about structural change and put it in the pipeline ;).
@oskioskioski
@oskioskioski 7 ай бұрын
Did you do a Replace All form->forum with the captions? transforum, perforumance, etc 😄
@WAYNGames
@WAYNGames 7 ай бұрын
Yeah 😎 I'll fix it thanks for letting me know 🤣
@WAYNGames
@WAYNGames 7 ай бұрын
Should be fixed now.
@HeyWhoTheFuckAreYou
@HeyWhoTheFuckAreYou 7 ай бұрын
Will there be a video about worlds in DOTS ECS, I've found hardly any information on this topic? I'm trying to figure out how to architecturally link my Monobehaviour to ECS and I think it's better to run the right world with the right systems in each scene, maybe I'm wrong, but the default behavior of having all systems run seems very strange to me, I'm planning to make a game with different game modes, but these modes somehow overuse different systems and I don't know how to implement this correctly so I don't have problems with a system from one mode running in another just because they request common components.
@WAYNGames
@WAYNGames 7 ай бұрын
The simplest way to do that is to have an entity with a tag component and require that for a system to run. This can be done by adding an game object with a game mode type to your scene.
@WAYNGames
@WAYNGames 7 ай бұрын
Alternatively you can disable the automatic creation of your system and add them manually to the world, or go full custom bootstrap if there are some unity systems you don't require.
@mrbinggrae5954
@mrbinggrae5954 7 ай бұрын
A lot has changed in this update. I'm hoping for more DOTS sample projects!!!
@LtdJorge
@LtdJorge 7 ай бұрын
This is just for the major update (2.0), tho
@WAYNGames
@WAYNGames 7 ай бұрын
I mean depreciation will take effect before 2.0 but complete removal of the feature should only happen with a 2.0.
@LtdJorge
@LtdJorge 7 ай бұрын
@@WAYNGames true
@TurboMakesGames
@TurboMakesGames 8 ай бұрын
Nice work!! This is a good integration that seems to work pretty well ☺
@WAYNGames
@WAYNGames 8 ай бұрын
Thanks! It's a bit crude but gets the job done ;).
@alec_almartson
@alec_almartson 8 ай бұрын
Thank you for making this Tutorial 💯😁👍🏻 (I am bookmarking it for using it on my next project)
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
GOOD!!!
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
I get a 404 error when I click on the Changefilter related blog link.
@WAYNGames
@WAYNGames 8 ай бұрын
The author site seems to have changed quite a bit, not sure what's happening. Anyway here is a web archive of the blog post. web.archive.org/web/20231010221033/gametorrahod.com/designing-an-efficient-system-with-version-numbers/
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
Does WithChangeFilter only query entities whose Component's value has changed?
@WAYNGames
@WAYNGames 8 ай бұрын
WhithChangeFilter does not monitor the value itself but the access pattern to the component. And it applies at the chunk level. So if the component you are filtering has been accessed in write mode by a system even if no values has changed.
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
@@WAYNGames I don't quite understand. I will have to look at the link blog.
@WAYNGames
@WAYNGames 7 ай бұрын
He just published a new version of his blog post : gametorrahod.com/change-version/
@mrbinggrae5954
@mrbinggrae5954 7 ай бұрын
@@WAYNGames 👍👍👍
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
Today’s video was also very helpful! Good job~
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
Please let me know in which situation I should create a Job: IJobEntity or IJobChunk.
@WAYNGames
@WAYNGames 8 ай бұрын
You should always start with IJobEntity. It will be compiled to an IJobChunk. IMO IJobChunk are only mandatory for use cases where your job would benefit for performing a chunk level operation such as allocating a native container, preparing some data common to all entities of the chunk,...
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
Can ScriptableObject also be referenced in blobasset?
@WAYNGames
@WAYNGames 8 ай бұрын
If the scriptable object is simple enough maybe 🤔. But if it contains things like list I'm pretty sure it won't work. In any case I would advise to consider the scriptable object as part of the authoring experience and the blob asset as the runtime data structure. Just like the authoring component and ECS component are separated. This will allow you to offer the best experience to the designer and the best performance to the player.
@gabek5760
@gabek5760 8 ай бұрын
​@@WAYNGames I'm a bit confused as to why you'd want to use Scriptable Objects over Blobs in the context of ECS now... I use SO's in Monobehaviour in a very similar way the blob is being used in DOTS -- To create a singular readonly static data source to save memory... SO's won't work in DOTS the same way because each entity will bake the SO's stats which kinda removes the happiness.. Is the only reason you'd want to use SO's in DOTS is to have easy access changing properties with the DependsOn() feature?
@WAYNGames
@WAYNGames 8 ай бұрын
@@gabek5760 Scriptable Object are a good authoring tool. They can help you create more designer friendly experience to make your game. For instance, if you have a game with a set of NPC, you can make a scriptable object to handle the authoring data of how NPC can move. If you want to change the speed they move at, you can do it in a single scriptable object instead of having to update each NPC's prefab.
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
This video is good because it shows you which command buffer to use and at what point.
@mrbinggrae5954
@mrbinggrae5954 8 ай бұрын
Hasn't it been changed to be applied automatically without adding [BurstCompile] to ISystem?