News for hackers. Stuff that matters.
Re:Fyrox Game Engine 0.29 by Waterluvian on Monday January 09, 2023 @09:25PM (#34319603)
“The safety and speed of Rust makes game development a true joy.”

I’m not an expert in game dev but I keep scratching my head on the concept Rust game engines. The above statement is about optimizing for the wrong things, IMO. I want simple and fast development loop. It’s why Lua is so great for game dev and why there’s so many custom scripting languages. Maybe Rust game engines need to expose their API using a scripting language rather than Rust.

Of course, there’s plenty of game engines and plenty of room for experiments, so I’m delighted to see another.

Would love to hear from others who develop games on how they feel about writing one purely in Rust.

Re:Fyrox Game Engine 0.29 by mden on Monday January 09, 2023 @09:43PM (#34319795)
I can't speak for large games but the Bevy build-run loop is quite fast for smallish games (say 10k loc). Certainly more pleasant than say Python or JS where it starts fast and then you spent five iterations fixing errors Rust's type & ownership systems would have caught.
Re:Fyrox Game Engine 0.29 by Waterluvian on Monday January 09, 2023 @09:48PM (#34319845)
I feel like at this point JS is a compile target. TS + Phaser or PIXI is delightful.
Re:Fyrox Game Engine 0.29 by rpastuszak on Tuesday January 10, 2023 @05:45AM (#34322904)
Is this comment getting downvoted because there’s something wrong with it or because people disagree?
Re:Fyrox Game Engine 0.29 by m00x on Tuesday January 10, 2023 @05:49PM (#34332620)
I think wasm + webgpu will probably take over game development since it's incredibly portable from the start, and has near-native performance. Bevy is directly integrated with both, so I'm really hopeful of its future.
Re:Fyrox Game Engine 0.29 by hesdeadjim on Monday January 09, 2023 @09:54PM (#34319908)
The context matters entirely.

Is the person looking to choose an engine a hobbyist, hopeful indie, tech lead for a team? Is the project content driven or very procedural? What’s the timeline? Are there resources to dedicate to significant tooling, or handling cross-platform insanity?

List goes on of course. But my highly opinionated answer to your question is the only people using a rust game engine are hobbyists and hopeful indies who aren’t on a time crunch.

Re:Fyrox Game Engine 0.29 by saghm on Monday January 09, 2023 @10:16PM (#34320070)
Maybe that's a feature and not a bug? From what I understand, crunch is supposed to be one of the worst parts of professional game development. If the argument is that Rust forces you to handle all of the edge cases up front and requires more development time to fix a poorly chosen design after the fact, I'd argue that those sound like things that would both technically and socially incentivize not relying on last minute crunch to get a game released. If Rust is widely known to be ineffective when used in a time crunch, seeing that a company chose to develop a game with Rust despite that might be a positive sign about what type of development culture they have.
Re:Fyrox Game Engine 0.29 by noduerme on Monday January 09, 2023 @10:43PM (#34320243)
I don't know enough about Rust development, but definitely agree that it's a good sign to see a culture that pays attention to potential future issues early in development. On the other hand, if an approach leads to constant tear-downs early on, it opens up the risk of runaway refactoring before you have a playable demo.

I feel like "Crunch" is sort of baked into a certain business model anyway, and the type of management that relies on it would probably find other ways of creating aggressive and unachievable last minute goals.

Re:Fyrox Game Engine 0.29 by hesdeadjim on Monday January 09, 2023 @11:18PM (#34320444)
Poor word choice on my part, I did not mean 'crunch' in the traditional game development sense. I meant that a hopeful indie who doesn't have a timeline to worry about and can work at their leisure.
Re:Fyrox Game Engine 0.29 by flohofwoe on Tuesday January 10, 2023 @03:16AM (#34321936)
> ...crunch vs Rust...

Crunch is a management problem, programming language details won't help in this regard (and the entire role of programming languages in game development seem way overblown in the comments here anyway - you pick an engine mainly for the artist workflows it provides, and then use whatever programming language that engine supports best).

Re:Fyrox Game Engine 0.29 by cardanome on Tuesday January 10, 2023 @06:26AM (#34323193)
Game dev is highly iterative. Chances are the code you wrote will get deleted or rewritten anyway so forcing you to handle potential edge cases means forcing you to waste time.

I think Rust can play a similar role as C++ in driving the actual game engine code which is more static but I don't think writing the actual game logic in it plays to its strength. For that more dynamic languages with faster iteration times shine.

As for crunch time, that is a organizational problem, there will be not technical fix for that.

Re:Fyrox Game Engine 0.29 by vvanders on Monday January 09, 2023 @10:01PM (#34319959)
Lua is great and I've shipped titles professionally with it however it needs to be deployed at the right layer. There's going to be things that you need to be fast and usually native is your path there. I think in that context Rust shows a lot of promise.

Also the build loop on Bevy is pretty good from what I've seen, esp if you enable the dynamic linkage flag in development. The ECS system is really well thought out even if the engine is a bit sparse I think it shows a lot of promise to build a highly efficient game loop.

Re:Fyrox Game Engine 0.29 by ummonk on Monday January 09, 2023 @10:36PM (#34320207)
C# with the burst compiler in Unity is rather cool in this respect. Do normal scripting but have the option to use a restricted subset for C-like code that gets compiled or JIT’ed in performance sensitive jobs.
Re:Fyrox Game Engine 0.29 by toivo on Tuesday January 10, 2023 @08:40AM (#34324684)
Too bad in a big project the recompile and asset reload times get annoying in Unity, even with assembly definitions. In one project I used a runtime lua interpreter on top of C# to speed up game scripting.
Re:Fyrox Game Engine 0.29 by noduerme on Monday January 09, 2023 @10:24PM (#34320131)
I'm just about to try diving back into HaXe for the first time since 2012 or so, before OpenFL was complete with web and mobile targets - when my primary tools for building 2/2.5D games were AS3 and Starling. Have you played with game code in the HaXe realm at all recently (like, since 2014?)

[edit] I also just noticed your comment further down about TS and Pixijs... and I'm debating whether to go the HaXe+OpenFL to many targets route, or use the TS toolchain just for OpenFL to javascript. My last experiment with this was trying to port ASWing to JS via HaXe, that's how old I feel! But I heard that the OpenFL JS target was at least originally built on top of Pixijs (which I adore, and has been my go-to for canvas/webgl interaction in recent years).

Re:Fyrox Game Engine 0.29 by adamnemecek on Monday January 09, 2023 @10:24PM (#34320134)
Lua is for scripting engines built in something else. Rust replaces the something else, not Lua.
Re:Fyrox Game Engine 0.29 by poulpy123 on Monday January 09, 2023 @11:21PM (#34320467)
AFAIk the 2 biggest game engines use C# and C++
Re:Fyrox Game Engine 0.29 by Mikeb85 on Tuesday January 10, 2023 @02:13AM (#34321537)
You mean they use C++ for the engine and C# scripting.
Re:Fyrox Game Engine 0.29 by msk-lywenn on Tuesday January 10, 2023 @04:19AM (#34322295)
Unity dreams of removing all the C++ code and replacing it with their "High Performance c#", ie. using the burst compiler and manual memory management to remove the GC problem.
Re:Fyrox Game Engine 0.29 by Kiro on Tuesday January 10, 2023 @04:24AM (#34322331)
Unreal Engine uses C++ for both.
Re:Fyrox Game Engine 0.29 by pjmlp on Tuesday January 10, 2023 @08:06AM (#34324229)
Blueprints isn't C++ as such.
Re:Fyrox Game Engine 0.29 by pjmlp on Tuesday January 10, 2023 @08:09AM (#34324268)
No, Unity has already replaced a few C++ modules with HPC#, their C# subset for low level coding.

They also plan to eventually use NativeAOT as part of the .NET Core migration to further go down that path.

Unity has been one of the reasons why C# has gotten so much better for low level coding since version 7, alongside feedback from Midori experience and wanting to win Techempower benchmarks.

Re:Fyrox Game Engine 0.29 by tormeh on Tuesday January 10, 2023 @05:22AM (#34322750)
I think the Bevy engine people are working on a way to use scripts for game logic, so many agree with you.
Re:Fyrox Game Engine 0.29 by suprfnk on Tuesday January 10, 2023 @05:31AM (#34322803)
Scripts for game logic are officially a non-goal in Bevy.

- Mentioned here by its creator: https://news.ycombinator.com/item?id=24984942

- Here by a team member: https://github.com/bevyengine/bevy/issues/2352

- And here, under "Turtles all the way down", in a roundabout way: https://bevyengine.org/news/introducing-bevy/#why-build-bevy

Re:Fyrox Game Engine 0.29 by tormeh on Tuesday January 10, 2023 @06:16AM (#34323118)
Interesting. Personally I find Rust-only pretty appealing, but people definitely have differing opinions: https://github.com/makspll/bevy_mod_scripting
Re:Fyrox Game Engine 0.29 by ryanackley on Tuesday January 10, 2023 @05:48AM (#34322932)
Dabbled with Rust a few years ago. It was not a true joy coming from the C#, Java, Javascript world because it was comparatively verbose to do similar things. It felt like it was meant to be an improvement on the C development paradigm.
Re:Fyrox Game Engine 0.29 by spoiler on Tuesday January 10, 2023 @07:28AM (#34323800)
At the risk of sounding naggy, I think you could maybe give Rust another go. A lot has improved recently, and depending on how long ago you tried it, maybe even radically. A lot of limitations in the language are now lifted thanks to a smarter compiler (NLLs, GATs, more ergonomic error handling syntaxes, etc)
Re:Fyrox Game Engine 0.29 by pjmlp on Tuesday January 10, 2023 @08:05AM (#34324215)
Still not enough for GUI / graphics coding versus compiled managed languages, including those in the ML family.
Re:Fyrox Game Engine 0.29 by spoiler on Tuesday January 10, 2023 @08:51AM (#34324805)
I agree that the state of GUI in Rust is not quite mature.

As an aside, there's https://github.com/StarArawn/kayak_ui that seems nice, but I've not actually used it, so I can't vouch for it.

Re:Fyrox Game Engine 0.29 by pjmlp on Tuesday January 10, 2023 @08:04AM (#34324202)
I enjoy hobby coding in Rust, however I see its main use case being deployment scenarios where no form of automatic memory management is considered a viable option (tracing GC, RC, mixed RC/GC, ARC, whatever).

Additionally I see a possible future with automatic memory management + linear types for low level coding, like Haskell and Swift are looking into, as more interesting.

The sweet spot of productiviy of automatic memory management, with the control of type system for low level coding, if really needed.

Re:Fyrox Game Engine 0.29 by Ygg2 on Tuesday January 10, 2023 @08:38AM (#34324658)
It depends, I worked on SS14 a bit. A custom C# engine. Versus a Bevy engine in Rust.

And most stuff SS14 devs are trying to enforce in their custom C# engine comes for free in Rust. ECS? Mandatory. Systems can't store state? By design in Bevy - systems are functions. Components need to be ported from class to struct? In Rust you don't have to choose.

That said some issues like faster iteration and sandboxing might make more sense for a C# engine, but so far there wasn't some huge obstacles for developing other kinds of games.

Re:Fyrox Game Engine 0.29 by spoiler on Tuesday January 10, 2023 @07:25AM (#34323761)
Not in any way associated with Fyrox or Bevy, but tried both and read their docs. So, I could answer some of these:

> Would love to hear from others who develop games on how they feel about writing one purely in Rust.

I've only made a few toys/concepts in Bevy and loved it, but there's been a few (two, I think?) Bevy jams with games hosted on itch.io (you can play most of them in the Browser thanks to WASM). I think the consensus in general is that people love the experience, even though it's fairly more lower level than any of the popular alternatives.

> Maybe Rust game engines need to expose their API using a scripting language rather than Rust.

I think this is the plan eventually, just not a priority, since more fundamentals need to be taken care of. Bevy already added some foundational work for scripting, but Bevy has a BYO Scripting Language plugin philosophy. So, you won't be locked into a scripting language of choice when using Bevy