Live data from Hacker News

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

godotengine.org

61–70 of 151 posts

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

#61

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.

Could you elaborate the way your system worked in Lua? Was the table itself an Entity, and which meta-methods would link with component? What kind of querying capabilities did a System have? I've seen metatables used often to implement inheritance, but not the ECS yet.

It's been over a decade now but if I remember right yeah the entity was a table, meta-table would do a lookup for the related component(ex: table.mesh would give you the mesh component) and each entity also had an optionally available coroutine for AI logic. Components were batch processed by type for the performance sensitive areas.

The coroutines there was incredibly useful, our designers could write AI that was almost literate programming(yield value was number of frames to wait to re-eval coroutine). Something like: Walk to point A, yield until at A, turn, walk to point B, yield, check for nearby entity of type, yield, etc.

Oh and it also ran the whole game state in a 400kb preallocated block in a system than only had 8mb of accessible ram(rest went to vram).

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

#62
post #26
post #19

Earlier quoted context omitted.

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.

My understanding is the performance benefits come from the locality of the data. Usually in an array for each component. Whereas in a OOP system, your objects would be scattered throughout the heap.

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

#63
post #34

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.

From the article: Using ECS Nothing prevents you to use an ECS solution in Godot. In fact, I strongly suggest to check Andrea Catania's fantastic work on Godex, which aims to bring a high performance ECS pluggable implementation.

That paragraph really should've been the focus of the article, front and center - and from there an explanation on why it ain't built-in.

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

#64
post #21

Earlier quoted context omitted.

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?

For anyone curious to know more about usage of ECS in Overwatch, check out this GDC talk from one of the developers: https://youtu.be/W3aieHjyNvw

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

#65

As a beginner not thinking too much about performance, ECS is beautifully elegant and easy to reason about. However I found it nearly impossible to integrate into libraries/engines that aren't made for it. I really wanted to use React for my complex RPG UI and PhaserJS or Pixi for I/O, but the state management paradigms just didn't work together (for me at least).

If your problem is "you can't mutate state of a react app easily because they decides to make their own state management system that can't mutate by part out of the app directly". Probably you can give vue a try. It is designed to work like a plain object. And mutate the data belongs to it from outside of a vue app also reflect to the view instantly. (Just alter the property of the vue component, that's all you need to change it from outside)

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

#66
post #59

I'm a bit confused between there's a hugely popular place between inheritance-based entities and ECS (Entity-Component-System), which is what you could call a "Entity-Component system) (notice spelling) or perhaps a Component-based entity composition system. Inheritance based: you derive Vechicle, then derive Tank, Car, etc. This was most used from 95 to 2005 as teams moved to C++. Component based: you create a Tread…

Godot is node based so you compose an Entity out of nodes. It’s a slightly more flexible version of an Entity Component model.

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

#67

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…

Entity component systems are nothing new, I remember reading an article about it from Valve back in like 2007.

The recent hype comes from Unity, because they very unimaginatively misappropriated the term.

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

#68
post #59

I'm a bit confused between there's a hugely popular place between inheritance-based entities and ECS (Entity-Component-System), which is what you could call a "Entity-Component system) (notice spelling) or perhaps a Component-based entity composition system. Inheritance based: you derive Vechicle, then derive Tank, Car, etc. This was most used from 95 to 2005 as teams moved to C++. Component based: you create a Tread…

I know what you mean, and that confusion is 100% Unity's fault, because they call their data-oriented entity system "ECS".

Back in the day, composition was referred to as "component-based entity systems", which makes perfect sense.

But then Unity came in and called their data-oriented one "entity component system" for reasons I will never understand. Why not just call it "data-oriented entity system" or something like that?

So nowadays when you hear "ECS", it's not clear what people are talking about anymore.

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

#69
post #68
post #59

I'm a bit confused between there's a hugely popular place between inheritance-based entities and ECS (Entity-Component-System), which is what you could call a "Entity-Component system) (notice spelling) or perhaps a Component-based entity composition system. Inheritance based: you derive Vechicle, then derive Tank, Car, etc. This was most used from 95 to 2005 as teams moved to C++. Component based: you create a Tread…

I know what you mean, and that confusion is 100% Unity's fault, because they call their data-oriented entity system "ECS". Back in the day, composition was referred to as "component-based entity systems", which makes perfect sense. But then Unity came in and called their data-oriented one "entity component system" for reasons I will never understand. Why not just call it "data-oriented entity system" or something lik…

The confusion is worsened by people interpreting it as "[an] (entity component) system" or "[an] ((entity) (component)) system", when it's actually "[an] Entity–component–system [architecture]". That is, it's not a system of entities and components, it's an architecture comprising entities, components, and systems.

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

#70

I first met ECS when modding an RTS called Tiberian Sun. The units were all defined in ini files and you specified the components for each unit eg the difference between a building and a moving piece was whether there was a movement component etc. And a small but vibrant modding community grew up around it. Everything was dynamic, read from data definitions when the game loaded. One downside to godot’s inheritance is…

Tiberian Sun's technology is really unique and cool and I wish they'd open source it so I can see how they did everything. The 2d lighting really have it a distinct atmosphere.
Post reply on HN