It looks really cool! I am glad that this project is made using Unity DOTS and ECS. I would also be very happy to see tutorial videos on this project on your channel. Thank you for this amazing job!
hey turbo, do u have a full dots course? where u finish a game from start to finish with pooling, saving, same mechanics and UI interaction. like a normal unity full game course but with dots
Hey man, i have a zombie game, where my player shoot on zombies, i just want to change instantiate bullet game object to instantiate entity, can you help me ? I find very different the way to code with entitys
I'd be curious as to why you would want to do that to just have the bullets as entities? The biggest issue with mixing GameObjects and entities for something like this is going to be the physics systems as the DOTS physics and regular unity physics systems cannot collide with each other. So you'll either need to have a GameObject mirror the position of the bullets anyways to detect collision with the Zombie GameObjects, or you'll need an entity to match the position of all your Zombies to detect collisions with the bullet entities.
@@TurboMakesGames oh i didn't knew that, the thing is, i control 1 to 50 players at same time and when 50 players shoot at same time then game become laggy, i thought dots would be a good alternative
@@TREXYT You might have already discovered the solution since this was 6 months ago but for anyone else or just incase. Sounds like you are not pooling your bullets. You need to make a pool of objects for the bullets that are pre instantiated and cycle through them instead of instantiating every time a shot is fired. If you instantiate a bullet every time it is fired, you create a memory and garbage collector overhead among other things that will cause your game to stutter if you do this often.
@@TurboMakesGames dude, I've been simultaneously doing contract work, learning Houdini, learning the rigging and skinning tools in Maya and taking care of a baby ... I look like a hobo that's lived a hard life of train hopping right now 😅
So how exactly do you match the shooting the actual projectile to the animation in regards to timing? And how would you do it for melee attack? like which frames of animation actually check for collision etc?
I was going super fast so I kinda just did the hacky thing and hard coded some timing values in for things lol. For melee attacks, I just spawn a separate entity that matches the position of the sword that only exists for a fraction of a second before destroying - if it collides with anything it deals damage, exactly the same as a projectile. Good question though!
I haven't done much testing myself as of late - in general being able to process entities more efficiently is a huge win for low-end mobile devices. However, I have heard some people having issues with certain things on mobile with the DOTS physics system in the past, but I am unsure if that is still an issue.
Hello, looks neat! I have a small question: why did you not use the collision detection in the Agents Navigation plugin? Just to know a bit more about youre thought process
Yeah crazy right!? The basic idea is that the (X, Y, Z) values for the vertices in the animation can be stored in (R, G, B) values in a texture - that texture can be sampled by the GPU and appropriately deform the skinned mesh. There are some limitations but the performance is extremely high as everything is running on the GPU. Check out the video I just put up today if you want a little more info on this 😊
I recently did a video on this asset that goes into much more detail about what it is and why it is useful - th-cam.com/video/kGgDQiQkKf8/w-d-xo.html Three main reasons: - It is fully compatible with Unity ECS entities, while the build in nav mesh is not - You can achieve much higher performance as the heavy calculations are done using the C# job system and burst compiler - The code is easy to follow, clean, and well documented allowing you to add in additional behavior as you please
@@TurboMakesGames Thanks, that video made me buy the asset. However I wonder what hardware you used to reach that performance. I'm mainly looking to use it for mobile games, which will obviously be way less powerful.
I find your content fascinating. I am wondering how you are perceiving the latest price changes from unity? I am starting to finance an indie studio and although I would prefer to use Bevy, its just not ready and I don't have the budget to make it ready. So I have been looking at Unreal and Unity as possibilities. I am quite interested in your content and wonder if you think that Unity still has the field here or should I look at unreal. I don't need thousands of entities in my game but I do need hundreds.
There are definitely a lot of factors to consider and everyone's situation is unique so it is hard to generalize. But I really do think that Unity's ECS is by far the best solution for creating a production-ready game with higher entity counts. Now, depending on what you need to be able to do with hundreds of entities, you may not even need to go fully into a Data-Oriented approach, but it is at the point where you should still consider it. Feel free to shoot me an email if you'd like to jump on a call to chat more about the specifics for your project - contact (at) tmg (dot) dev
Hi! How do you handle phyisics? I am having a problem with that because I want to use ICollisionEventsJob but it does not work, and what I am seeing everywhere is that it only works with PhysicsShape and PhysicsBody, which are not available by default anymore (I understand the devs want us to use regular Rigidbody and colliders). Is there any other way to check collisions? Or how are we supposed to handle physics? Would raycasting everything be an acceptable answer? 😂 Thanks!
This is a pretty deep topic as there are different ways you can go about it depending on your needs. For this project I was mainly using DOTS physics triggers to detect collisions between the projectiles and the units. By the way you can access the previous physics shape/body components by opening the package manager, clicking the DOTS physics package, and going to the "Samples" tab. But yeah sometimes it would be more appropriate to do a raycast or a collider cast depending on what you want.
Great question! Basically when the minotaur completes its attack wind-up/backswing, I spawn an invisible cylinder-shaped entity and have that follow the position of the head of the axe. When the cylinder detects a collision with an enemy, it will deal damage and spawn the damage effect GameObject at the point of collision. The whole attack/damage system is quite interesting and something I'd like to make a video on at some point as well.
Funny how i am creating a very similar concept of a game since early 2022. Is this networked? I am still not using dots because i am using mirror for 4-8 players. I am still at 400-500 combating networked units and often thinking about using DOTS/ECS to reach 1k+ maybe i should go for a hybrid solution, but not much knowledge available out there atm. Also i dont know if/how to simply use all my models with this ECS Animation solution, i had problems using them with other GPU instancing solutions. One last question, do you have a tutorial how to approach using scriptable gameobjects with ECS? As i did a very complex SO system were all gameobjects like units, spells etc are managed as/with SOs. Keep up your great tutorials and work about and with ECS and DOTS!
Cool - sounds like a fun project you've got in the works! No this project is not networked, but I am considering making a multiplayer version of it for a netcode for entities tutorial. I do not believe the GPU ECS Animation Baker supports synchronizing animations over the network at this time. I do not currently have a tutorial for using SOs with ECS, but if you want to do some research on your own, look into blob assets (I do have a few older tutorials on them) as on the code side, they have some similarities to SOs. Hope that helps!
I likely will not be releasing the code for this project. As an alternate, I'd like to create some polished tutorials on specific topics and systems I used in this project that will be much better learning resources.
Not for this project as it contains tight integrations with several paid assets which I cannot redistribute. However, I do plan on making some dedicated tutorials on some of the core parts of the code. I just put up a poll the other day to see what kind of project people would want to see me make a full project with Netcode for Entities on and RTS is in the lead, so that may be something to look forward to as well
Hello, im getting pretty strange behaviour while testing your build. At 100+ units my GPU gets pretty high usage. Furthermore, I have noticed in the Task Manager that GPU used not only from TurboWars process, but also "System" process. Your "zombie tutorial project" don't have such problems on my pc.
Hello and thanks for giving this project a go on your machine. Since I've recorded this video, I've been able to do a bit more testing into the game and have noticed that the performance drops significantly with lots of the "Boids" units on screen and when running in the split screen mode. Try the project with lots of Marines and Hover tanks as those are pretty much fully ECS based and run the game in single camera mode (Press F1 to cycle camera modes). Curious as to how it runs for you with those changes!
@@TurboMakesGames Yes, the problem was in the split screen mode. The second process in task manager, i mentioned earlier, no more drains GPU power and everything run smoothly. Thanks for this info and all your work/tutorials!
Likely not just because there are so many paid assets used in this project that connect to most of the core systems. Though I would like to spin off parts of this video into individual tutorials where of course I will be able to share all the code 😊
Oh no sorry to hear that! Hope you can sort it out soon, or stop by our Discord, I know there are a bunch of people who use netcode on there - tmg.dev/Discord
Man, I've been having fun since the beginning. Great stuff! The best of ECS always comes from you. Wishing you even more success!
Thank you so much! I've been having a ton of fun too 😀
Thanks!
Thank you so much for the support 😀
It looks really cool! I am glad that this project is made using Unity DOTS and ECS. I would also be very happy to see tutorial videos on this project on your channel.
Thank you for this amazing job!
Thanks for the kind words and great to know you'd like to see some related tutorial videos!
Amazing! I love your DOTS tutorials, you're doing a great job.
Thank you so much! I'm having fun making them 😀
So useful, literally was trying to learn this starting last week
Haha awesome, glad to hear it!
Great job, man. I--and many other, I believe--would love to see some tutorials made from this project
Thank you much! Definitely seems like there has been some good interest in people wanting to learn more about how this project was made 😊
hey turbo, do u have a full dots course? where u finish a game from start to finish with pooling, saving, same mechanics and UI interaction. like a normal unity full game course but with dots
Closest thing I have right now is the Zombie tutorial - th-cam.com/video/IO6_6Y_YUdE/w-d-xo.html
Hey man, i have a zombie game, where my player shoot on zombies, i just want to change instantiate bullet game object to instantiate entity, can you help me ? I find very different the way to code with entitys
I'd be curious as to why you would want to do that to just have the bullets as entities? The biggest issue with mixing GameObjects and entities for something like this is going to be the physics systems as the DOTS physics and regular unity physics systems cannot collide with each other. So you'll either need to have a GameObject mirror the position of the bullets anyways to detect collision with the Zombie GameObjects, or you'll need an entity to match the position of all your Zombies to detect collisions with the bullet entities.
@@TurboMakesGames oh i didn't knew that, the thing is, i control 1 to 50 players at same time and when 50 players shoot at same time then game become laggy, i thought dots would be a good alternative
@@TREXYT You might have already discovered the solution since this was 6 months ago but for anyone else or just incase.
Sounds like you are not pooling your bullets. You need to make a pool of objects for the bullets that are pre instantiated and cycle through them instead of instantiating every time a shot is fired.
If you instantiate a bullet every time it is fired, you create a memory and garbage collector overhead among other things that will cause your game to stutter if you do this often.
Welldone Johnny!
Thank you Luke!!
I will pay good money to have this as a course. RTS is my favourite genre and I like to make something!
Johnny looks tired like he really did develop a game: Confirmed. 😆
That's so funny, I did actually record this at like 11 at night which is way later than I normally record 😆😆
@@TurboMakesGames dude, I've been simultaneously doing contract work, learning Houdini, learning the rigging and skinning tools in Maya and taking care of a baby ... I look like a hobo that's lived a hard life of train hopping right now 😅
Great Video I just kinda wished it has more code explanation like in 12:04 especially with ecs parts
This looks amazing. Any chance to get a tutorial style walkthrough of how you made it?
I'll likely be breaking out different sections of the project into their own dedicated tutorials for all the important bits 😊
@@TurboMakesGames So glad to hear that,and may I ask is there any time schedule for this?
So how exactly do you match the shooting the actual projectile to the animation in regards to timing?
And how would you do it for melee attack? like which frames of animation actually check for collision etc?
I was going super fast so I kinda just did the hacky thing and hard coded some timing values in for things lol. For melee attacks, I just spawn a separate entity that matches the position of the sword that only exists for a fraction of a second before destroying - if it collides with anything it deals damage, exactly the same as a projectile. Good question though!
@@TurboMakesGames I see, thank you for explanaining.
@turbo makes games: how dots perform on mobiles platform atm (especially in regards to stability) ?
I haven't done much testing myself as of late - in general being able to process entities more efficiently is a huge win for low-end mobile devices. However, I have heard some people having issues with certain things on mobile with the DOTS physics system in the past, but I am unsure if that is still an issue.
Hello, looks neat! I have a small question: why did you not use the collision detection in the Agents Navigation plugin? Just to know a bit more about youre thought process
IIRC the collision detection was a pretty big performance draw and I didn't have much time on the project to optimize around it
@7:13 you said you baked the ANIMATIONS into a texture!?
Yeah crazy right!? The basic idea is that the (X, Y, Z) values for the vertices in the animation can be stored in (R, G, B) values in a texture - that texture can be sampled by the GPU and appropriately deform the skinned mesh. There are some limitations but the performance is extremely high as everything is running on the GPU. Check out the video I just put up today if you want a little more info on this 😊
You could have a massive Total War game too
Sounds like fun 😀
Super cool! Did you consider determinism when developing?
Thanks! Determinism in what sense? I didn't do anything specifically, but Unity ECS has some deterministic qualities by default.
What is the benefit of using the Agents Navigation package over just the NavMesh stuff that is built into Unity?
I recently did a video on this asset that goes into much more detail about what it is and why it is useful - th-cam.com/video/kGgDQiQkKf8/w-d-xo.html
Three main reasons:
- It is fully compatible with Unity ECS entities, while the build in nav mesh is not
- You can achieve much higher performance as the heavy calculations are done using the C# job system and burst compiler
- The code is easy to follow, clean, and well documented allowing you to add in additional behavior as you please
@@TurboMakesGames Thanks, that video made me buy the asset. However I wonder what hardware you used to reach that performance. I'm mainly looking to use it for mobile games, which will obviously be way less powerful.
I find your content fascinating. I am wondering how you are perceiving the latest price changes from unity? I am starting to finance an indie studio and although I would prefer to use Bevy, its just not ready and I don't have the budget to make it ready. So I have been looking at Unreal and Unity as possibilities. I am quite interested in your content and wonder if you think that Unity still has the field here or should I look at unreal. I don't need thousands of entities in my game but I do need hundreds.
There are definitely a lot of factors to consider and everyone's situation is unique so it is hard to generalize. But I really do think that Unity's ECS is by far the best solution for creating a production-ready game with higher entity counts. Now, depending on what you need to be able to do with hundreds of entities, you may not even need to go fully into a Data-Oriented approach, but it is at the point where you should still consider it. Feel free to shoot me an email if you'd like to jump on a call to chat more about the specifics for your project - contact (at) tmg (dot) dev
Hi! How do you handle phyisics? I am having a problem with that because I want to use ICollisionEventsJob but it does not work, and what I am seeing everywhere is that it only works with PhysicsShape and PhysicsBody, which are not available by default anymore (I understand the devs want us to use regular Rigidbody and colliders). Is there any other way to check collisions? Or how are we supposed to handle physics? Would raycasting everything be an acceptable answer? 😂 Thanks!
This is a pretty deep topic as there are different ways you can go about it depending on your needs. For this project I was mainly using DOTS physics triggers to detect collisions between the projectiles and the units. By the way you can access the previous physics shape/body components by opening the package manager, clicking the DOTS physics package, and going to the "Samples" tab. But yeah sometimes it would be more appropriate to do a raycast or a collider cast depending on what you want.
hi, in 14:55 how did you make the minotaur attack two units ?
Great question! Basically when the minotaur completes its attack wind-up/backswing, I spawn an invisible cylinder-shaped entity and have that follow the position of the head of the axe. When the cylinder detects a collision with an enemy, it will deal damage and spawn the damage effect GameObject at the point of collision. The whole attack/damage system is quite interesting and something I'd like to make a video on at some point as well.
Funny how i am creating a very similar concept of a game since early 2022. Is this networked? I am still not using dots because i am using mirror for 4-8 players. I am still at 400-500 combating networked units and often thinking about using DOTS/ECS to reach 1k+ maybe i should go for a hybrid solution, but not much knowledge available out there atm. Also i dont know if/how to simply use all my models with this ECS Animation solution, i had problems using them with other GPU instancing solutions.
One last question, do you have a tutorial how to approach using scriptable gameobjects with ECS? As i did a very complex SO system were all gameobjects like units, spells etc are managed as/with SOs.
Keep up your great tutorials and work about and with ECS and DOTS!
Cool - sounds like a fun project you've got in the works! No this project is not networked, but I am considering making a multiplayer version of it for a netcode for entities tutorial. I do not believe the GPU ECS Animation Baker supports synchronizing animations over the network at this time. I do not currently have a tutorial for using SOs with ECS, but if you want to do some research on your own, look into blob assets (I do have a few older tutorials on them) as on the code side, they have some similarities to SOs. Hope that helps!
Can we have pls the project source code (without the paid assets) ?
I likely will not be releasing the code for this project. As an alternate, I'd like to create some polished tutorials on specific topics and systems I used in this project that will be much better learning resources.
Hi, are you going to publish the code?
Not for this project as it contains tight integrations with several paid assets which I cannot redistribute. However, I do plan on making some dedicated tutorials on some of the core parts of the code. I just put up a poll the other day to see what kind of project people would want to see me make a full project with Netcode for Entities on and RTS is in the lead, so that may be something to look forward to as well
when the offer will end?
August 31st at 8am Pacific Time
Hello, im getting pretty strange behaviour while testing your build. At 100+ units my GPU gets pretty high usage. Furthermore, I have noticed in the Task Manager that GPU used not only from TurboWars process, but also "System" process. Your "zombie tutorial project" don't have such problems on my pc.
Hello and thanks for giving this project a go on your machine. Since I've recorded this video, I've been able to do a bit more testing into the game and have noticed that the performance drops significantly with lots of the "Boids" units on screen and when running in the split screen mode. Try the project with lots of Marines and Hover tanks as those are pretty much fully ECS based and run the game in single camera mode (Press F1 to cycle camera modes). Curious as to how it runs for you with those changes!
@@TurboMakesGames Yes, the problem was in the split screen mode. The second process in task manager, i mentioned earlier, no more drains GPU power and everything run smoothly. Thanks for this info and all your work/tutorials!
amazing !!!
Awesome
I thought so!
Hello Mr . Trubo it is possible to share the code of this project with us?
Likely not just because there are so many paid assets used in this project that connect to most of the core systems. Though I would like to spin off parts of this video into individual tutorials where of course I will be able to share all the code 😊
Did you forget the links to the assets you used?
The link to my asset store page has most of the assets I used, but I went ahead and updated the description with links to each of the packages!
@@TurboMakesGames thanks!
its the man himself...😃
🤩🤩🤩
Unfortunately you did nothing as i understand
I really want to find DOTS RTS tutorial, but only i can see here - is bought assets combined
Please analyze "mile high taxi" game
So the whole video is an asset ad sponsored by Unity and peddled by an influencer
My netcode project broke
Oh no sorry to hear that! Hope you can sort it out soon, or stop by our Discord, I know there are a bunch of people who use netcode on there - tmg.dev/Discord
On mobile, Can we do this?
Yes you can build ECS games for mobile
Hey if you can beat vs AI consistently your plat level
🏆🏆🏆
dev blog would be cool in my opinion, good work!@@TurboMakesGames
only Unity guys know how Unity work 😂
It is a beast for sure 😆😆
Algorithm
👨💻👨💻👨💻
oof... so much asset store plugs
🔌🔌🔌
They are truly helpful assets though!!