Live data from Hacker News

Why isn't Godot an ECS-based game engine?

godotengine.org

21–30 of 151 posts

Re: Why isn't Godot an ECS-based game engine?

#21

All this hype around ECS started when Minecraft, Factorio and They Are Billions proved that the paradigm works, though that is just a small percentage of games that can benefit from ECS. The rest should use the classic OOP model. I really don't see how a game like Dota, CSGO or your average Battle Royale will be better with ECS. I agree with the article. There are libraries enabling ECS for you if you are not looking…

I had the impression this was already state of the art in 2007 when I started my CS degree.

Re: Why isn't Godot an ECS-based game engine?

#22

I don't really understand what's the advantage of ECS compared to OOP composition. Anyone here can shed some light on the matter?

Here's a real example from a project I worked on in my homebrew ECS framework and later implemented in Godot: a guided missile.

In the ECS project the notion of 'thing that can run into other things and do damage' so totally separate from the notion of 'thing that is driven around by AI.' So adding guidance to an existing projectile wasn't too much of a pain. In the Godot project I'm dealing with networking as well, so the division is between fire-and-forget projectiles (derived from Bullet) which know about hitting things and doing damage, and AI driven Ships with AI or player driven movement which needs to be synced over the Network. In that case I had to copypasta the AI driven movement code into a 'guided' class under Bullet. That said, for almost every other task, Godot's composition first model has been way easier to work with, especially because it lets you test elements in isolation. Here are the two projects if you'd like to compare the code:

Homebrew ECS framework on top of the babylonjs engine: https://github.com/EamonnMR/Flythrough.Space

Godot with networking: https://github.com/EamonnMR/mpevmvp

Re: Why isn't Godot an ECS-based game engine?

#23

All this hype around ECS started when Minecraft, Factorio and They Are Billions proved that the paradigm works, though that is just a small percentage of games that can benefit from ECS. The rest should use the classic OOP model. I really don't see how a game like Dota, CSGO or your average Battle Royale will be better with ECS. I agree with the article. There are libraries enabling ECS for you if you are not looking…

Overwatch is done with ECS, there are GDC talks from the devs explaining the tech behind it.

That's cool, I didn't know that. I've found the presentation: https://www.youtube.com/watch?v=W3aieHjyNvw

Re: Why isn't Godot an ECS-based game engine?

#24

All this hype around ECS started when Minecraft, Factorio and They Are Billions proved that the paradigm works, though that is just a small percentage of games that can benefit from ECS. The rest should use the classic OOP model. I really don't see how a game like Dota, CSGO or your average Battle Royale will be better with ECS. I agree with the article. There are libraries enabling ECS for you if you are not looking…

Sorry but we were doing ECS long time before that in the industry. I remember doing it back on the PSP with Lua(meta-table -> component mapping) and a backing in house C++ runtime.

It was pretty widely known in industry as a way to have cache locality and made it out to the broader dev community a good while after.

Re: Why isn't Godot an ECS-based game engine?

#25
post #21

All this hype around ECS started when Minecraft, Factorio and They Are Billions proved that the paradigm works, though that is just a small percentage of games that can benefit from ECS. The rest should use the classic OOP model. I really don't see how a game like Dota, CSGO or your average Battle Royale will be better with ECS. I agree with the article. There are libraries enabling ECS for you if you are not looking…

I had the impression this was already state of the art in 2007 when I started my CS degree.

Kind of providing an ECS-based game pre-2016, before Factorio, Minecraft Non-Java, They Are Billions and Overwatch (as I was told in a comment) got released?

Re: Why isn't Godot an ECS-based game engine?

#26
post #19
post #12

I'm a novice JavaScript game developer and I'm currently using OOP for my entities. E.g. each NPC is an object with an update method inherited from a base class that gets called every tick. What benefit would ECS actually give me? Isn't the NPC data still just an object but instead of using a shared prototype update method on the object it would be a separate component function? What is the actual difference?

Hmm, if you only have one system, then yes, those are the same. But if you have multiple systems (say collision detection, physics, damage/health, control(ai or player)) you can then build things up lego brick style. For example, a basic wall will just participate in the collision detection system and nothing else, but now it's easy to add in breakable walls by giving them a hp value and defence value for the damage…

Yes, thank you! It certainly seems like a good and flexible way of structuring your game but I still don't understand where the performance benefits the article speaks of come from.

Re: Why isn't Godot an ECS-based game engine?

#27

All this hype around ECS started when Minecraft, Factorio and They Are Billions proved that the paradigm works, though that is just a small percentage of games that can benefit from ECS. The rest should use the classic OOP model. I really don't see how a game like Dota, CSGO or your average Battle Royale will be better with ECS. I agree with the article. There are libraries enabling ECS for you if you are not looking…

Sorry but we were doing ECS long time before that in the industry. I remember doing it back on the PSP with Lua(meta-table -> component mapping) and a backing in house C++ runtime. It was pretty widely known in industry as a way to have cache locality and made it out to the broader dev community a good while after.

That's nice, but why all the game engines and libraries introduced it only recently? Defold, Unity ECS, etc.?

Re: Why isn't Godot an ECS-based game engine?

#28

Personally, deep object ontologies make my eyes glaze over. Its not like these objects evolved in the wild and their ancestry is somehow interesting. Give me interface definitions any day. ECS is nicer for that.

Yup, "has a" vs "is a". From my experience in gamedev the former is a lot more common than the latter.

Had an engine where each entity could only have one mesh object since it was a part of the base entity type rather than a component. Led to a lot of multi-entity shenanigans that were brutal from a sync/off-by-one-frame perspective.

Re: Why isn't Godot an ECS-based game engine?

#29

Earlier quoted context omitted.

Sorry but we were doing ECS long time before that in the industry. I remember doing it back on the PSP with Lua(meta-table -> component mapping) and a backing in house C++ runtime. It was pretty widely known in industry as a way to have cache locality and made it out to the broader dev community a good while after.

That's nice, but why all the game engines and libraries introduced it only recently? Defold, Unity ECS, etc.?

Because not every engine slaps a fancy ECS tag front and center, the pattern evolved concurrently in industry (and we all had games to ship).

If you look really carefully you'll find structured column databases have similar properties since when you optimize for speed cache misses are your number one enemy.

Re: Why isn't Godot an ECS-based game engine?

#30

Earlier quoted context omitted.

Sorry but we were doing ECS long time before that in the industry. I remember doing it back on the PSP with Lua(meta-table -> component mapping) and a backing in house C++ runtime. It was pretty widely known in industry as a way to have cache locality and made it out to the broader dev community a good while after.

That's nice, but why all the game engines and libraries introduced it only recently? Defold, Unity ECS, etc.?

You mean the big commercial game engines? They took a while time to adjust because, by definition, they're big. Harder to move the entire ecosystem at once.

But that's hardly "all the game engines"

Post reply on HN