News for hackers. Stuff that matters.
Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @05:16PM (#24984647)
Author here. I'm happy to answer any questions you have about Bevy!
Re:Bevy 0.3: game engine built in Rust by benecollyridam on Tuesday November 03, 2020 @06:09PM (#24985083)
In your benchmarks of insertion/add/remove[1] you use different units of time for each of the three graphs. I didn't notice until staring at them for some time wondering what was up. Maybe you could make it clearer or use the same unit?

I think it is an awesome project and I'm looking forward to trying it out soon!

[1]https://bevyengine.org/news/bevy-0-3/#component-insertion-in...

Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:34PM (#24985235)
Sorry my benchmark test suite "fits" the units it reports to the duration. I totally get that its a bit confusing. I probably won't update them for this blog post because generating the graphs isn't fully automated yet (i manually theme the svgs to match the blog style).

But for future releases ill keep that in mind.

Re:Bevy 0.3: game engine built in Rust by msvan on Tuesday November 03, 2020 @06:38PM (#24985264)
It seems like there's a ton of interest in Bevy! You must be spending a lot of time discussing things, reviewing PRs, doing outreach and community building like here. Is there any time left for the hard feature work? Are there any core members apart from you?

(Don't burn out!)

Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:53PM (#24985376)
I'll be honest: the success of the initial release totally blew me away (both in a good way and a bad way). It took me a little over a month to adapt and develop ways to manage all of the threads (prs, community, dev work) without feeling burnt out.

Fortunately I've largely sorted out a workflow that works for my mental health, (i think) works for the community, and still leaves me plenty of time to do dev work. It helps that I can make this my full time job thanks to all of my awesome sponsors.

I am currently the only member of the Bevy organization that can merge prs, but a number of people have stepped up to review prs which helps a lot.

Eventually I do want to grant more people merge rights, but I'm holding off for as long as possible because I think having a single filter that ensures a cohesive vision is valuable.

Re:Bevy 0.3: game engine built in Rust by lewisinc on Tuesday November 03, 2020 @08:55PM (#24985993)
I'd be happy to hear more about this workflow you've set up for yourself. The more I do development work the more I've come to appreciate having a framework to offload mental overhead onto. I don't think I've found one that quite fits me quite yet, but hopefully soon :fingers_crossed:
Re:Bevy 0.3: game engine built in Rust by sigy on Tuesday November 03, 2020 @11:13PM (#24986403)
I want to second the request to learn more about your workflow. I shepherd OSS projects in addition to dev work, and striking a balance between outreach, admin, and getting things done is always a challenge.
Re:Bevy 0.3: game engine built in Rust by feiss on Tuesday November 03, 2020 @06:05PM (#24985058)
Hi! I just wanted to say that the sub-asset loading feature is really neat! Beautiful way to handle that use case. One question: if you load two sub-assets from the same gltf, is the gltf cached or loaded twice?
Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:07PM (#24985076)
Thanks! It is cached. It will only reload if the asset hasnt been loaded yet or was previously freed.
Re:Bevy 0.3: game engine built in Rust by Vermeulen on Tuesday November 03, 2020 @05:31PM (#24984780)
Any plans for scripting/logic other than Rust? I can't imagine it working well to quickly iterative on gameplay
Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @05:48PM (#24984942)
Rust isn't inherently slow to iterate, its just easy to write code that compiles slowly if you aren't careful. One of Bevy's primary focuses is to have fast iterative compile times. Changes to our examples can be recompiled in ~0.8-3 seconds (according to your hardware, os, and linker). We have a "fast compiles" configuration that works quite well.

First we do plan on exposing hooks to allow scripting languages to be plugged in to Bevy. We actually already have a pull request out for that.

However my default answer to the scripting question is that it is a non-goal for Bevy, and is in fact maybe even an anti-feature. I want Rust to be the "one language" people use to build Bevy games. I think a cohesive ecosystem is an incredibly important part of an engine's success. If half of Bevy devs use rust and the other half use C#, then compatibility and interop become a huge problem. The Rust language choice does set a high bar, but Bevy doesn't need to be all things to all people. Additionally, the Bevy API is a Rust API. Defining FFI on top means we need a second api surface that is the "lowest common denominator" (aka a C api). This both increases maintenance burden and creates the "rust experience" and the "everyone else" experience.

In the near future 3rd party Bevy scripting plugins will start popping up, but I doubt I will ever officially endorse them.

Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @05:55PM (#24984996)
I also think on of the major selling points of Bevy is that "bevy game devs" are actually "bevy engine devs" ... they just don't know it yet. Bevy is implemented using the same plugin interface that games use, which blurs the line between engine code and game code.

Adding scripting languages into the mix removes this benefit and cuts down on the number of people capable of contributing back to the engine.

Re:Bevy 0.3: game engine built in Rust by nahuel0x on Tuesday November 03, 2020 @06:00PM (#24985027)
what about using rust for scripting but compiled to wasm, so beavy can (hot-re)load wasm modules?
Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:06PM (#24985069)
thats a scenario im definitely thinking about :)
Re:Bevy 0.3: game engine built in Rust by reitzensteinm on Tuesday November 03, 2020 @11:30PM (#24986457)
Can you easily serialize/deserialize the game state with your ECS system? I haven't looked closely at it.

If it were possible, your iteration times could be ridiculously low. Play the game until the bossfight you're iterating on. Dump it out to disk. Edit the code, recompile and run from saved state in a couple of seconds? That sounds amazing.

Unity has pretty good edit and continue for simple stuff, but it quickly falls apart once you start doing non trivial things.

Re:Bevy 0.3: game engine built in Rust by vlmutolo on Wednesday November 04, 2020 @01:27AM (#24986794)
Not sure about bevy specifically, but I know the rapier physics engine (which integrates with bevy) can serialize all of the physics state.

Plus, in Rust, if you mark types as Serialize you can serialize nearly anything you want. And it seems like Bevy makes full use of the powerful Rust type system.

So I’d guess “yes, you can probably easily serialize the game state in most cases”.

Re:Bevy 0.3: game engine built in Rust by reitzensteinm on Wednesday November 04, 2020 @02:02AM (#24986929)
To do edit and continue with it you're really going to want full serialization, so if you eg model events as a closure instead of plain data, you're toast (coming from an outsider's perspective).

If the base engine supplies you with full serialization support for the inbuilt features and a list of rules to follow to maintain it, you're golden.

Re:Bevy 0.3: game engine built in Rust by Danieru on Tuesday November 03, 2020 @10:54PM (#24986345)
Wow you've got some good engine design sense. Have you by chance shipped a commercial game before? Most open source engines lak such concrete experience and sense.
Re:Bevy 0.3: game engine built in Rust by gameswithgo on Tuesday November 03, 2020 @05:37PM (#24984838)
The developers of EVE Online had this same thought, about C++, so they used python as the gameplay scripting language. A few years later faced with unsolveable performance issues with large scale battles they had to resort to slowing down time by a factor of 4, during large scale battles.

Just a single anecdote but can be important to keep in mind. As well, some types of scripting languages can have their own productivity problems as projects get large. Lack of types making code hard to follow, bugs harder to track down, refactors riskier etc.

Re:Bevy 0.3: game engine built in Rust by pjmlp on Wednesday November 04, 2020 @02:08AM (#24986967)
The difference is that Rust is still quite far to support the dynamic capabilities and code reloading of C++.
Re:Bevy 0.3: game engine built in Rust by gameswithgo on Wednesday November 04, 2020 @03:29PM (#24992754)
People have been doing hot code reloading with rust for years now. I'm not sure what are all the pros/cons and limitations with each today. I wouldn't think there are fundamental differences.
Re:Bevy 0.3: game engine built in Rust by ww520 on Tuesday November 03, 2020 @06:22PM (#24985173)
Kudos for building a game engine, especially in Rust.

What was the machine's spec to run the benchmark on the ECS? I don't mean to pour rain on the parade, but 1 millisecond to retrieve a component looks really slow. Was it mislabeled as in 1 microsecond? For a game with a 1000 entities, there would mean one whole second to process one component of all the entities.

Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:23PM (#24985182)
I think you missed the part where we run the test 100,000 times per iteration. I promise its really fast :)

edit: but i do agree that the title is a bit unclear. ill fix that now

Re:Bevy 0.3: game engine built in Rust by ww520 on Tuesday November 03, 2020 @06:33PM (#24985231)
Ah I see. Didn't see the 100K runs in the paragraphs below. That's more reasonable. Good job.
Re:Bevy 0.3: game engine built in Rust by ffhhj on Tuesday November 03, 2020 @05:55PM (#24984993)
Great work! I have developed games in several game engines, but I'm new to Rust. Can it run inside a WebView and communicate with Java (Android) thru a JS interface? That would be awesome.
Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:09PM (#24985084)
It should be able to run in a webview via WASM, but im less certain about the java communication part. If its a normal JS interface then you can probably do it.
Re:Bevy 0.3: game engine built in Rust by k__ on Tuesday November 03, 2020 @06:08PM (#24985077)
Does it have any graphical editors?
Re:Bevy 0.3: game engine built in Rust by _cart on Tuesday November 03, 2020 @06:16PM (#24985131)
Not yet, but it's one of our current focus areas: https://github.com/bevyengine/bevy/issues/254
Re:Bevy 0.3: game engine built in Rust by kiliancs on Tuesday November 03, 2020 @05:46PM (#24984923)
I enjoyed reading this release announcement. Thanks for all the details.