flecs integration

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

flecs integration

Post by slapin »

Hi, all!

I wonder have anybody tried integrating https://github.com/SanderMertens/flecs ECS with Ogre?

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 519
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 188

Re: flecs integration

Post by sercero »

slapin wrote: Thu Jun 12, 2025 1:51 pm

Hi, all!

I wonder have anybody tried integrating https://github.com/SanderMertens/flecs ECS with Ogre?

I looked at trying to use ECS but I just don't understand how to implement it, the concept evades me.

There is a big thread in this forum about data driven games though

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

Re: flecs integration

Post by slapin »

To my case the ECS servers 2 purposes -

  1. Abstract game data and objects from engines and low levels. Just manipulate data as intended
    and write systems which use your data to visualize on engine. You don't have to run everything off ECS but representing active objects in game makes things much easier to handle and understand, i.e. you can have both high and low level layers over your objects which can be totally independent from each other or use data from other "layer"'s components and be interconnected.
  2. Global queries make ECS an effective database of your objects which allow filtering and processing by some criteria, marking, values, etc.
    For example with ECS it is easier for AI to query data as no need to invent tools for that. You have already written data access logic which you don't need to invent.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

Re: flecs integration

Post by slapin »

To me it is very important to make scope of a task as small as possible and as local as possible, which I solve using Flecs.
i.e. I just modify needed things in my data objects and then systems do everything for me to make it visual, i.e to move character I do e.get_mut<Motion>.walk_to = location; e.modified<Motion>(); and systems will set up animations, set up root motion, get path from navmesh and walk character there; it can be cancelled at any time and on arrival the event is generated in event system (and proper values set). And suddenly if you change your engine, most of the logic remains intact, only engine-specific systems need to be changed.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 519
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 188

Re: flecs integration

Post by sercero »

Cool, because on top of all that its used mostly due to the performance gains of traversing the ECS components in a cache friendly way.

But what problem did you have integrating flecs with ogre?

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 146
Joined: Fri May 23, 2025 5:04 pm
x 5

Re: flecs integration

Post by slapin »

I'm just lazy and was hoping somebody else did it and I can use the result. No problem doing it as I already did it for Godot.