I guess my biggest concern will be what the actual interface looks like in the editor and how this will effect development flow. ECS is really interesting from a technical standpoint, and seems a lot more unified in its design than the GameObject-Monobehaviour model, but GO-MB was highly representative of the intended behavior:
“This is a thing, it does this stuff”
Wheras ECS seems to be
“This thing exists and it’s full of properties that other unseen stuff can manipulate”.
Not to mention, at the current moment it seems like there’s just gonna be two models, ECS and GO-MB, until eventually GO-MB just gets deprecated.
While ECS is exciting in a number of ways from a technical standpoint, I can’t see myself really taking it seriously until:
The GameObject-MonoBehaviour model starts working off of ECS internally:
Every GameObject is fairly analogous to an entity anyway. Transform could be broken down to a collection of 3 components for Pos, Rot, and Scale. Mesh Filter is basically a component, and Mesh Renderer is basically a tag for a system that uses it. Monobehaviours are a bit tricky, but really even they can be broken down into a data part and systems part most of the time, which is why hybrid ECS is easy to port to.
Every System inherently has its own tag component and cluster of ‘required components’:
Think about the [RequireComponent] attribute in the current GO-MB. Every system starts out by searching through existing entities, so why not create the following structure:
- Every system REQUIRES an empty ‘tag’ component. This prevents unexpected system clashes when two systems operate on the same data. (An enemy and player health might both operate on a ‘health’ component for instance)
- Entities appear in the hierarchy and scene view (since GameObjects would be entities anyway there’s not much of a change there), and the inspector could have a ‘systems that affect this’ section and a ‘properties’ section. The systems section wouldn’t even have to do anything except show what systems will have this type of object show up in their queries (since every system now needs its own tag this is simply a query of the names of ‘empty’ components). The properties section would allow editing of the individual components and data, which could be grouped by component but also by system. If an entity uses two systems that rely on the same data, that data would just be displayed in both sections.
- SYSTEMS can be dragged onto or otherwise added in the inspector to Entities. This would add the necessary tag and also add each of the components the system requires if they’re not already there. Systems can also be removed, which removes their tag but only removes other components if other systems don’t use them.
- Components which aren’t system tags can still be added at will to store custom data. Since every system has its own tag, there will never be unintended consequences
This will make ECS more maintainable across larger projects, more intuitive (every entity now not only is associated with what it is but what it does, the one biggest strength of GO-MB. Not to mention, this means prefabs are inherently archetypes now, and in fact entire commonly used systems could be considered archetypes, and you now have a design-time definition for the most common archetypes, and I’m sure there could be some optimization done to give search priority to those archetypes (maybe even cache them separately so they don’t need as much rearranging, or they’re all in one spot by default?)
There is sufficient (although removable) abstraction available to suit the needs of different team members:
The programmers will want to see everything, of course, down to most minute detail. In fact the entire framework above is really just a helper to make ECS maintainable, but I’m sure there’s some percentage for which it might get in the way. This could be abstracted down to user-definable Entity-views. An entity view with full access can do anything, even peer behind the veil to access the component list directly given the obligatory warning that they might get unexpected results. Programmers, system designers, etc. would use this view. An entity view for level designers or environment artists, on the other hand, would only allow changes to specific components. Say, the usual Pos, Rot, Scale, and then stuff like material properties, speed and damage of enemies, etc. They shouldn’t be able to change what a prefab does, but can change what a prefab is. These sorts of entity views could be user-defined (perhaps via attributes), so that teams can adapt to their structure. This would reduce clutter and allow all members of the team to stay structured and in the flow of design, and enforces a separation of concerns that is incredibly useful for even moderately sized projects.
I would honestly argue that one of the biggest reasons to choose Unity over Unreal is the fact that Unity promotes much better design flow. It’s been part of Unity’s image problem (easy for low-skill devs to make bad games), but also a big part of Unity’s success (flexible enough to make great games of a large variety, and prototype quickly). Frankly, I can’t see ECS, however fast and however uniform, furthering that. GO-MB was slow, weird, and clunky, but it was intuitive, and I would love to see ECS also be intuitive to use. If the goal is performance by default, then it should be default to achieve that performance.