Creating Multiple Enemies : From Prefabs to Entity Spawning - Unity DOTS ECS

  Рет қаралды 1,857

WAYN Games

WAYN Games

Күн бұрын

Пікірлер: 9
@anujraghav
@anujraghav 10 ай бұрын
Thanks for your effort and this amazing tutorial . but how can we spawn using ijobEntity with iSystem without deriving class from SystemBase.for example if i want to spawn continuously upto 2000 entities using multiple cpu cores.
@WAYNGames
@WAYNGames 10 ай бұрын
You can apply the same principle. You need to create the ECB in the update loop of your system, and pass it in the IJobEntity. If you want to schedule parallel you IJobEntity, the ECB needs to be passe in as a parallel writer see docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.EntityCommandBuffer.AsParallelWriter.html#Unity_Entities_EntityCommandBuffer_AsParallelWriter. If you have to create a bunch of entities from the same prefab, you can use the other Instantiate method from the ECB, see : docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.EntityCommandBuffer.Instantiate.html#Unity_Entities_EntityCommandBuffer_Instantiate_Unity_Entities_Entity_Unity_Collections_NativeArray_Unity_Entities_Entity__
@anujraghav
@anujraghav 10 ай бұрын
@@WAYNGames Thanks , I am new to ecs , looking forward to your channel as you don't rush through things while explaining. Best wishes for your channel and your initiatives.
@Masterste
@Masterste 10 ай бұрын
Thats for the calrity on the buffers : ) Really helpful,
@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 5 ай бұрын
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.
@ahmedhajjami2744
@ahmedhajjami2744 3 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
@@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
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
Unity DOTS ECS Roadmap - Major Updates and Changes Revealed!
20:26
INSANE shooter with WAY too many bullets (Unity ECS Tutorial) - PART 1
15:20
Sasquatch B Studios
Рет қаралды 13 М.
Your First Encounter with Unity ECS: A Basic Tutorial
14:52
Unity Japan
Рет қаралды 20 М.
Controlling Blender with my voice using LLM
15:33
Polyfjord Deep Dive
Рет қаралды 205 М.
How to Use Dynamic Buffers in Unity ECS - DOTS Tutorial [ECS Ver. 0.17]
16:28
Unity Dots - SPAWNING ENEMIES, AI || Dots 2D Shooter #2
16:23
Freedom Coding
Рет қаралды 3,3 М.