News for hackers. Stuff that matters.
Re:Comfy, the 2D rust game engine, is now archived by rollcat on Monday September 09, 2024 @08:39AM (#41487948)
I cannot find the article right now, but it was a wonderful piece on why a language like Rust is by design incompatible with the whole idea/process of making games. (I hope it rings a bell for someone who can find it.)

It went something like this: you start with a nice little tidy spec for basic arithmetic; how "a + b" must be the same as "b + a", etc. Then the designer comes back to you and asks for the ability to make numbers blue. You're like wtf but ok, when you add a blue "a" to a non-blue "b", the result becomes blue; you must remove half of your tests (because they no longer even apply) and rewrite the other half to match the spec, and a week of work later the result somehow still makes some mathematical sense. Then the designer comes back to you with the request to make even numbers shoot sparks on death, and to remove all fives...

And it's just how it goes. Games need to be iterated on quickly and efficiently, with a tight feedback loop on what ends up being fun during playtesting, and what doesn't. Rust might be great for writing low-level code / engines, but it will constantly get in your way where you need to respond quickly.

Re:Comfy, the 2D rust game engine, is now archived by capitainenemo on Monday September 09, 2024 @10:11AM (#41488752)
Interesting because there was a rust keynote by kyren arguing the exact same thing for why games were a poor fit for OOP/C++. Arguing for data oriented which rust does well. ... or C I suppose.

It might be that rust ecosystem this dev was dealing with was itself draining with continually shifting APIs, but that's not the same as the language itself.

https://kyren.github.io/2018/09/14/rustconf-talk.html

Re:Comfy, the 2D rust game engine, is now archived by consteval on Wednesday September 11, 2024 @04:30PM (#41515110)
Most C++ games aren't really OOP C++. They're more loosey-goosey maybe you use some OOP stuff sometimes C++.

The problem is C is far too low level. And everything you can do in C, you can do in C++. You just also get things like namespaces and RAII.

From a game making perspective, there's no rules anywhere saying you have to write good, readable, C++. You can, and often people do, make amalgamations and monstrosities. You can do this very quickly, and if there's little bugs here and there it's no biggie, because you're just making a game. A segmentation fault is really not the end of the world.

Re:Comfy, the 2D rust game engine, is now archived by capitainenemo on Saturday September 14, 2024 @04:21PM (#41542548)
Well... yes. Rust is kinda like nicer C. You can augment the data structures with behaviours. Which kyren notes in her keynote. I just feel the problem of the author of Comfy is not so much with rust-the-language but with the existing SDKs he was trying to build on which were moving targets. Not unsurprising for new stuff.
Re:Comfy, the 2D rust game engine, is now archived by consteval on Tuesday September 17, 2024 @09:33AM (#41567449)
I wouldn't describe Rust as a nicer C. Rust is a more correct C++, and C++ is a nicer C.

Rust isn't actually nicer to program in than C++. It takes longer to produce the same amount of code. The tradeoff is correctness. So now the value of using Rust depends on the value of correctness. In most domains, correctness is very valuable. Game development is one in a million, where correctness really doesn't matter that much. What matters more is velocity and tooling.

Even if Rust catches up with C++ in tooling and is stable, I don't believe it will replace C++ in gaming specifically. Because C++ naturally orients itself more towards that super fast development, throw-shit-at-the-wall approach to software. For gaming, that works best.

Re:Comfy, the 2D rust game engine, is now archived by capitainenemo on Sunday September 22, 2024 @12:39PM (#41618175)
I was thinking back to the C-based dev I've done which was heavy on tying together data structures with functions that operated on them. Adding behaviours to data structures is way nicer in Rust, so that's the part that I feel would make it attractive to a C developer, in particular a game developer.

... and without the messiness of OOP inheritance in C++ messing with your convoluted game rules... (that was the main thing kyren was focusing on in that keynote) - obviously you don't have to use OOP, but your C++ frameworks probably do, and it's the natural way to do C++ and to augment your data structures with useful behaviours... if you're not doing that, you're kinda back to C-like, and at that point I feel Rust does win again...

Re:Comfy, the 2D rust game engine, is now archived by consteval on Tuesday September 24, 2024 @02:41PM (#41639625)
I mean, I just don't think this is true. All the most mature entity-component frameworks are built in C++.

C++ is one of the most flexible languages, ever. OOP is a very tiny part of C++. You can 100% do data-oriented designs. And most and engines, do!

> if you're not doing that, you're kinda back to C-like

I don't understand how you can believe this. Maybe you don't have the C++ experience.

You have higher order functions, you have templates, you have compile-time programming. Hell, C++ has higher-kinded types - even Rust's type system can't do that!

C++ is very convenient to program in and very powerful. That's why it's used for games and will continue to be used for games. Rust is not more powerful, in any ways, in that regard. It can do the same shit, but with more headache. Usually that's worth it, but not for video games.

Re:Comfy, the 2D rust game engine, is now archived by pjmlp on Monday September 09, 2024 @08:42AM (#41487966)
It is from the same author, they link it on the readme.
Re:Comfy, the 2D rust game engine, is now archived by rollcat on Monday September 09, 2024 @09:08AM (#41488169)
Silly me, thanks!