Search Unity

Split components into mutable and immutable duos?

Discussion in 'Entity Component System' started by Mockarutan, Feb 16, 2020.

  1. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    When I started working in DOTS about a year ago, I was quite into the whole notion of separate the data that wont change from the state that does. This led me to separate components into Data and State, like FirstPersonMovementData and FirstPersonMovementState. Where the Data was always passed as read only.

    Now I'm starting to questioning the idea, first for all I run out of parameters in jobs. Then I realized that this might not even do that much, I mean think I really have to pay super close attention to the dependency tree in relation to Data here. My guess is that the calculations related to Data needs to really execute in parallel with lots of different output that does not depend on each other, for this to actually make a difference. I'm I thinking about this right? First of all I don't know if I have the time to meticulously structure my job dependencies in that way, and even then, I don't know if I have much calculations that would benefit from it. That would take time to figure out.

    So my question really comes down to, has anyone else structured their components this way? If so, what was the reason and did it pan out? Does this event make sense? Any thought?

    FYI, I have more quantity retaliated benefits from DOTS.
     
    Last edited: Feb 16, 2020