• tyleo 2 days ago

    I really want to like bevy but compile times are slow and the output binaries are huge.

    I built a few games in WASM and was shocked to see many of the bevy variants larger than the Unity versions.

    There’s definitely a market for rust game engines but it seems that no one’s hit the sweet spot yet.

    • reitzensteinm 2 days ago

      Compile times are my biggest struggle, too. I'm vibecoding Bevy with parallel agents, and the bottleneck is often compiling the changes on my 7950X, not getting Codex to write them.

      As far as file sizes go, I'd be really interested in how a Rust compiler that didn't monomorphize so much would perform. Right now you have to modify the source code to write polymorphic generic functions, but it doesn't strictly have to be that way (at least as far as I can see).

      I wouldn't use Bevy for a web only game either, especially while it's still single threaded on WASM.

      • 0x1ceb00da 2 days ago

        Bevy website has some tips for improving compile times, have you tried them out?

        • reitzensteinm 2 days ago

          Yes, absolutely. I did that before vibecoding too, as rapidly editing and testing is so crucial.

          The way Bevy's internal state is so easily saved and loaded is convenient for this.

      • alfiedotwtf 2 days ago

        I hear Rust being slow to compile is their biggest gripe, but really - look at what you’re gaining for the slowdown!

        Bevy gives you a very nice ECS to model your app but compilation can be slower than hand crafted code, while not using it gives you tonnes more code and the complexities that come with it, just to compile faster?

        • tyleo 2 days ago

          I don’t know what you mean by, “just to compile faster.” Compiling fast is critical to game development. There’s no formula for fun so you have to iterate extensively.

          I also don’t think that other solutions are “tonnes more code.” Any code will explode in size if poorly written. The same is true for bevy.

          • NewsaHackO 2 days ago

            I swear I have only heard about ECS and people trying to show off how good the ECS is when it comes to Bevy, never about an actual game.

            • polski-g 2 days ago

              "There are more rust game engines than rust games" - Confucius

              • Ygg2 a day ago

                "The claim which is made without proof can be dismissed without proof" - Big Brain

          • CyberDildonics 2 days ago

            Bevy gives you a very nice ECS

            That's a single data structure. People say binaries start at 50 MB for a hello world program and 700 MB for the debug binaries.

            https://old.reddit.com/r/bevy/comments/16wcixk/cant_figure_o...

            • saghm 2 days ago

              It's a single data structure that contains your entire game though? The whole point of the ECS is that literally everything uses the same data; it's like if you modeled every object in the world with one struct that has an optional field for every piece of data that could exist. I'm not saying that necessarily makes the tradeoff worthwhile, but calling it a "single data structure" is a bit reductive.

              • CyberDildonics 2 days ago

                It's a single data structure that contains your entire game though?

                Are you asking?

                but calling it a "single data structure" is a bit reductive.

                No it isn't. It's like a tiny database. Depending on how someone implements it, it could use arrays, hash maps and b-trees. There is no universe where this means a binary that does nothing should be 50 megabytes.

                • fluffybucktsnek 2 days ago

                  > It's like a tiny database.

                  No it isn't. It also handles system management and concurrency, basically the main loop of your application.

                  I also would be cautious of assigning the blame of the binary size onto the data structure on its own.

                  • alfiedotwtf a day ago

                    I would say yes it’s like a tiny database but as well as all the other things your added. And I think that’s a good thing, because it does this at the type level!

                    I’m actually seeing if I can build a parser using bevy_ecs just because the way their state machine works, it looks like it would be fun

                    • CyberDildonics 2 days ago

                      system management

                      What does that mean?

                      concurrency

                      Some data structures and databases deal with concurrency.

                      • nkrisc 2 days ago

                        In this case systems are the S of ECS and contain all your game logic, acting upon the entities and components (E and C).

                        By system management I assume they mean the APIs bevy offers for scheduling and sequencing systems and events so your game logic remains modularized while still running in the correct order.

                        • CyberDildonics a day ago

                          It seems like you're calling an entire game engine "ECS". I'm not sure what the point is here, the whole question was what justifies having a 50 MB hello world binary. It doesn't matter what you put into a data structure, the data structure itself shouldn't make 50 MB binaries.

                          • fluffybucktsnek 21 hours ago

                            No, they aren't calling the entire game engine "ECS". Entity-Component-System is an architecture that Bevy is structured around.

                            As I have previously stated, I wouldn't blame the data structures used behind Bevy just yet, given Rust's tendency for making bloated binaries. What is taking the most space in this 50MB binary? How does it scale with the complexity of the application?

                            • CyberDildonics 12 hours ago

                              Even if you can put a function pointer into a data structure, that's still just a data structure.

                              • fluffybucktsnek 9 hours ago

                                I don't know where you are trying to go with this logic. You still haven't assured that the 50MB is actually related to data structures used behind by bevy, lest you are insunating that the data structures used by bevy are solely responsible for that size, which is not what the post claims.

                          • fluffybucktsnek 2 days ago

                            Exactly this.

            • vivzkestrel 2 days ago

              - since we are on the topic, i wanted to ask people here

              - could someone kindly share some resources on c++ game development

              - here is what i have

              - https://gamedev.net/tutorials/

              - https://shader-learning.com/

              - https://learnopengl.com/

              - https://shaderacademy.com/

              - https://www.gabrielgambetta.com/client-server-game-architect...

              - https://github.com/0xFA11/MultiplayerNetworkingResources

              - just a headsup, i am looking for 3D game development without unreal, unity , godot or any of those engines

            • michaelteter 2 days ago

              Those of us unfamiliar with Bevy can deduce what it might be, but it would be really nice if your introduction included at least a link titled "Bevy game engine" which links to bevy.org.

              Then your unfamiliar readers can first hop to bevy.org to see what it's all about.

              • GenericCanadian 2 days ago

                Very much agreed and appreciated. I've added an explanation to the top of the homepage.

              • nextaccountic 2 days ago

                > These guides are up to date with Bevy version 0.18

                This is huge, thanks. Unfortunately many Bevy resources became stale (the Bevy cookbook was even abandoned, there was little interest in keeping it up to date and so there were many sections for, say, Bevy 0.12)

                • reitzensteinm 2 days ago

                  This site is excellent. I emailed the author to thank them after reading it cover to cover, and they replied and asked if anything was unclear or if there was anything I wanted to see explored more.

                  Quite the dedication to a free resource!

                  • roflcopter69 2 days ago

                    There's also ongoing work on the (for now hidden) Bevy Book https://bevy.org/learn/book/intro/

                    Already seems like a great resource to me but it's still WIP.

                    • Based-A 2 days ago

                      As someone who is actively working on the Bevy Book, the next engine release should include the first public release of the Bevy Book. And once it's out, then we'll be doing our best to keep it updated and expand it alongside the Bevy engine.

                      • dannersy 2 days ago

                        This is great news and thank you for work.

                        • Tade0 2 days ago

                          Great news, thanks. I have to say that several times I tried to invent something from scratch only to eventually find, reading the documentation/examples, that Bevy already has that part covered.

                          I now default to the examples, but a book would greatly help.

                      • jvuygbbkuurx 2 days ago

                        My problem with bevy isn't the basics, but the architecture. I always feel like I'm making wrong decisions on if something should be a component or a field, and how it interacts with other stuff in systems. I just feel like I'm making an unmaintainable mess, but I'm not sure how it could be improved.

                        • GenericCanadian 2 days ago

                          I think ECS is a new enough architecture that the patterns are still very much folk lore.

                          I think a lot of the way I try and structure my Bevy apps comes down to trying to separate the rendering from my game logic. Its very easy to confuse the two responsibilities.

                          Coming from the web and Ruby I find the lack of automated testing and TDD to be foreign to me. So I've been trying to figure out patterns that make my games easier to test. Hoping to write about it soon.

                          • ukoki a day ago

                            > lack of automated testing and TDD

                            Rust has testing in the standard library -- IMHO Bevy is far easier to test than most game engines because it's "just rust". You can test game logic by starting headless apps, proding the ECS, and making assertions on the results.

                            For acceptance tests I've dusted off cucumber (after ten years of not thinking about BDD), as I it works great with Bevy

                            • EddieRingle 2 days ago

                              > I think ECS is a new enough architecture that the patterns are still very much folk lore.

                              ECS is a pretty old idea, built on concepts that are even older. I was playing around with an ECS-like engine of my own in C over 10 years ago, based on blog posts and talks that are now 20-25 years old. Even the Wikipedia article for ECS can trace the origins back to the 1960s. (Though obviously it hasn't been applied to video games for quite that long.)

                              Nowadays I'd probably reach for Godot and Kotlin if I just wanted to build a game in an ergonomic language on a solid foundation. You could still apply ECS concepts there, as well.

                            • bigbadfeline 2 days ago

                              > I always feel like I'm making wrong decisions on if something should be a component or a field... I just feel like I'm making an unmaintainable mess,

                              That is true for all game platforms, experience takes care of it, don't give up.

                              About compilation time concerns, it doesn't seem to be a problem with Bevy, there's a fast compile mode with very reasonable performance.

                              However, I didn't see any scripting, there are scripting options for rust, it would be good to have bindings for some rust-like scripting.

                            • Ugvx 2 days ago

                              This has been on my list to kick off for a while. From previous times I looked at it, these tutorials are the only text based tutorials that are really kept up to date. Love it

                              • jippo 2 days ago

                                Thank you. Not many free and in-depth resource for Bevy engine. Mostly are paid ones. I am surprised that you switch from Ruby to Rust. Seems a different beast to me.

                                • jaggederest 2 days ago

                                  As a long time ruby enjoyer and now also rust enjoyer, the core syntax and systems of rust are very rubyesque in a lot of ways, you can tell that some of the core contributors liked the language.

                                  • nextaccountic 2 days ago

                                    yeah ruby API ideas and the _why poignant guide specifically, they were very influential in programming in general. a number of early rust devs came from ruby as well. all original authors of cargo worked on ruby's bundler earlier. etc

                                    • IshKebab 2 days ago

                                      Really? What do you think comes from Ruby? Rust mostly seems to be inspired by ML and C++.

                                      Actually I just checked the "official" list and they only list the closure syntax which seems pretty minor:

                                      https://doc.rust-lang.org/reference/influences.html

                                      • jaggederest 2 days ago

                                        Iterator style, chaining, traits, blocks all feel very rubyesque, and expression syntax as well, plus the cargo toolchain is very bundler-informed.

                                        • littlestymaar 2 days ago

                                          A significant portion of the prominent community members come from Ruby so I guess there must be something …

                                          • leafario2 2 days ago

                                            Expression orientation

                                            • IshKebab 2 days ago

                                              That's from functional programming.

                                              • saghm 2 days ago

                                                I don't think anyone claimed that Ruby and Rust were the only two languages with those features, just that they're something they both have in common.

                                                • IshKebab 2 days ago

                                                  The claim is that Rust took espression-orientation from Ruby. That's unlikely - it is much more inspired by FP languages which are also expression oriented.

                                                  • saghm 15 hours ago

                                                    Ah, you're right, I definitely misread that the first time. I think the only thing that Rust probably was directly inspired by Ruby on was the syntax for closures (which is not exactly the same, but when the closure uses a block rather than returning an expression directly it's similar, and I vaguely recall seeing something about that being intentional).

                                        • nextaccountic 2 days ago

                                          > Mostly are paid ones.

                                          can someone link to some of those paid resources?

                                          • GenericCanadian 2 days ago

                                            I think Chris Biscardi has some paid resources that involve Bevy at https://www.rustadventure.dev/pricing they might be referring to.

                                            He's also got plenty of free resources which I love to watch: https://www.youtube.com/@chrisbiscardi

                                            • ramon156 6 hours ago

                                              To be fair, Chris is the guy for bevy. He's been making videos long enough to know how to use it properly

                                          • sivakon 2 days ago

                                            can you tell me what those paid ones are?

                                          • SilentM68 2 days ago

                                            Thank you :)

                                            • undefined 2 days ago
                                              [deleted]