Live data from Hacker News

rg3d: Rust 3D game engine with an FPS demo game and scene editor

github.com

131–140 of 143 posts

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#131
post #47

Earlier quoted context omitted.

Thanks a lot for the kind words!

Is there 2d drawing support, line drawing and other 2d shapes, bezeir curves?

Not yet but there's a project that might be of your interest. It's a rust nanovg clone https://github.com/cytecbg/gpucanvas

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#133
post #43

I have started playing with Bevy [1], so I wonder how this compares from an ECS point of view? I am a beginner at Rust, so any insight would be appreciated. Thanks! Great to see gamedev taking off on Rust! [1] https://bevyengine.org/

Bevy right now has little to show for itself besides a somewhat clean ECS api.

This feels a little harsh. A huge community effort has gathered behind Bevy, and there are a lot of interesting projects that people have made with it so far. Check out the showcase channel of the Bevy discord.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#134
post #110

This project is what I would call data oriented, as discussed yesterday on hn https://news.ycombinator.com/item?id=24506744 . It takes some parts of ECS but the UI is OOP-ish. I wonder if there is a good ECS UI architecture. I have been exploring this lately in Rust, and right now I have settled on jquery style selectors (don't laugh) where you have a generic entity builder and associate a selector (id + class list)…

ECS is also OOP. I guess someone needs to provide examples in Objective-C, Eiffel and CLOS to settle it up.

ECS is not OOP.

In ECS, one system can touch the innards of multiple kinds of components directly, and one kind of component can be touched by multiple systems. Components only hold data and no logic, so in most ECS designs systems will know about the internals of components intimately. This shows a design can ECS-compliant while violating a key part of OOP methodology: encapsulation.

You can use ECS and OOP in tandem by re-introducing encapsulation, as well as any other parts of OOP lost, but you need to be careful not to violate key parts of ECS, such as component not being allowed to have any “logic” (I out logic in quotes because it’s not well-defined: does logic mean ANY code or just... non-boilerplate code?)

One must consider how a codebase will evolve over time, which requires putting yourself in the shoes of those who will be working on the codebase. What benefits does strictly confirming to both ECS and OOP bring? Does the introduction of ECS bring enough structure that the codebase can remain clean, performant, maintainable, portable, etc even without OOP? Is there some kind of hybrid of ECS and OOP where the rules of each are relaxed to create an even better structure? How do all of these potential designs actually look in practice, and is there clear mappings from problems in the problem domain to the philosophical structure being imposed?

In games, it’s hard to map some of the problems to OOP structures (while remaining conformant, clean, performant, maintainable, portable). ECS isn’t perfect, but it’s much better.

I find using C-style, OOP, Actor model, and ECS structuring for different bits of code the best solution. There isn’t a one-size-fits-all when it comes to those things, unfortunately. Though I believe there will be one day (that is: a language arrives which has a model that everything maps to nicely and we’re all happy using and we all say “Wow everything’s so simple now”)

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#135
post #110

Earlier quoted context omitted.

ECS is also OOP. I guess someone needs to provide examples in Objective-C, Eiffel and CLOS to settle it up.

ECS is not OOP. In ECS, one system can touch the innards of multiple kinds of components directly, and one kind of component can be touched by multiple systems. Components only hold data and no logic, so in most ECS designs systems will know about the internals of components intimately. This shows a design can ECS-compliant while violating a key part of OOP methodology: encapsulation. You can use ECS and OOP in tande…

I named Objective-C, Eiffel and CLOS on purpose.

ECS is just game developers discovering about protocols from 1986, made popular in three well known languages with OOP support, and giving other name just because they don't get OOP has many ways of being implemented.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#136
post #107

Earlier quoted context omitted.

Almost fully agree, just the ergonomics are fully there and while static analysis tools aren't fully there, nor ever will, as you well point out, the likes of Google and Microsoft seem quite minded to bring Rust into C++, despite their ongoing adoption of Rust. As the latest posts from Visual C++ seem to imply, https://devblogs.microsoft.com/cppblog/new-safety-rules-in-c... https://cppcon2020.sched.com/event/e7C0/int…

Microsoft, sure--nobody has worked harder than they have to try to make C++ safer. And there are other big companies seriously investing in making C++ safer (e.g. Facebook, bad as they are otherwise). But I've also talked to many of the researchers actually working on these projects--they'll freely tell you how hard the task is and how impossible it is to really apply Rust's straightforward solutions to the massive e…

