Search Unity

Over constrained with engine and system containts

Discussion in 'Entity Component System' started by GilCat, Feb 11, 2019.

  1. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    I'm getting this error:
    Code (CSharp):
    1. Unity.Entities.EndFrameBarrier is over constrained with engine and system containts - ignoring dependencies
    2.  
    I suppose this means i'm making too many systems depending on EndFrameBarrier or even some of the dependencies are just impossible to fulfill.
    Anyway my systems still work as expected but it would be nice to know which are the systems dependencies that are being ignored.
     
  2. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    492
    They are doing a full rewrite of the update order code right now. Hopefully dependency conflicts will get better error information as well.
     
    FROS7 and GilCat like this.
  3. AndesSunset

    AndesSunset

    Joined:
    Jan 28, 2019
    Posts:
    60
    Hi, @Creepgin. This is great to know. Can you please provide source for this news?
     
  4. Singtaa

    Singtaa

    Joined:
    Dec 14, 2010
    Posts:
    492
    AndesSunset and GilCat like this.
  5. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    This error message does not mean too much, but rather that the ordering you constrained is impossible. (overdoing it)

    You can look at UpdateOrderOptimizerTest.cs. "Engine component" in the message means things from the experimental PlayerLoop API. For example, this single system is over constrained because it is impossible to be in 2 phase at the same time. (After = IN that phase but after everything else in that phase).

    Code (CSharp):
    1.         [UpdateAfter(typeof(UnityEngine.Experimental.PlayerLoop.Update))]
    2.         [UpdateAfter(typeof(UnityEngine.Experimental.PlayerLoop.Initialization))]
    3.         [DisableAutoCreation]
    4.         class SimpleOverconstrainedSystem : ComponentSystem
    5.         {
    6.             protected override void OnUpdate()
    7.             {
    8.             }
    9.         }
    Even if you do not have 2 engine component ordering in any of the same system, your other systems may drag related systems to be in 2 phase at the same time.
     
    starikcetin likes this.
  6. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    Exactly! In my case i'm not even setting dependencies against to EndFrameBarrier directly, so other systems are being dragged with some of my dependencies.
    Is it fair to say that we should avoid system dependencies as much as possible?
    Well, when you start having a significant amount of system this starts to be very hard and tricky to manage.

    Thanks