I Made an RTS Game with Unity DOTS + ECS

Поділитися
Вставка
  • Опубліковано 14 тра 2024
  • 🤑 Get these assets for 50% off: assetstore.unity.com/turbo-ma... 🤑
    🎯🎮 Play Turbo Wars: johnnyturbo.itch.io/turbo-wars 🎮🎯
    👇 List of Assets Used 👇
    1. Gridbox Prototype Materials: assetstore.unity.com/packages...
    2. POLYGON Sci-Fi Worlds: assetstore.unity.com/packages...
    3. Shapes: assetstore.unity.com/packages...
    4. Agents Navigation: assetstore.unity.com/packages...
    5. GPU ECS Animation Baker: assetstore.unity.com/packages...
    6. Adaptive Split Screen: assetstore.unity.com/packages...
    7. Epic Toon FX: assetstore.unity.com/packages...
    8. DOTS Mesh Slicer: assetstore.unity.com/packages...
    9. DOTS Plus: assetstore.unity.com/packages...
    10. Flock Box DOTS: assetstore.unity.com/packages...
    11. Low Poly Monster Bundle 2: assetstore.unity.com/packages...
    12. Fake Interior: assetstore.unity.com/packages...
    Bonus: Gimme DOTS Geometry: assetstore.unity.com/packages...
    Thank you to the Unity Asset Store for sponsoring today's video! Links to the Unity Asset Store are affiliate links and I may receive a small commission with each purchase - thank you for supporting the Turbo Makes Games UA-cam channel!
    💬 Join our Discord community: tmg.dev/Discord 💬
    💻 My Game Development Setup: tmg.dev/GameDevPC 💻
    📸 My Camera Gear: tmg.dev/CameraGear 📸
    🎮 Let me know what other topics you want to learn about 🎮
    ⌚ Time stamps for key topics ⌚
    - 0:00 - Turbo Wars
    - 0:52 - Inspiration for the Game
    - 2:46 - Blocking out the Level
    - 4:14 - Creating the Building System
    - 5:44 - Unit Pathfinding
    - 6:34 - Unit Animations
    - 7:39 - Enemy Battling
    - 12:28 - Destroying Enemy Bases
    - 14:09 - Adding Unit Variety and Polish
    - 15:42 - Final Result
    🌐 Find Me Online! 🌐
    📄 Blog: tmg.dev
    👨‍💻 GitHub: github.com/JohnnyTurbo
    🎮 Games: johnnyturbo.itch.io/
    🦅 Twitter: / turbomakesgames

