News for hackers. Stuff that matters.
Re:Are we game yet? – A guide to the Rust game development e... by hectorlorenzo on Wednesday February 10, 2021 @07:48AM (#26088398)
I just recently came across these two videos.

Using Rust For Game Development by Catherine West: https://www.youtube.com/watch?v=aKLntZcp27M

Counter-rant from Jonathan Blow: https://www.youtube.com/watch?v=4t1K66dMhWk

Re:Are we game yet? – A guide to the Rust game development e... by Thaxll on Wednesday February 10, 2021 @09:38AM (#26089678)
The sutdio Catherine West worked for stopped using Rust and went back to C++ fyi.

https://www.reddit.com/r/programming/comments/atyzz4/halley_...

Re:Are we game yet? – A guide to the Rust game development e... by ImprobableTruth on Wednesday February 10, 2021 @12:22PM (#26092041)
... because Catherine West left for personal reasons and so it was easier to shift the project over to their existing and already working C++ engine (that they were continuously developing and using, so they didn't really 'go back').
Re:Are we game yet? – A guide to the Rust game development e... by badsectoracula on Wednesday February 10, 2021 @09:25AM (#26089515)
I'm not sure if it was that first video or i saw/read about this approach somewhere else (i'm almost certain that i heard about it years before that video though), but my reaction was pretty much the same as Jon Blow's (though not so long winded :-P): aren't you just working around the borrow checker and making your own allocator with its own faux pointers via indices? Sure, it wont crash the game if your index is invalid, but you'll still access the wrong data - which can end up with hard or weird bugs and corrupted state (e.g. in savegames and/or editor).
Re:Are we game yet? – A guide to the Rust game development e... by andrewflnr on Wednesday February 10, 2021 @09:40AM (#26089707)
Yeah, that's pretty much working as intended. The first priority of Rust's safety is crashes and security. Any other bugs that get squashed are a bonus, and you can't expect it to get all of them (whatever any overly enthusiastic evangelists might say).
Re:Are we game yet? – A guide to the Rust game development e... by adwn on Wednesday February 10, 2021 @08:52AM (#26089008)
> Counter-rant from Jonathan Blow

I've just watched the first 20 minutes of that video. So far, it's all "yeah, she's basically right". When does he get to the point? I.e., what does he actually object to?

Re:Are we game yet? – A guide to the Rust game development e... by neutronicus on Wednesday February 10, 2021 @10:21AM (#26090311)
Her talk is basically "Introduction to Entity Component Systems for Rust Programmers," and it has an implicit secondary thesis that implementing the ECS in Rust adds value vs implementing it in e.g. C++.

He seems to disagree with that secondary thesis. He thinks she did a good job implementing a toy ECS, but that Rust itself wasn't particularly helpful to her.

Re:Are we game yet? – A guide to the Rust game development e... by indy on Wednesday February 10, 2021 @09:53AM (#26089894)
An issue that Jonathan Blow had was that one of the touted benefits of Rust is it's ownership semantics, yet the ECS (Entity Component System) that the talk demonstrated was effectively bypassing that.
Re:Are we game yet? – A guide to the Rust game development e... by adwn on Wednesday February 10, 2021 @10:20AM (#26090276)
> ownership semantics, yet the ECS (Entity Component System) that the talk demonstrated was effectively bypassing that.

I don't see how that's the case [1]. The entities are owned by the ECS (or the game state, or whatever), not by each other. Entities can conceptually reference each other, but not own each other. The only time this is problematic, is when one entity is destroyed while another one is still holding a reference to it. At the beginning of the video, he discussed basically all approaches to solve that problem:

1) Raw pointers. Bad for obvious reasons.

2) Smart pointers which keep the referenced object alive. No good, he says, because one entity should not keep another one alive, if the game logic says it should be removed.

3) Weak pointers which are safely invalidated when the referenced entity is removed. No good, he says, because keeping track of back-references is inefficient.

4) Weak pointers which check whether the referenced entity is still alive before accessing it. Which is exactly what the ECS does. Rust's ownership semantics still help here, because entities are unambiguously owned by the ECS, which returns a type-safe None value when you try to access a deleted entity.

[1] I'm not arguing against you, indy; I understand that you paraphrased Blow's argument.

Re:Are we game yet? – A guide to the Rust game development e... by meheleventyone on Wednesday February 10, 2021 @04:17PM (#26094940)
Yeah the confusion comes because entities are no longer a concrete element of the program but a concept tying components together. It’s just as valid to look at a subset of the components that are referenced by an entity id as a view as it is to look at them all. Like a relational database.

And by breaking things into components the granularity of ownership is increased compared with the equivalent concrete representation of the same data. So whilst you can’t reason about ownership of an entity as it primarily exists conceptually the ownership of its constituent parts is well defined.

Re:Are we game yet? – A guide to the Rust game development e... by gameswithgo on Wednesday February 10, 2021 @09:02AM (#26089178)
tldnr is that Rust guides the programmer only halfway to the solid engineering solution, the programmer is on their own to make the arena solution safe.

its a pedantic nitpick, as is his way. also keep in mind that of late Blows focus has been single player video games made by very small very talented teams. A domain where the benefits of Rust are very small, possibly even a net loss compared to the fast compiling language they use now.