Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualHodgman

Posted 07 April 2013 - 05:45 PM

Those T-Machine posts are really good for explaining entity/component systems as used in games, but I really strongly disagree with almost everything he says about OO in the process of explaining ECS...

n.b. you can have a structure with public data that's operated on by a system in an OO design... And composition should be far more prevalent than inheritance (which should be quite rare) in OOD.

When OOP took off in games, we were all new to it, and frankly, we sucked. The popularity of ECS exploded out of the fact that we'd all written these stupid OO-inheritance based entity hierarchies, that had all sorts of downsides. Eventually, we realized this was a mistake, and after admitting that our entity-hierarchies were crap, there were two paths ahead:
1) assume this was simply because OO is crap, and move on to the next misunderstood fad.
2) go back and actually learn some OOD, while also learning ECS, DOD, etc...

The author has taken path 1. He's moved on from OOP, but never had the chance to see it used properly -- almost all of his criticisms are levelled at code that's written with an OOP language, but doesn't follow OOD rules. All of the benefits and advantages that he lists for ECS can also be achieved with well written OO code.

Also, the author should make some comparisons to the Protoype paradigm, as well as relational and OO, as many "entity template" or function-sharing-via-systems mechanisms draw a lot of inspiration from that paradigm.

As a farcical proof - ECS is often implemented within an OOP language like C++, which means its possible to reverse engineer the final code into an OO-design, which you can adapt and generalize to see how this kind of structure should exist in OO... When you do this, your ECS is basically reduced to a bloated message passing and serialization framework.

At this point, please note: OOP does not have this concept of multiple aspects; it hard-codes all the aspects into one glob, and declares that the set of behaviours and values of data to be the single-aspected Class of an Object. C++’s Multiple inheritance and Java’s Interfaces can get you a small part of the way towards the aspects of an ES, but they quickly collapse under the strain in fundamental ways that cannot be fixed within OOP.

This is what I mean - not only has he apparently never heard of the SRP, but when trying to replicate his ECS structure (based on composition), he jumps straight to inheritance in his OOP toolbox, fails, then blames OO. This is a straw man argument.

only OOP programmers want to give entities hierarchical names. It can tunr out a pretty dumb idea, if you think about it: it’s usually an implicit refusal to let go of those OOP ways we’re so used to thinking in

Again, (falsely) suggesting a strong link between OO and hierarchies.

An ES takes a system where there are many things going on that are all independent, which OOP tangles up together, and pulls them apart and lets them live on their own.

argh, no! The bad OOP entity hierarchies that we were writing a decade ago do this, but that's because we were all just ad-hoc'ing our way into OOP without bothering to really study OOD first! Good OO has all the tools to let all these independent components be small, decoupled and simple. The most important tool in the OOD toolbox turns out to be the same as in the ECS toolbox: composition.

As Greenspun said, ECS systems end up being based around an ad hoc, informally-specified, bug-ridden, slow implementation of half of SOLID ;-)
I dont actually thing ECS's are that bad, but I just hate the fact that so many people have failed to learn how to use composition and SOLID effectively in OO, but think that the answer is to learn these exact same tools in another paradigm...

#4Hodgman

Posted 07 April 2013 - 05:16 PM

Those T-Machine posts are really good for explaining entity/component systems as used in games, but I really strongly disagree with almost everything he says about OO in the process of explaining ECS...

n.b. you can have a structure with public data that's operated on by a system in an OO design...

When OOP took off in games, we were all new to it, and frankly, we sucked. The popularity of ECS exploded out of the fact that we'd all written these stupid OO-inheritance based entity hierarchies, that had all sorts of downsides. Eventually, we realized this was a mistake, and after admitting that our entity-hierarchies were crap, there were two paths ahead:
1) assume this was simply because OO is crap, and move on to the next misunderstood fad.
2) go back and actually learn some OOD, while also learning ECS, DOD, etc...

The author has taken path 1. He's moved on from OOP, but never had the chance to see it used properly -- almost all of his criticisms are levelled at code that's written with an OOP language, but doesn't follow OOD rules. All of the benefits and advantages that he lists for ECS can also be achieved with well written OO code.

Also, the author should make some comparisons to the Protoype paradigm, as well as relational and OO, as many "entity template" or function-sharing-via-systems mechanisms draw a lot of inspiration from that paradigm.

As a farcical proof - ECS is often implemented within an OOP language like C++, which means its possible to reverse engineer the final code into an OO-design, which you can adapt and generalize to see how this kind of structure should exist in OO... When you do this, your ECS is basically reduced to a bloated message passing and serialization framework.

