3 ms·
Games often use arena-based allocation systems, slotmaps etc to manage myriads of instances. I don't see how any of that is a problem in Rust?
by aldanor 6y ago
Games often use arena-based allocation systems, slotmaps etc to manage myriads of instances. I don't see how any of that is a problem in Rust?
- steveklabnik 6y agoIt is not. The usual arguments against Rust for games are more cultural. Rust makes a tradeoff of being a bit harder up front, for less time debugging later. Many people say that games specifically would prefer the opposite tradeoff. We'll see as things continue to develop here.
- vvanders 6y agoHonestly most of the iterative parts of gamedev I worked on was either already up in the tooling/editor or in a scripting language. I think Rust for core engine and Lua for game logic would be a pretty solid combo.
- megameter 6y agoIt's mostly the ergonomics of Rust being fine-grained that present a problem. While it's gotten better with revision, fundamentally, you start in an assume-nothing mode in Rust and then boilerplate appears to say "actually, this one is mutable". This incurs friction on nearly every line of state manipulation and when you're doing game-style allocation, you mostly don't care. You have a tremendous amount of mutable state; some of it you blow away every frame, the rest you may want to lock sometimes. What Vale does that is attractive is to make simplifying assumptions that address this problem domain closer to the level of granularity that it deserves.
- danbolt 6y agoI think a pure ECS has its state manipulation well-encapsulated and organizable. Part of me thinks that sort of design would mesh pretty well with Rust’s ownership system.
- steveklabnik 6y agoRust folks think this as well; there has been a lot of activity in this area, and even spread some of the ideas behind ECSes to areas outside of games. https://kyren.github.io/2018/09/14/rustconf-talk.html https://kyren.github.io/2018/09/14/rustconf-talk.html