7 ms·
I'm looking forward to Rust's adoption in popular game development engines. There's https://bevyengine.org/ https://bevyengine.org/ in the meanwhile
by agluszak 4y ago
I'm looking forward to Rust's adoption in popular game development engines. There's https://bevyengine.org/ https://bevyengine.org/ in the meanwhile
- speed_spread 4y agoI love Rust, but it's "righteous" nature might go against the grain in many game shops where quick and dirty is not only accepted practice but where anything more rigid than C is deemed necessarily inferior. Something like Zig might have a better chance in that space.
- generichuman 4y agoZig also tries to block quick-and-dirty stuff, unused variables are errors for example. There are formatting related things too. This is obviously not as "righteous" as Rust as you put it, but when you look at the source of some shipped games, you'll see that some programming best practices are ignored. None of this will block Zig from being used in games, of course, but I wish they had a "let me work in peace until I get this working and then we can worry about that small stuff" mode in the compiler.
- zaphar 4y agoI think the reasons languages like Zig choose not to make this configurable is because other than the odd exception occasionally very few shops bother to turn on the stricter mode or are actively hostile to the stricter mode. And when you rely on other libraries that sort of less strict mode tends to start leaking out everywhere since that one critical library you really don't want to rewrite won't compile when you use strict and you don't want to carry a bunch of patches for it either. The net result is if you don't start out enforcing cleanliness your community of users will unintentionally devolve into unclean over time.
- adamdusty 4y agoWhy not just enforce it in release configuration?
- generichuman 4y ago> The net result is if you don't start out enforcing cleanliness your community of users will unintentionally devolve into unclean over time. Well since the package manager will be integrated to the compiler, I think they could enforce the cleanliness for people who want to publish their libraries.
- naikrovek 4y ago> when you look at the source of some shipped games, you'll see that some programming best practices are ignored. yeah. players demand performance because it relates directly to a better playing experience. they demand it with their purchases and their critiques. game developers understand this inherently or they will not be a game developer for long. honestly, i think a lot of “best practices” are nothing more than an influential person demanding compliance to their preferences, because a LOT of those “best practices” actively reduce developer productivity and runtime performance both; there’s no tradeoff, its just pure loss. non-game developers could learn a lot from seasoned and experienced game developers, i think, but we imagine ourselves wholly superior when we absolutely aren’t.
- runevault 4y agoThere are at least some studios using Rust. Chucklefish did for a while though they ended up stopping. Ready at Dawn was using Rust at one point but not sure if they still are. Embark still is so far as I can tell. It certainly isn't a language for every gamedev shop but some seem to be taking it seriously.
- littlestymaar 4y agoAre there game studios out there still using C? From what I've heard the majority is using C++, so switching Rust just makes your life easier without changing too much (C++ devs already uses templates, smart pointers, RAII, etc. which Rust has too, but with a better design (a stronger type system, and also hindsight from 30 years of C++)). From what I've seen on HN, Zig seams to appeal people who like the “simplicity” of C and find Rust too complex, but I don't think anyone coming from C++ could find Rust “too complex” (a bit different, with a learning curve indeed, but not “too complex”).
- z3phyr 4y ago> C++ devs already uses templates, smart pointers, RAII, etc. These are frowned upon in the game industry circles. Most of the game code is C style C++ with occasional function overloading and classes.
- ska 4y agoI don't know much at all about game development circles, but have a fair appreciation of others areas using c or c++ for combinations of high performance, low level, bare metal, etc. I've found some shops that very specifically use c, but other that use "c++" but that means "pretty c-like, with a few c++ features but don't you dare do x,y,z". Some of these variants are pretty simple, but it's enforced by code/design review (and sometimes tooling) not the language.
- msmenardi 4y agoYou can always use "unsafe" code in Rust. At that point you're basically writing a block of code in C++ with the guarantee that it'll interface correctly with all your other "safe" code.
- Jensson 4y agoHave you ever tried writing significant amounts of unsafe rust? It isn't like C++ at all, you get the worst of both worlds.
- junon 4y agoI'm writing a kernel in Rust, having a great time. I'm not sure what all the arguments here about it not being suitable for game dev are but I would imagine it works perfectly for game dev.
- throwawaymaths 4y agoSuppose you wrote a kernel in rust. Now there has been a CPU regression and you have to implement a retpoline. Obviously you don't want to implement it in places where you don't have to. Would this be easy? Or hard?
- junon 4y agoI don't see why it would be any more difficult or cumbersome than in C.
- throwawaymaths 4y agoBecause macros can obscure having an accurate mental model of what is happening at the metal level, which is what matters when you're doing a retpoline. This is why ziglang, for example, has "no hidden control flow". Not only the mental model, but also you might find that where you need to add the code forces you to break open a macro, which could be a considerable refactoring task.
- junon 4y agoI don't see what macros have anything to do with anything.
- ksec 4y ago>I love Rust, but it's "righteous" nature Finally. Someone gets it. It has nothing to do with the language itself. But the culture and philosophy of the tools / language / framework or library.
- Thaxll 4y agoRust will be nowhere in the next 10years for gamedev, not even sure it will be used at any point. The only one I know using it to some extend is Embark but they have a very good engineering culture ( ex DICE / SEED ). For people not working there, it's kind of a blackbox in term of tooling / pipeline etc ... when you work in webservices you have a ton of opensource knowledge / tools available, videogame are kind of different they re-invent a lot of the stuff in-house.
- mustache_kimono 4y agoI think this is sadly true. If you follow Game Devs with Large, Fragile Egos Twitter (I'm not naming names!), you'll hear a lot of "I hate (but secretly also love) C++ (because I know it intimately)" and "Rust isn't the answer" because they can't iterate fast enough. My guess is that's probably a function of them thinking they can learn Rust in a weekend, because they are 10x-ers, instead of any inherent problem with the language. There is also a machismo aspect to C/C++, especially in game dev ("I eff with raw pointers all the time!"). But, if you read the article, Tim Sweeney seems to be saying "I want a fast functional language" which Rust is. One thing I am less clear on is whether Rust is better re: modularity and extensibility.
- eska 4y agoYour first paragraph sounds so unprofessionally dismissive that I doubt anyone reads the second.
- ben0x539 4y agoAs a data point, I read the second paragraph.
- mustache_kimono 4y agoAre you saying you've never encountered an engineer with a large, fragile ego? Because lucky you. I guess I'd also say there is another, more mature side that takes Rust much more seriously, even on Twitter, such as John Carmack. I didn't know this needed to be said but not all game devs have fragile egos, but, wow, some certainly do.
- dxuh 4y agoI am sure it will happen, but (in my opinion) there is no way that it will gain significant popularity. It's just too high friction and in game development being low friction is imho one of the most important attributes of a programming language.
- cardanome 4y agoRust itself is high friction but the Bevy Engine is offering a ECS System with delightful ergonomics. So while I share the general sentiment, who knows, it might actually work out. Maybe Rust can be tamed.
- summerlight 4y agoNot so sure about this, it may take quite a time. It's not because of language's strength or weakness but simply because the upfront cost of building a modern game engine from scratch is getting more expensive and expensive. It's going to take a decade to build a competitive ecosystem against Unity or Unreal, assuming the best scenario.
- kriro 4y agoI find it interesting that one of the go to "let's learn Rust" books (Hand on Rust) is cantered around building a rogue like game. I feel like this will have a subtle but noticable (long tail) impact because many people who start learning Rust will do so on gamedev examples. The next logical step for a couple of them will be "all right now I'll build my own cool game". Maybe it'll be a tiny fraction but I feel there will be more good people moving into the Rust-Gamedev area than if that book was about building a web server.
- maxbond 4y agoAlso worth noting that you can write Godot native plugins (I don't think that's the correct terminology - forgive me, I'm not a Godot developer) with Rust, and wire them up with GDScript. This seems super promising to me as far as Rust in game dev. https://godot-rust.github.io/ https://godot-rust.github.io/
- primeblue 4y ago