3 ms·
I think Rust is a great language to write a concurrent stable ECS in, which doesn’t need circular data structures at all. Like bevy.
by pshc 3y ago
I think Rust is a great language to write a concurrent stable ECS in, which doesn’t need circular data structures at all. Like bevy.
- TheRoque 3y agoWhy is better for this than other languages ? The issue is that it forces you to apply a specific paradigm that may or may not be suited for your use case, and makes it extremely hard to apply other paradigms that you also may need. It's true that there are a few examples of semi-successful games or engines (Veloren, Bevy), but so far it' quite underwhelming... I don't know if the strengths of Rust are even worth it for game dev as a whole
- winrid 3y agoThe fact is to ship a game you often need to reach into random parts of the heap to get things done. Can you re-architect your game when you hit this wall to get around it? Yes. Can you try to use hashmaps for everything instead? Yes, to a point. But the person writing their game in C++ will laugh maniacally, do the crazy thing, and ship it.
- harles 3y agoBevy absolutely allows circular data structures and I’d be surprised if any complex game ships without any - Entity references can easily be circular. Most ECS frameworks are their own memory manager which, sure, prevents running afoul of the borrow checker at compile time but not in spirit. Dangling pointers, null references, and duplicate mutable references all creep into an ECS. They just have new names since it’s all hidden behind Entity rather than a reference or pointer.
- pshc 3y agoIn-game structures can of course be circular, logically speaking, by constructing a chain of entities and components that circularly reference each other by entity ID. But you're saying that Bevy has classic pointer-backed reference cycles? That's news to me.