At this point, please note: OOP does not have this concept of multiple aspects; it hard-codes all the aspects into one glob, and declares that the set of behaviours and values of data to be the single-aspected Class of an Object. C++’s Multiple inheritance and Java’s Interfaces can get you a small part of the way towards the aspects of an ES, but they quickly collapse under the strain in fundamental ways that cannot be fixed within OOP.

This is what I mean - not only has he apparently never heard of the SRP, but when trying to replicate his ECS structure (based on composition), he jumps straight to inheritance in his OOP toolbox, fails, then blames OO. This is a straw man argument.

only OOP programmers want to give entities hierarchical names. It can tunr out a pretty dumb idea, if you think about it: it’s usually an implicit refusal to let go of those OOP ways we’re so used to thinking in

Again, (falsely) suggesting a strong link between OO and hierarchies.

An ES takes a system where there are many things going on that are all independent, which OOP tangles up together, and pulls them apart and lets them live on their own.

argh, no! The bad OOP entity hierarchies that we were writing a decade ago do this, but that's because we were all just ad-hoc'ing our way into OOP without bothering to really study OOD first! Good OO has all the tools to let all these independent components be small, decoupled and simple. The most important tool in the OOD toolbox turns out to be the same as in the ECS toolbox: composition.

As Greenspun said, ECS systems end up being based around an ad hoc, informally-specified, bug-ridden, slow implementation of half of SOLID ;-)
I dont actually thing ECS's are that bad, but I just hate the fact that so many people have failed to learn how to use composition and SOLID effectively in OO, but think that the answer is to learn these exact same tools in another paradigm...

#3Hodgman

Posted 07 April 2013 - 05:12 PM

Those T-Machine posts are really good for explaining entity/component systems as used in games, but I really strongly disagree with almost everything he says about OO in the process of explaining ECS...

n.b. you can have a structure with public data that's operated on by a system in an OO design...

When OOP took off in games, we were all new to it, and frankly, we sucked. The popularity of ECS exploded out of the fact that we'd all written these stupid OO-inheritance based entity hierarchies, that had all sorts of downsides. Eventually, we realized this was a mistake, and after admitting that our entity-hierarchies were crap, there were two paths ahead:
1) assume this was simply because OO is crap, and move on to the next misunderstood fad.
2) go back and actually learn some OOD, while also learning ECS, DOD, etc...

The author has taken path 1. He's moved on from OOP, but never had the chance to see it used properly -- almost all of his criticisms are levelled at code that's written with an OOP language, but doesn't follow OOD rules. All of the benefits and advantages that he lists for ECS can also be achieved with well written OO code.

As a farcical proof - ECS is often implemented within an OOP language like C++, which means its possible to reverse engineer the final code into an OO-design, which you can adapt and generalize to see how this kind of structure should exist in OO... When you do this, your ECS is basically reduced to a bloated message passing and serialization framework.

At this point, please note: OOP does not have this concept of multiple aspects; it hard-codes all the aspects into one glob, and declares that the set of behaviours and values of data to be the single-aspected Class of an Object. C++’s Multiple inheritance and Java’s Interfaces can get you a small part of the way towards the aspects of an ES, but they quickly collapse under the strain in fundamental ways that cannot be fixed within OOP.

This is what I mean - not only has he apparently never heard of the SRP, but when trying to replicate his ECS structure (based on composition), he jumps straight to inheritance in his OOP toolbox, fails, then blames OO. This is a straw man argument.

only OOP programmers want to give entities hierarchical names. It can tunr out a pretty dumb idea, if you think about it: it’s usually an implicit refusal to let go of those OOP ways we’re so used to thinking in

Again, (falsely) suggesting a strong link between OO and hierarchies.

An ES takes a system where there are many things going on that are all independent, which OOP tangles up together, and pulls them apart and lets them live on their own.

argh, no! The bad OOP entity hierarchies that we were writing a decade ago do this, but that's because we were all just ad-hoc'ing our way into OOP without bothering to really study OOD first! Good OO has all the tools to let all these independent components be small, decoupled and simple. The most important tool in the OOD toolbox turns out to be the same as in the ECS toolbox: composition.

As Greenspun said, ECS systems end up being based around an ad hoc, informally-specified, bug-ridden, slow implementation of half of SOLID.

#2Hodgman

Posted 07 April 2013 - 05:05 PM

Those T-Machine posts are really good for explaining entity/component systems as used in games, but I really strongly disagree with almost everything he says about OO in the process of explaining ECS...

n.b. you can have a structure with public data that's operated on by a system in an OO design...

