Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Research question for Unity DOTS

Discussion in 'Entity Component System' started by ahnai17, Feb 21, 2024.

  1. ahnai17

    ahnai17

    Joined:
    Feb 1, 2024
    Posts:
    10
    Hello
    I am writing a research paper on Unity DOTS and need expert knowledge in that domain that can help with answering the question here, since I have not found many resources that answers it, and please send references if used to answer the question
    1. Scalability Comparison:
      How does the scalability of systems developed with Data-Oriented Design (DOD) in the context of isometric games, such as Nanokings, compare to those developed using Object-Oriented Programming (OOP)?
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,703
    Create a benchmark and test it.
     
    WAYNGames and CodeSmile like this.
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,740
  4. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    899
    Comparing OOP vs DOD is going to be a tall order. The relevant comparison is between C# Mono and HPC# Burst and between MonoBehaviour and Unity ECS. If you do your comparison on that basis, you will find that Unity ECS is superior to MonoBehaviour in a whole bunch of ways.

    If your goal is academic research comparing OOP and DOD, I would suggest comparing C++ vs Rust.
     
    apkdev, CodeSmile and Ryiah like this.
  5. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,761
    A bullet hell game is indeed one of the frontiers for using DOD/DOTS and thus will scale better than OOP.
    That said, there is a learning curve and it is still an option to employ your own DOD system based on the particle system or the Graphics.RenderMesh(instanced) methods.
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,823
    You may get rough direction for performance here.
    But in the end you need actually own performance tests, in full built scenario. Not for isolated systems.
    Unfortunately no one will do that for you for research paper. And you need cover various hardware setup, for best reliable results.

    I can point to thread, with various great projects using DOTS. Just to give an idea.
    https://forum.unity.com/threads/share-our-dots-showcases.1010215/

    Besides, yes this is wrong subforum.
     
  7. ahnai17

    ahnai17

    Joined:
    Feb 1, 2024
    Posts:
    10
    I was asking if there are unity developers who have experience working with both and give their insights that will be used when performing tests for the game
     
  8. ahnai17

    ahnai17

    Joined:
    Feb 1, 2024
    Posts:
    10
    It is related to games and I was asking for insights regarding the scalability between the two and testing will be done after gathering the data
     
  9. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,823
    The thing is, one someone start using components of DOTS, like burst, jobs and ECS, (there are more however) anyone who did work with OOP before, will straight away see benefits in terms of performance. Usually there is no need for extensive test, as result are in favour of DOTS by magnitude of 10s. Depending of situation, individual subsystems performance were claimed in past by devs, that enabling burst on burst compatible system, can gain even 10x performance. Milage varied in both directions.

    I have not created any performance comparisons of OOP and DOTS, as results are clear to me. However I did in past test of burst related performance for branching statements. But one minute search of Internet, already returns you multiple valid results.

    https://github.com/RyanStander/OOP-vs-DOTS-Performance-Analysis?tab=readme-ov-file#readme-top

    https://m.youtube.com/watch?v=0VQyWo-gb2c

    Oter than that, stuff are scattered, so it would require long post to collect all of these together. If you do research you can contribute to the Unity community on this Forum, by listing your findings. This will be directly part of your research and appreciation of community work. And some people my as well contribute to the thread as well, if finding informative.
     
    davenirline likes this.
  10. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    1,006
    I have done both. I'm all for DOTS now. It just outshines normal OOP code.
     
    Antypodish likes this.
  11. ahnai17

    ahnai17

    Joined:
    Feb 1, 2024
    Posts:
    10
    I would like to ask if you want to be interviewed regarding your experience working with DOTS and what you have benefitted from doing so? if yes please send me a message
     
  12. ahnai17

    ahnai17

    Joined:
    Feb 1, 2024
    Posts:
    10
    Regarding the findings I found on scalability I will show them here:
    Game objects: DOD gives increased speed when more entities are being used, while OOP has more speed when lower amounts of objects are used, which means DOD is more scalable with more entities added to the game and that is crucial when games grow in complexity and size.

    Data-oriented design: DOD promotes modularity and is highly scalable, especially with multiple worlds and built-in event systems. It can lead to simpler code in performance-critical areas like scene graphs and culling algorithms, whereas DOD focuses on data organization and processing and offers more flexibility since you can add or modify features in a program, so component-based approaches are an alternative to centralizing everything under a single entity.

    Object-oriented design: OOP is the current standard, but it won’t be able to keep up with the increasing world sizes of larger game worlds, especially with the problem that the gap between memory and processor speeds has become larger over time.

    Memory: You can use techniques to manage buffer allocation dynamically, which leads to efficient memory usage and performance scalability in ECS-based projects. I would like to ask you if you want to be interviewed regarding the topic and if yes please send me a message