• he/him

Coder, pun perpetrator
Grumpiness elemental
Hyperbole abuser


Tools programmer
Writer-wannabe
Did translations once upon a time
I contain multitudes


(TurfsterNTE off Twitter)


Trans rights
Black lives matter


Be excellent to each other


UE4/5 Plugins on Itch
nte.itch.io/

hthrflwrs
@hthrflwrs

my deepest darkest gamedev secret is that i actually don't think ECS is very good. there's nothing Wrong with components, but in my experience pretty much every use case that requires them can also be implemented with inheritance/interfaces. the resulting architecture is more rigid, but rigidity can be leveraged in some really powerful ways. anything you can't change becomes something you don't have to think about changing


hthrflwrs
@hthrflwrs

ECS is an inherently mushy architecture, and the worst thing that an engine can be is mushy. this is my firmly held belief


Turfster
@Turfster

I agree with the premise (ECS can get very messy and inefficient really quickly), but I'm just going to flag that an important thing we shouldn't overlook is that its introduction and wide adoption made it much easier for everyone-that's-not-an-experienced-programmer to create games and more freely experiment by constructing new things from existing prebuilt pieces.
(and also freed up team programmer time for other things, I guess, as a positive side effect? Maybe only needing to do some rewrites when the Designer/Artist Frankenconstruct gets too expensive...)


You must log in to comment.

in reply to @hthrflwrs's post:

I think the issue is that object-oriented is So Much Worse.

I was making a real-time multiplayer strategy game in college (don't ask) and, of course, we used an object-oriented architecture. All our little spaceships were inherited from the same Ship base class, which contained all the movement logic. But when we added a Missile class, it needed to inherit from the same base class to be able to move around. So we were severely limited in how many Missiles we could have flying around on the screen because they all had a Hull, a Mesh, and goodness knows what else.

Would this have been better with an Entity-Component System? Of course not! We were all 21 and had no idea what we were getting ourselves into with this game. But we could have had more missiles on the screen with a different architecture. 🚀

that seems more like a planning problem than an architecture-specific problem, tbh? if Ship inherited from a more base class, say, MovableObject, you could inherit missiles from MovableObject without the Ship-specific code. i won't lie and say that OO doesn't take more planning up front, but with that planning in place, it's possible to make a very strong architecture

Just because you're have objects handy doesn't mean that you have to use inheritance to abstract behaviors.

If I were working in a language without Duck Typing (a la GDScript), I'd probably have interfaces for the data that different behaviors need to interact with (maybe, unless that lead to perf problems), so, you'd have ICoord2D (or ICoord3D), IMoveTarget, IVelocity and so on, and then have various behaviors that each game object calls into, like SeekTarget(ICoord2D me, ICoord2D target).

At least, that's a thought. One might end up with too many interfaces, though that seems preferable to dealing with the ontological deadlock that Inheritance seems to lead to.