When OOP took off in games, we were all new to it, and frankly, we sucked. The popularity of ECS exploded out of the fact that we'd all written these stupid OO-inheritance based entity hierarchies, that had all sorts of downsides. Eventually, we realized this was a mistake, and after admitting that our entity-hierarchies were crap, there were two paths ahead:
1) assume this was simply because OO is crap, and move on to the next misunderstood fad.
2) go back and actually learn some OOD, while also learning ECS, DOD, etc...

The author has taken path 1. He's moved on from OOP, but never had the chance to see it used properly -- almost all of his criticisms are levelled at code that's written with an OOP language, but doesn't follow OOD rules. All of the benefits and advantages that he lists for ECS can also be achieved with well written OO code.

As a farcical proof - ECS is often implemented within an OOP language like C++, which means its possible to reverse engineer the final code into an OO-design, which you can adapt and generalize to see how this kind of structure should exist in OO... When you do this, your ECS is basically reduced to a bloated message passing and serialization framework.

At this point, please note: OOP does not have this concept of multiple aspects; it hard-codes all the aspects into one glob, and declares that the set of behaviours and values of data to be the single-aspected Class of an Object. C++’s Multiple inheritance and Java’s Interfaces can get you a small part of the way towards the aspects of an ES, but they quickly collapse under the strain in fundamental ways that cannot be fixed within OOP.

This is what I mean - not only has he apparently never heard of the SRP, but when trying to replicate his ECS structure (based on composition), he jumps straight to inheritance in his OOP toolbox, fails, then blames OO. This is a straw man argument.

only OOP programmers want to give entities hierarchical names. It can tunr out a pretty dumb idea, if you think about it: it’s usually an implicit refusal to let go of those OOP ways we’re so used to thinking in

Again, (falsely) suggesting a strong link between OO and hierarchies.

An ES takes a system where there are many things going on that are all independent, which OOP tangles up together, and pulls them apart and lets them live on their own.

argh, no! The bad OOP entity hierarchies that we were writing a decade ago do this, but that's because we were all just ad-hoc'ing our way into OOP without bothering to really study OOD first! Good OO has all the tools to let all these independent components be small, decoupled and simple.

#1Hodgman

Posted 07 April 2013 - 05:03 PM

Those T-Machine posts are really good for explaining entity/component systems as used in games, but I really strongly disagree with almost everything he says about OO in the process of explaining ECS...

n.b. you can have a structure with public data that's operated on by a system in an OO design...

When OOP took off in games, we were all new to it, and frankly, we sucked. The popularity of ECS exploded out of the fact that we'd all written these stupid OO-inheritance based entity hierarchies, hat had all sorts of downsides. Eventually, we realized this was a mistake, and after admitting that our entity-hierarchies were crap, there were two paths ahead:
1) assume this was simply because OO is crap, and move on to the next misunderstood fad.
2) go back and actually learn some OOD, while also learning ECS, DOD, etc...

The author has taken path 1. He's moved on from OOP, but never had the chance to see it used properly -- almost all of his criticisms are levelled at code that's written with an OOP language, but doesn't follow OOD rules. All of the benefits and advantages that he lists for ECS can also be achieved with well written OO code.

As a farcical proof - ECS is often implemented within an OOP language like C++, which means its possible to reverse engineer the final code into an OO-design, which you can adapt and generalize to see how this kind of structure should exist in OO...

At this point, please note: OOP does not have this concept of multiple aspects; it hard-codes all the aspects into one glob, and declares that the set of behaviours and values of data to be the single-aspected Class of an Object. C++’s Multiple inheritance and Java’s Interfaces can get you a small part of the way towards the aspects of an ES, but they quickly collapse under the strain in fundamental ways that cannot be fixed within OOP.

This is what I mean - not only has he apparently never heard of the SRP, but when trying to replicate his ECS structure (based on composition), he jumps straight to inheritance in his OOP toolbox, fails, then blames OO. This is a straw man argument.

only OOP programmers want to give entities hierarchical names. It can tunr out a pretty dumb idea, if you think about it: it’s usually an implicit refusal to let go of those OOP ways we’re so used to thinking in

Again, (falsely) suggesting a strong link between OO and hierarchies.

An ES takes a system where there are many things going on that are all independent, which OOP tangles up together, and pulls them apart and lets them live on their own.

argh, no! The bad OOP entity hierarchies that we were writing a decade ago do this, but that's because we were all just ad-hoc'ing our way into OOP without bothering to really study OOD first! Good OO has all the tools to let all these independent components be small, decoupled and simple.

PARTNERS