Live data from Hacker News

Flecs – A fast entity component system for C and C++

flecs.dev

31–40 of 90 posts

Re: Flecs – A fast entity component system for C and C++

#31

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

I've also seen a few game devs saying ECS are useless in quite a few situations (or, at least, a very zealous adherence to ECS).

I guess it's one of those things that you don't know until you try (and hit the limits of using or not-using one).

I'm also reminded of Robert Nystrom's "Is There More to Game Architecture Than ECS": https://youtu.be/JxI3Eu5DPwE

(Yes, Robert Nystrom of Game Programming Patterns and Crafting Interpreters)

Re: Flecs – A fast entity component system for C and C++

#32
post #2

Any idea what a game loop would look like for an ECS engine that only renders a new frame when some animation is running or when the user is manipulating the camera, but not otherwise? Let's not argue "why". Most obvious would be saving battery.

I've implemented exactly this at $WORK. We literally just set a global variable, "should render next frame", from input handlers and other important events. It's not pretty but it gets the job done. There are occasional bugs where someone forgets to set the render flag after some significant event. But the bug goes away as soon as the mouse is moved, so it's usually not a big deal. If we wanted we could also schedule…

> We literally just set a global variable

I feel like game programming in general is one big "we set a global variable" :)

Re: Flecs – A fast entity component system for C and C++

#33

Could this be used to implement an efficient backend server for an Unreal Engine game?

Doesn't Unreal have its own entity system yet?

(not a game dev, don't quote me :) )

Unless I'm mistaken, Unreal hasn't had an official blessed ECS system relying on other things: from just having regular objects to reading data from data tables.

They did introduce an ECS with (currently experimental) Mass Entity in Unreal 5: https://docs.unrealengine.com/5.0/en-US/mass-entity-in-unrea...

Re: Flecs – A fast entity component system for C and C++

#34

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

Yeah fully agree, ECS is the microservices of gamedev these days.

I've worked on AAA games that used it, and shipped games as a solo dev without it. If you don't know why you need it, then chances are you don't need it. Just keep it in mind as one possible architecture pattern for when your code base starts to experience growing pains is my advice.

Re: Flecs – A fast entity component system for C and C++

#35

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

You can do both. Here is tutorial for Rogue-like game with ECS in Rust: https://bfnightly.bracketproductions.com/rustbook/chapter_2....

Re: Flecs – A fast entity component system for C and C++

#36

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

As a programmer not part of this world: what's the go-to alternative in this situation?

Does ECS not naturally arise from using OOP? Trying to think if you are creating instances of players/physics objects/items how that wouldn't turn into a kind of entity system.

Re: Flecs – A fast entity component system for C and C++

#37

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

As a programmer not part of this world: what's the go-to alternative in this situation? Does ECS not naturally arise from using OOP? Trying to think if you are creating instances of players/physics objects/items how that wouldn't turn into a kind of entity system.

no it doesn't. most OOP approaches to game dev end up with some kind of mixins or components that carry methods (like Unity).

I think the future of game dev may end up being immutable and event driven actually... but I’m yet to see anything beyond a prototype.

Re: Flecs – A fast entity component system for C and C++

#38

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

As a programmer not part of this world: what's the go-to alternative in this situation? Does ECS not naturally arise from using OOP? Trying to think if you are creating instances of players/physics objects/items how that wouldn't turn into a kind of entity system.

ECS can mean many things. the idea that you put components together (physically, in memory) and try to set up your processing so stuff is processed together may be quite natural.

but actual ECS systems add a lot of stuff on top that's not very natural (in any programming paradigm, not just OOP).

it's about enabling you to add and remove components at runtime, manage complicated relationships between entities and their components in a generic sense. this has all the advantages and disadvantages that those kinds of abstractions bring. bad if you don't need it, good if you do.

Re: Flecs – A fast entity component system for C and C++

#39

To any budding game developers, my advice would be to not rush into ECS and try to accomplish your goals with structs and loops first and understand the fundamentals of how a video game 'works' under the hood. Your game will get done if you work on it, not necessarily if you pick ECS!

I've spent a few months working with ECS/DOTS with the Unity Game Engine, their implementation of this style of architecture end up being very complex in comparison to the old fashion GameObject workflow that made Unity popular in the first place.

Everything is MUCH more difficult to implement, I won't go into details but from my experience the time spent to achieve a similar result is about 5x-10x what it should be.

Weird APIs, poor documentation, limited collective experience, tons of restrictions and limits of the C# language are making the global experience quite nightmarish.

And I have had experience with ECS-like system in different engines in the past, and I am mostly experienced with low-level engine stuff, but the induced complexity there is something I did not expect.

Re: Flecs – A fast entity component system for C and C++

#40
post #27

Earlier quoted context omitted.

> After several meetings, it was decided that it wasn't the best idea to put critical code in an app's MouseMove event. Prove that the story is real ;)

Experienced worse. At one company we had a deployment script written in English. That support from India would execute. Except they would occasionally inject their undocumented codes to fix their own issues. That and the component oriented distributed monolith that ran on single machine. It was monolith architecture but it was made to run on multiple machines. However it was never distributed and starting the compone…

Oh i guess we all have these horror stories.. I was more hinting at the fact that it took several meetings to decide something obvious.
Post reply on HN