5 ms·
> Bevy uses the ECS pattern to organize game code, and it occurred to me that ECS substantially alleviates the spaghetti-code problem that makes testing in Unit
by Jensson 4y ago
> Bevy uses the ECS pattern to organize game code, and it occurred to me that ECS substantially alleviates the spaghetti-code problem that makes testing in Unity and Unreal so terrible.
Both Unreal and Unity uses ECS.
- guzik 4y agoSeems like the author never truly worked with these engines? Also, I never had problem with unit testing on Unity in pure C#. Even when it comes to complicated scenario there is always a way to separate your GameObjects from game logic.
- harles 4y agoI think this comment and its parent have misunderstood what ECS is.
- ChadNauseam 4y agoI have spent way too much time in Unity. (I was a Unity developer for pay for several years.) I suppose I didn't do a good job explaining the differences between what Unity does and an ECS approach in my post, but if you'd like to get a feel for what an ECS you could try out DOTS. (Although DOTS is kindn of unpleasant to use compared to Bevy.)
- tarsiel 4y agoUnity at least isn’t a true ECS architecture, more just Entity-Component. You can write game logic in an entity with Unity, whereas in ECS that would have to live in a System
- runevault 4y agoUnity is working on a full ECS system as part of a larger DOTS initiative, but it is still pre-alpha last I knew.
- metadat 4y agoWhat is ECS? Assuming it's not AWS Elastic Container Service :>
- worble 4y agoEntity component system
- keyle 4y agoAround 2007 I believe the game industry came up with a semi standard way of building games that somehow alleviated a lot of issues in producing complex games... aka spaghetti loops of hell. There are a few ECS approach and to this day it's still vague who does it best (depends on your goals). One I found interesting is the "sparse entity component system".
- cobalt 4y agoit's more to avoid god classes and inheritance messes.
- deleted 4y ago[deleted]
- keyle 4y agoThanks, I rolled my eyes and had an issue with the author's statement. My guess is what he meant was that the Bevy approach is cleaner to test upon.
- harles 4y agoCan you point me to what part of Unreal uses an ECS approach? I’ve never seen this. I know Unity DOTS added ECS features, but that still lives in a hybrid world.
- lfowles 4y agoThis surely isn't what was meant in previous conversation, but Unreal Engine 5 added MassEntity which is uh... an Entity Fragment Processor approach. (Because Components are already an object that exists, it probably would have been an extra special kind of confusing if it adopted typical ECS naming.) https://docs.unrealengine.com/5.0/en-US/overview-of-mass-entity-in-unreal-engine/ https://docs.unrealengine.com/5.0/en-US/overview-of-mass-ent...
- dimgl 4y agoBased on the definitions in this thread, it wouldn't be a stretch to pair Unreal's `AActor` as the entities and `UActorComponent` as the components. You could technically go a step further and pair `UWorldSubsystem` as the system. I realize that there's the whole "grouping" and "batching" concept in ECS paradigms, but I'm failing to see how that's much different from using the functions in `UWorld` that can query both components and actors of a certain class.
- Jasper_ 4y agoThis is where the unfortunately-chosen name "Entity-Component-Systems" (ECS) comes back to bite us. Unity's GameObjects are Entity-Component (EC): you have an Entity (GameObject), onto which you attach Components (MonoBehavior). Unreal is similar: you have an Entity (UActor), onto which you attach Components (UActorComponent), though you can also have plenty of code living outside the UActorComponent system in Unreal. Entities are objects, and Components are code/data. Entity-Compontity-System (ECS) uses these nouns differently; an Entity ends up being little more than an identifier for a large number of Components, which are data structures, and Systems are the code that modify groups of Components. "System" here is a noun, not a descriptor of the practice. The usual analogy is similar to a relational database (in fact, the point of the system is to achieve wide-scale performance like RDSes do): Entities are rows, identified by a primary key, Components are columns, and Systems are the SELECT/INSERT/UPDATE/DELETE queries which acts on the data. Unity has a new-ish ECS framework under the DOTS initiative; Unreal has no parallel. Very few games are using these.
- Jensson 4y agoIn unity the methods "Update", "Start" and so on are the system part of ECS. That you write their implementations alongside the data doesn't really matter.
- forrestthewoods 4y agoSorry, you're wrong on this one. ECS has come to mean a very particular style of architecture. It's not a great name, but it's what the industry has converged on. Naming things is hard. Unity's MonoBehavior framework uses GameObjects and Components. You don't have to squint hard to see that it contains Entities, Components, and arguably Systems. However ECS has come to mean an architecture that is quite different from MonoBehavior. So different infact that Unity is writing an ECS framework called DOTS! Both DOTS and MonoBehaviors containing entities, components, and functions that operate on them. However the two Unity systems are extremely different. MonoBehaviors are not an ECS.
- Jensson 4y ago