this post was submitted on 11 Oct 2025
12 points (100.0% liked)

Rust

7520 readers
22 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
 

Hey all, I've been contemplating what approach I should take in my app, think along the lines of mapping with lots of UI elements but also a 2D portal/window for showing the map etc.

I want it to be cross platform so thought I'd go with Egui and look at implementing the "game" parts to that. But as I thought more about it, maybe it would be more beneficial to use Bevy and rely on its UI framework.

Thoughts? Maybe Bevy would be easier, but might be too much of a hit on performance because its not a game that I'm making. Egui might be more difficult to add the game stuff, but more performant and not running a full game engine.

I'm really conflicted. It would be good to be able to turn off/disable the game part of it to reduce load if it isn't needed at the time

you are viewing a single comment's thread
view the rest of the comments
[–] TehPers@beehaw.org 2 points 1 month ago (1 children)

For a graphics-intensive application, this (or something custom with egui).

Bevy also doesn't need to redraw every N milliseconds or anything. You can create a custom game loop and redraw only when needed, whether that's 60fps or only on window event.

There's also no reason a Bevy app couldn't be embedded within a larger application. You can create the Bevy app when needed, render to a render target rather than the window surface, then manually draw that where you need to in your egui app. This also means you can stop the app, or at least the game loop, when it's not needed anymore.

[–] alzymologist@sopuli.xyz 3 points 1 month ago (1 children)

On the other hand, bevy is such a neat general manager and framework. You can run crossplatform parallel async within it, stall things with timers, set custom loop rates. I'm experimenting with using it as non-game frontend, and so far it seems much more suited for fast development than those reactive frameworks imitating js frameworks if something more complicated than simple ui is needed. The gaming community cares for each othes, so sweet. The only downside is 30mb wasm file for prototype level of complexity app, but I haven't even started optimizing yet, and it will not grow much probably once it becomes super sophisticated.

[–] Matty_r@programming.dev 3 points 1 month ago

Sounds like Bevy would be the way to go, I found the bevy_egui crate which seems like it might be what I'm looking for to get started.