5 ms·
> I think at some point, Rust will have enough tooling that people will try to start using it for graphics and videogames The game developer community is actua
by eridius 10y ago
> I think at some point, Rust will have enough tooling that people will try to start using it for graphics and videogames
The game developer community is actually one of the communities that jumped onto Rust really early, well before it hit 1.0.
- cpeterso 10y agoAre there any AAA game studios using or evaluating Rust yet? I saw some GDC talks about the multithreaded game engine for Bungie's Destiny game. Given the debugging and QA challenges of their multithreaded architecture, something like Rust's ownership model seems like a good fit. Does the Rust toolchain support Xbox and PlayStation? * Destiny's Multithreaded Rendering Architecture: https://www.youtube.com/watch?v=0nTDFLMLX9k https://www.youtube.com/watch?v=0nTDFLMLX9k * Multithreading the Entire Destiny Engine: https://www.youtube.com/watch?v=v2Q_zHG3vqg https://www.youtube.com/watch?v=v2Q_zHG3vqg
- mmstick 10y agoDICE is using it internally. The only reason why they aren't using it in games is because Rust won't compile on console platforms.
- steveklabnik 10y agoOh? I hadn't heard of this before! I wonder if we can fix that...
- mmstick 10y agoI recall some DICE slides about two years ago and a mentioning from a DICE employee that they are building some of their game dev tools in Rust. Naturally, EA would never approve of allowing DICE to develop a game in Rust if it meant it would make the game PC-exclusive.
- Rusky 10y agoRust can totally compile on console platforms- it's been done, e.g. on PS4 (https://twitter.com/wickerwaka/status/479842553831776257 https://twitter.com/wickerwaka/status/479842553831776257), as I'm sure you've seen, Steve :) The problem (speaking as someone working on a console game at a AAA studio) is more likely that it's not officially supported. Console SDKs include C++ toolchains and C++ libraries, and there's a lot to lose by trying to bypass that, especially on a game project schedule.
- steveklabnik 10y agoYeah, I knew it was possible for some definition of possible; I just didn't know that any game studios were using it in any capacity, let alone a studio like DICE. The support thing makes total sense. Do you think it's fundamentally insurmountable? I'm pretty sure this is an area where the team itself has a blind spot, or maybe rather, just doesn't have the necessary expertise to even know what we'd need to do to make this possible.
- Rusky 10y agoI honestly don't know how fundamental an issue it is. I suspect the console vendors and engine/library developers would all have to be on board at some level. For some idea of the timeline- most consoles transitioned from assembly to C around the N64/PS1 era, and then to C++ around the time it was standardized. A move away from C++ would probably be significantly higher-effort than the move to it- C++ can not only trivially call C APIs but can also compile most C code without modification. To support Rust would require not only porting the toolchain (though this wouldn't be too bad on current-gen, since e.g. the PS4 even uses Clang), but really working well with the console SDKs, and third-party libraries and middleware, which are all written in C++. It would probably also be a much tougher mindshare hill to climb- even C++ took a long time to be accepted, and its standard library still isn't. Vulnerabilities are not really an issue for games the way they are for, say, browsers, since games' inputs and environments are so constrained and there's often no real consequences worse than a player losing their save file. So from my perspective (which to be fair is relatively new to the industry) these might be the most important features for getting Rust into games: * Visual Studio integration, including code completion and debugging. Though console support would have to come from the console vendor, anyone could work on supporting things like variable name hovering and data display. * C++ support- though maybe different from what application developers need. DirectX (Windows/Xbox One) is all COM-based, which is strongly related. If it's handled through bindgen, it still needs code completion support. * SIMD, inline assembly, etc. This stuff gets used all the time for performance, and for a lot of it portability is not a concern, because things are handled differently per-platform anyway. Similarly, Rust might just not be a good fit for games because of some tradeoffs it makes: * Games can't get by with just malloc-style memory management- and while it's easy to mess up, C and C++ handle arenas/pools/etc with far less friction than Rust, where you'd want to package up every little pointer thing behind a safe API. That's a good tradeoff here because the bugs are mostly harmless and easy to track given the constrained environment. * Maybe error handling? (Mostly devil's advocate at this point.) The games I've worked on tend to just assert in debug mode and ignore errors in production. Carefully handling every case could legitimately be a needless time sink for some situations. On the other hand stuff like `unwrap_or` could make that much clearer without slowing anyone down. * I don't agree with all of tomaka's points (e.g. https://www.reddit.com/r/rust/comments/616rc8/rcpp_discusses_rust/dfchodq/ https://www.reddit.com/r/rust/comments/616rc8/rcpp_discusses...) but they would certainly be an issue for many game developers.
- deleted 10y ago[deleted]
- lossolo 10y agoYou mean hobbyist ? All the AAA games are still written in C++, none of the big studios is even considering to switch. Rust type system/restrictions would get into the way more than it would help in AAA game dev. Memory safety is not a problem in game development, they will just patch the bugs. Studios have whole ecosystems written in C++ that works for them. Benefits are really low compared to costs, that's why it's unlikely any major studio will switch any time soon.
- mmstick 10y agoType restrictions aren't really a problem, but in fact really helps out game development in the long run. > Memory safety is not a problem in game development, they will just patch the bugs. You must not have played any Bethesda titles. That said, there is much more to Rust than memory safety. That's just a side effect of the safe parallelism -- it's a minor story.
- lossolo 10y ago> Type restrictions aren't really a problem Did you ever seen AAA game source code? > You must not have played any Bethesda titles. I've played. Most bugs I've seen were logic errors, doesn't matter which language you would pick.
- mmstick 10y agoThis is just outright denial. Bethesda titles are rife with segmentation fault galore. Even their most recent titles suffer the same terrible CTDs as all of their previous titles.