КОМЕНТАРІ • 85

  • @boul3ez4
    @boul3ez4 9 місяців тому +15

    Man, I've been having fun since the beginning. Great stuff! The best of ECS always comes from you. Wishing you even more success!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +3

      Thank you so much! I've been having a ton of fun too 😀

  • @VADIM-SOLOV
    @VADIM-SOLOV 9 місяців тому +4

    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!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +2

      Thanks for the kind words and great to know you'd like to see some related tutorial videos!

  • @aleixcotsmolina6230
    @aleixcotsmolina6230 9 місяців тому +1

    Amazing! I love your DOTS tutorials, you're doing a great job.

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      Thank you so much! I'm having fun making them 😀

  • @walkerdev1
    @walkerdev1 9 місяців тому +1

    So useful, literally was trying to learn this starting last week

  • @rambertoeco8930
    @rambertoeco8930 9 місяців тому +5

    Great job, man. I--and many other, I believe--would love to see some tutorials made from this project

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +5

      Thank you much! Definitely seems like there has been some good interest in people wanting to learn more about how this project was made 😊

  • @GameDevNerd
    @GameDevNerd 9 місяців тому +14

    Johnny looks tired like he really did develop a game: Confirmed. 😆

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +5

      That's so funny, I did actually record this at like 11 at night which is way later than I normally record 😆😆

    • @GameDevNerd
      @GameDevNerd 9 місяців тому +5

      @@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 😅

  • @LukeAps
    @LukeAps 9 місяців тому +1

    Welldone Johnny!

  • @tony355367
    @tony355367 4 місяці тому

    amazing !!!

  • @testitestmann8819
    @testitestmann8819 9 місяців тому +1

    This looks amazing. Any chance to get a tutorial style walkthrough of how you made it?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +2

      I'll likely be breaking out different sections of the project into their own dedicated tutorials for all the important bits 😊

    • @ducksuper9058
      @ducksuper9058 9 місяців тому

      @@TurboMakesGames So glad to hear that,and may I ask is there any time schedule for this?

  • @yudanaim6849
    @yudanaim6849 9 місяців тому +1

    Awesome

  • @poggchampion
    @poggchampion 9 місяців тому +2

    Super cool! Did you consider determinism when developing?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      Thanks! Determinism in what sense? I didn't do anything specifically, but Unity ECS has some deterministic qualities by default.

  • @mehmedcavas3069
    @mehmedcavas3069 9 місяців тому +3

    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

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      Closest thing I have right now is the Zombie tutorial - ua-cam.com/video/IO6_6Y_YUdE/v-deo.html

  • @GumGuts
    @GumGuts 5 місяців тому +1

    Thanks!

  • @kraythe
    @kraythe 7 місяців тому +1

    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.

    • @TurboMakesGames
      @TurboMakesGames  7 місяців тому

      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

  • @rubicon7844
    @rubicon7844 2 місяці тому +1

    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

    • @TurboMakesGames
      @TurboMakesGames  2 місяці тому +1

      IIRC the collision detection was a pretty big performance draw and I didn't have much time on the project to optimize around it

  • @aleixcotsmolina6230
    @aleixcotsmolina6230 9 місяців тому +1

    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!

    • @TurboMakesGames
      @TurboMakesGames  8 місяців тому

      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.

  • @JumpCatStudio102
    @JumpCatStudio102 9 місяців тому +2

    @turbo makes games: how dots perform on mobiles platform atm (especially in regards to stability) ?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      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.

  • @arsalino1116
    @arsalino1116 4 місяці тому +1

    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?

    • @TurboMakesGames
      @TurboMakesGames  4 місяці тому +2

      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!

    • @arsalino1116
      @arsalino1116 4 місяці тому

      @@TurboMakesGames I see, thank you for explanaining.

  • @user-kp5de3zh1g
    @user-kp5de3zh1g 9 місяців тому

    hi, in 14:55 how did you make the minotaur attack two units ?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      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.

  • @WorstDeveloper
    @WorstDeveloper 8 місяців тому +1

    What is the benefit of using the Agents Navigation package over just the NavMesh stuff that is built into Unity?

    • @TurboMakesGames
      @TurboMakesGames  8 місяців тому +1

      I recently did a video on this asset that goes into much more detail about what it is and why it is useful - ua-cam.com/video/kGgDQiQkKf8/v-deo.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

    • @WorstDeveloper
      @WorstDeveloper 8 місяців тому

      @@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.

  • @albiceleste101
    @albiceleste101 9 місяців тому +1

    You could have a massive Total War game too

  • @hollowlabs8671
    @hollowlabs8671 9 місяців тому +1

    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!

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      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!

  • @TREXYT
    @TREXYT 8 місяців тому +1

    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

    • @TurboMakesGames
      @TurboMakesGames  8 місяців тому +1

      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.

    • @TREXYT
      @TREXYT 8 місяців тому

      @@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

    • @SolWayward
      @SolWayward 2 місяці тому

      ​@@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.

  • @VEETEEGameStudio
    @VEETEEGameStudio 9 місяців тому +1

    its the man himself...😃

  • @georgebratu
    @georgebratu 9 місяців тому +1

    Can we have pls the project source code (without the paid assets) ?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +3

      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.

  • @_D_D_D_D_
    @_D_D_D_D_ 9 місяців тому +1

    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.

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      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!

    • @_D_D_D_D_
      @_D_D_D_D_ 9 місяців тому

      @@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!

  • @Schlauewurst
    @Schlauewurst 7 місяців тому +1

    Hi, are you going to publish the code?

    • @TurboMakesGames
      @TurboMakesGames  7 місяців тому

      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

  • @ravenbloodwind7254
    @ravenbloodwind7254 9 місяців тому +1

    Hello Mr . Trubo it is possible to share the code of this project with us?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +5

      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 😊

  • @jfkenz2713
    @jfkenz2713 8 місяців тому +1

    when the offer will end?

  • @Caden_Burleson
    @Caden_Burleson 9 місяців тому

    @7:13 you said you baked the ANIMATIONS into a texture!?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому +1

      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 😊

  • @ChrisMoody
    @ChrisMoody 9 місяців тому

    Did you forget the links to the assets you used?

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      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!

    • @ChrisMoody
      @ChrisMoody 9 місяців тому

      @@TurboMakesGames thanks!

  • @MichaelLee-lu4qq
    @MichaelLee-lu4qq 9 місяців тому

    On mobile, Can we do this?

  • @dungphamtien3255
    @dungphamtien3255 4 місяці тому

    Please analyze "mile high taxi" game

  • @josephseger6053
    @josephseger6053 9 місяців тому +1

    My netcode project broke

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      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

  • @thanatosor
    @thanatosor 9 місяців тому

    only Unity guys know how Unity work 😂

  • @lomzogaming3631
    @lomzogaming3631 9 місяців тому

    Hey if you can beat vs AI consistently your plat level

    • @TurboMakesGames
      @TurboMakesGames  9 місяців тому

      🏆🏆🏆

    • @lomzogaming3631
      @lomzogaming3631 9 місяців тому

      dev blog would be cool in my opinion, good work!@@TurboMakesGames

  • @seekpodcast
    @seekpodcast 9 місяців тому +1

    Algorithm

  • @toto3777
    @toto3777 2 місяці тому

    So the whole video is an asset ad sponsored by Unity and peddled by an influencer

  • @artemisDev
    @artemisDev 8 місяців тому +1

    oof... so much asset store plugs

    • @TurboMakesGames
      @TurboMakesGames  8 місяців тому

      🔌🔌🔌
      They are truly helpful assets though!!