Search Unity

Should i use Hybrid ECS for a production game

Discussion in 'Entity Component System' started by Censureret, Sep 6, 2018.

  1. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    I am currently creating a playable that will become a full game set to be released in 2020.

    My team and I are considering shifting to Hybrid ECS. However, on the Github page, it states that it should not be used for Production.

    Can any studio or developers here on the forums tell us if it is a good idea to use it or if we should keep away from it?
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    We use it in production
     
  3. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Thank you for your reply.

    Would you say that it has improved your work flow and / or your game?
     
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Performance bust, huge amount of objects with veeery low cost. Code more reusable than in OOP.

     
    Micz84, RaL, Fido789 and 2 others like this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    For hybrid ? since I don't think hybrid will give you a performance boost. Hybrid is about using ECS because you want it. You need pure for performance + burst + jobs + build.
     
  6. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    In my case most part is pure, some things in hybryd. Also, hybryd gives you perfomance bust, not big as pure of course, if compare with legacy approach.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It would be misleading to claim hybrid gives a measurable performance boost like what the OP is asking. Hybrid will allow some optimisations but nothing like the scale suggested :)
     
  8. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    optimisations not give performance gains based on what you say? :) I worked out both the legacy approach and the hybrid and pure, and the performance gains yield that hybrid approach that is naturally pure, the difference is only in the measurements, if the hybrid approach is small, 5-10% (on average) then with a clean approach these figures are higher order
     
  9. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Oh my bad sry, I'm not clearly read what you say, He mean hybrid, and not pure :) Yeah busts in my first post is pure, not hybrid :)
     
    hippocoder likes this.
  10. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    Off topic, but I gotta say you have a really good looking game!
     
  11. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    @eizenhorn Can you elaborate on how you create AI with ECS i really cant wrap my head around it maybe its because im new to the concept
     
  12. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    NavMesh api have small jobified API -NavMeshQuery can be called inside jobs. Watch some threads in this forum branch, some peoples shown jobified nav mesh solutions.
     
    hippocoder likes this.
  13. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    Very cool effective presentation.

    What I would like to second, is to use mix of Hybrid and Pure. That where gain is won. If pure ECS is not the option for any reason, Jobyfing will be way to go then.
     
  14. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    @eizenhorn

    Can you by any chance link to some articles that helped you?
     
  15. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
  16. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    @eizenhorn are those videos of game code completely using Unity ECS? Looks really cool. If you have the time, i think it would be super interesting for you to start a thread about your game and what your findings with ECS. Positive & negative are.
     
    Vacummus, Roni92pl, Ryiah and 6 others like this.
  17. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Thank you for your feedback :) Yes, all the mechanics in our game have moved from the old approach, to a new, fast ECS that gives us simply unimaginable scope for development, of course there are moments that have not yet been transferred to ECS, for example the interface (to be honest, the interface while just in the prototype, now it is actively working on it). The mechanics of citizens (birth, death from starvation, leaving the city if there is not enough housing, the transition from ordinary conditions to workers, peddlers, builders, gravediggers, etc., hunger, disease) is pure ECS, the mechanics of resources, their movement, appearance , destruction, all trees and rocks on the map are also drawn and culled on pure ECS (each tree on the map is static Entity with its own set of parameters for loggers, cliffs is just dummy Entity with instance renderer). Buildings not transfered to ECS yet, because now they not combined in single optimized mesh, and from day to day artist change some elements in the search for the ideal appearance. But for parts of the system that have not yet switched to ECS, the Job System are already being actively used, for example, to generate fog of war and construction grid. Yes, in the near future, I planned to write a detailed article about our experience in switching to ECS, its use, pluses and minuses. One question, you mean a new thread on the forum or the preparation of a quality article for the blog, I apologize for clarification, just to understand clearly :)
     
    Last edited: Sep 7, 2018
  18. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    hippocoder and Antypodish like this.
  19. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
  20. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    That's why I attached a link to the release notes :) But to understand the basic approaches for implementing collisions, navigation is not a hindrance :) It is not necessary to run a project to understand the code :)
     
    hippocoder likes this.
  21. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    True.
    However I did watch they technical video while ago, and they did explained very well, how they doing collision.
    Is very interesting approach. And proved works well with 2D movement. They have nice discussion and explanation, how they deal with minions and collisions, as remember. And some tricks on spatial mapping, or something like that, when more than one minion was in grid cell, while arrows fall, getting damage etc.

    Great learning source, true.
     
  22. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
  23. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Please post a post in ECS forum about the technical aspect of using ECS including:
    • what it improved for you and how
    • what was difficult to achieve in ECS
    • what could be improved
    • critical or negative feedback is useful
    That's what @Joachim_Ante 's team needs to improve it, the hard things, to make it easier, to make it faster. New thread in ECS forum for it would be fantastic...

    You can post as many times as you want. Real users of ECS are
     
    eizenhorn, optimise and Antypodish like this.
  24. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    I feel now fake (non real user of ECS) :D

    Yeah, such contribution would be fantastic to all of use.
    Finally we got second SOLID and practical Example of ECS usability.

    While you are probably right, on other hand, may lead to potential confusion, since project is outdated already.
    So there is a risk for new comers, to get wrong from the start. Need add big disclaimer. Video however is very helpful.
     
  25. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Either one would be great. But i guess a forum thread would be cool for people to ask more about your project. I am sure there will be plenty questions if you write up your experiences.
     
    eizenhorn and optimise like this.
  26. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Yeah thx for explanation, no problem it will be done :) I think for 1-2 weeks there will be my long article :) My wife and I just leave for vacation on September 15, so I finally have a little time, from programming, constant profiling and refactoring, to calmly and deliberately tell all my personal experience, difficulties and unconditional achievements associated with the transition to ECS. On next week I'm start preparing and structuring all what I want to tell :)
     
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Amazing progress using ECS for production though. I don't know many people that brave :)
     
    eizenhorn likes this.
  28. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
  29. floboc

    floboc

    Joined:
    Oct 31, 2017
    Posts:
    91
    Do you plan on creating some showcase thread or anything similar for projects using the new ECS? We are also using ECS for production now and I think many others will be glad to share their work too :) ECS has been awesome so far!
     
  30. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
  31. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    hippocoder likes this.
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The home of innovation and making entire working cars out of egg cartons + cats + bits of wood.