Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Can DOTS be used for everything?

Discussion in 'General Discussion' started by SacredSticks, Dec 2, 2022.

  1. SacredSticks


    Dec 15, 2020
    My question might not seem immediately clear on its meaning. Basically, I plan on learning DOTS next year, but can (or rather should) it be used to replace everything in a game or only things that there are many of. In other words, I'm sure things like enemies could be pushed to DOTS and that would be a good idea, but what about things that there is only one of, like the player scripts for input and movement? Could I learn DOTS and use it to make a full project without any monobehaviour based scripts? This isn't really a question of performance boost, I'm sure that using DOTS for things like enemies would be far more performance improving than using DOTS for the player stuff would be, since there is only one player.
  2. Antypodish


    Apr 29, 2014
    You can mix OOP and DOD paradigms no problem.
    Meaning, you can mix mono behaviour and DOTS in the project. Use whateverr make the job done for you.
    DOTS is more than one thing. Is made of various components, for which you can use some of them. I.e. jobs with burst, just burst, just jobs, just ECS, or all together. But there ks more to it. Depending what you need.

    DOTS is not for everything. You can achieve a lot with it but you can gain a lot of flexibility, if mixing things in a smart way.
    lmbarns, SacredSticks and DragonCoder like this.
  3. Ryiah


    Oct 11, 2012
    angrypenguin likes this.
  4. DragonCoder


    Jul 3, 2015
    DOTS is "just" another toolset in Unity. The devs have decided for a hybrid aproach in the end where you can still use monobehaviors and that is indeed still a reasonably good idea in many cases. You already got it right with DOTS having the biggest advantage on things of which there are "many of".

    So don't focus too narrowly on DOTS. You still need a large part of the rest of Unity if you develop a game in its entirety. Specializing only makes sense if you work in a team and you are e.g. responsible for implementing large hordes of enemies.
    SacredSticks likes this.
  5. CodeSmile


    Apr 10, 2014
    To answer the thread title's question: no. ;)

    You still need to use MonoBehaviour for sure and this is neither inherently bad or good, it's just part of the workflow. You can write a lot of game code with DOTS - with or without Entities. But you will not be able to write GUI code with Entities for example. But usually this part of the code isn't performance critical.
  6. kaiyum


    Nov 25, 2012
    DOTS is a collection of tools and "Tools for the job" applies here. Doing DOTS where it does not make sense will hurt the project's performance. A quick example for one of my project involving mimicking the story of "pied piper of hamelin" would play nice in this thread:

    Imagine "A lot of rats in the scene". Well normally folks would revel in entering DOTS, specially into the job system. So did I! But the excitement soon faded and turned into a nightmare. It took over 1.5 months just to complete the somewhat stable stage of prototype when I generally do prototyping within two weeks. Even then it was harder to maintain the project since requirement from game design department used to change frequently. The correct method should have been using monobehaviours with coroutine to get 100 rats working at first. At the end of project's lifecycle, then it could later be converted into jobs when there will be lesser chance of further modifications.

    TLDR: Use whatever make sense to do the job. Do not just use because it is fancy, new and/or somebody else said revolutionary. Use it because you need it, do not use it because you do not need it.
  7. AcidArrow


    May 20, 2010
    I think the more important question is “should DOTS be used for anything currently?” and the answer to that is a resounding maybe, but you should probably wait until more of its parts are not experimental.