Google is at least serious on Android with all the mitigations that have been added, inclusive being able to write drivers in Java (as per Project Treble), and it is thanks to them that Linux no longer uses VLAs.

But for example, in spite of using Rust on ChromeOS, Fuchsia and now thinking of introducing Rust on Android 12+, there are no plans to expose it in any of the OS SDKs for userspace applications.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#137
post #108

Earlier quoted context omitted.

Until ISO C++23 papers for pattern matching get accepted.

Why wait?

40 years of IDE tooling, libraries, GUI toolkits, GPGPU designed for its memory model, shader language dialects with graphical debuggers, tier 1 support on the OS SDKs from Sony, Nintendo, Apple, Google, Microsoft, Arm, Samsung, Huawei, certified compilers for industrial deployments, an international standard independent of US sanctions.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#138
post #135

Earlier quoted context omitted.

ECS is not OOP. In ECS, one system can touch the innards of multiple kinds of components directly, and one kind of component can be touched by multiple systems. Components only hold data and no logic, so in most ECS designs systems will know about the internals of components intimately. This shows a design can ECS-compliant while violating a key part of OOP methodology: encapsulation. You can use ECS and OOP in tande…

I named Objective-C, Eiffel and CLOS on purpose. ECS is just game developers discovering about protocols from 1986, made popular in three well known languages with OOP support, and giving other name just because they don't get OOP has many ways of being implemented.

Entities are a collection of component instances and nothing more. Components in ECS are data-only. Systems in ECS are logic-only.

If you follow this strictly, then you cannot support encapsulation or data-hiding. There is no sole definition of OOP, but it is widely accepted that the ability to do encapsulation, including data-hiding, is a key part of OOP.

Therefore, ECS is not OOP. QED

If you’ve not seen the Overwatch team’s talk in which they discuss ECS, I can highly recommend it as a good resource to learn about ECS: https://youtu.be/W3aieHjyNvw

There may be models commonly used in those languages you mentioned that are similar to ECS, but you seem to be implying that ECS is a form of OOP; it is not.

Even if you implemented OOP using Structs of Arrays, a thread per object, or whatever you like, you cannot strictly conform with ECS’s requirement that “components have no logic” while also strictly conforming with OOP’s requirement that “objects should not know about each others’ internals” (object hierarchy).

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#139
post #136

Earlier quoted context omitted.

Microsoft, sure--nobody has worked harder than they have to try to make C++ safer. And there are other big companies seriously investing in making C++ safer (e.g. Facebook, bad as they are otherwise). But I've also talked to many of the researchers actually working on these projects--they'll freely tell you how hard the task is and how impossible it is to really apply Rust's straightforward solutions to the massive e…

Google is at least serious on Android with all the mitigations that have been added, inclusive being able to write drivers in Java (as per Project Treble), and it is thanks to them that Linux no longer uses VLAs. But for example, in spite of using Rust on ChromeOS, Fuchsia and now thinking of introducing Rust on Android 12+, there are no plans to expose it in any of the OS SDKs for userspace applications.

I didn't say Google didn't care about security, just that they have shown almost no interest in static analysis, and have shown a clear preference for runtime mechanisms like sandboxing and garbage collection for memory safety. That's why I find it weird that you're bringing them up here as some sort of leader in C++ static analysis, they very much aren't and have been quite dismissive of related work like verification as well.

I'm also not sure what you mean by "exposing Rust in the userland SDK." Rust doesn't have a stable ABI, how would that even work? It's not like they're exposing system calls as C++ classes or anything like that, either. The choice of programming language for an operating system is, at least from the perspective of API design, mostly an implementation detail.

Re: rg3d: Rust 3D game engine with an FPS demo game and scene editor

#140

Earlier quoted context omitted.

Well, I'm talking from the point of view of a user. Why would I choose this engine over Godot, Unity, Unreal? Just because it's a single-person project?

Who asked you to choose this engine over Godot, Unity or Unreal? And why would others make a choice for you? Such a choice would only be up to you based on your own requirements, nobody else can make that choice. Also this post is really about showing off an engine made in Rust, a "hack" so to speak. You are in Hacker News where people post (usually technical) things that others might find interesting - but not neces…

Perhaps people here should prioritize things that are both valuable and technically impressive. But no, people would rather spend their finite time on useless things.
Post reply on HN