News for hackers. Stuff that matters.
Re:Why isn't Godot an ECS-based game engine? by bogwog on Saturday February 27, 2021 @12:45PM (#26286533)
I'm going to have to give a hard disagree. I've been making my own engines for a long time, and have used many different engines for a longer time. Inheritance-based entity systems are often a pain in the ass to work with, a massive pain in the ass to debug, and tend to invite shitty hacks to get around the shortcomings of the inheritance model.

The article says that "Godot does composition at a higher level than in a traditional ECS", but I don't get what he means by that? Combining nodes with incompatible hierarchies is hardly composition, and is just what you typically have to do when using inheritance.

Inheritance-based entity systems are not always terrible, and even though I tend to hate them, I use them quite a lot in my projects where an ECS would be overkill. If designed for a particular project, you can usually be more productive, and write cleaner and less code with inheritance.

However, for a general purpose engine like Godot, that's a bad choice IMO. The flexibility offered by an ECS far outweighs all benefits of an inheritance-based system.

Re:Why isn't Godot an ECS-based game engine? by lxdesk on Saturday February 27, 2021 @02:30PM (#26287451)
Godot doesn't expose inheritance to scripting AFAIK; it's strictly a convenience used internally to describe the core nodes. When you script Godot to make complex entities, it's through composition of arbitrary nodes in arbitrary hierarchies, often encapsulated as scenes. References are mostly done by relative path, and the scripting language has sugar to make this a convenient process.

So, yeah, try it. It's the best system I've encountered for the general-purpose use-case, and I've designed a fair few myself.

Re:Why isn't Godot an ECS-based game engine? by dexwiz on Saturday February 27, 2021 @12:54PM (#26286630)
Composition does not strictly imply inheritance. A DOM tree is a perfect example of composing nodes without inheritance.
Re:Why isn't Godot an ECS-based game engine? by IggleSniggle on Saturday February 27, 2021 @08:21PM (#26289807)
Strange to see this worded this way because I often think of composition as the opposite of inheritance.

Instead of “this thing uses this subset of parts from its parent” it is “this thing is composed of this collection of parts.”

Re:Why isn't Godot an ECS-based game engine? by rudedogg on Saturday February 27, 2021 @11:07PM (#26290587)
Can you give an example of how the composition works, or where it is used?

With everything inheriting from the Node class, I've only seen it as being an OOP/inheritance system.

Re:Why isn't Godot an ECS-based game engine? by mhh__ on Saturday February 27, 2021 @02:16PM (#26287330)
So what does Jai do that is different?

For performance at least my focus is usually on eliminating information-lossy interfaces i.e. try to keep the hot loops where the compiler can see them

Re:Why isn't Godot an ECS-based game engine? by JesseMeyer on Saturday February 27, 2021 @02:53PM (#26287605)
Jai is a programming language and not a game engine.