Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

EgoCS - A Full Entity Component System framework

Discussion in 'Assets and Asset Store' started by andoowhy, Dec 26, 2015.

  1. ShaperVN

    ShaperVN

    Joined:
    Mar 11, 2017
    Posts:
    2
    Hi @andoowhy. Thank you very much for your amazing work. I have played around quite a bit with EgoCS. I have an ideal about using Model-View-Controller-Presenter (MVCP) pattern for EgoCS UI. Component is model, EgoSystem is controller. View is Unity UI or whatever UI library (Button, Text,...). Presenter is bridge between View and Controller. What do you think about it? Thanks in advance.
     
  2. SirRiggsDiehard

    SirRiggsDiehard

    Joined:
    Nov 26, 2013
    Posts:
    4
    Very nice framework, man! Started to play with it today and so far I liked very much.
    I'm considering use it in a commercial project.

    Have you implemented support for pooling gameobjects?
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    I used to brute force it by caching the N positions inside an array then spawn a threads for the nested loop of distance check, o(N^2)

    But I read that nesting constraint.ForeachGameObject is a severe antipattern.

    So what's the most elegant way to detect proximity without using physics events between thousands of objects? And can it be threaded?
     
    Last edited: Mar 13, 2017
  4. andoowhy

    andoowhy

    Joined:
    Dec 26, 2015
    Posts:
    24
    Hi everyone, sorry for the late replies. Breath of the Wild is an amazing game and I am weak...

    Thank you for the kind words, though!

    You're more than welcome to use your own UI solution with EgoCS in your project, but I don't want to "bless" or promote any given UI solution (yet), or integrate it into the project. I have some ECS-friendly ideas, but from my experience, UI and gameplay code are entirely different beasts; it'll need a lot of thought and testing.

    Not yet. I want to pool EgoEvents first, as they are new'd and GC'ed each frame. But when I pool events, I'll probably let you pool GameObjects too, since the pool will have to be somewhat generic.

    I'm not sure, but I think this specific kind of task / query is outside the bounds of an ECS. They basically state "For Every GameObject With These Components, Do This". So you could grab the GameObjects you wanted to perform your proximity check on, but after that you're on your own.

    Also, EgoCS doesn't have built-in multithreading support. If Unity doesn't make the scripting API thread-friendly in the future, it may never.