bevyengine/bevy

Bevy is a refreshingly simple data-driven game engine built in Rust

A modular and data focused rust game engine that fast and free for all

What is Bevy?

Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!

WARNING

Bevy is still in the very early stages of development. APIs can and will change (now is the time to make suggestions!). Important features are missing. Documentation is sparse. Please don't build any serious projects in Bevy unless you are prepared to be broken by API changes constantly.

Design Goals

  • Capable: Offer a complete 2D and 3D feature set
  • Simple: Easy for newbies to pick up, but infinitely flexible for power users
  • Data Focused: Data-oriented architecture using the Entity Component System paradigm
  • Modular: Use only what you need. Replace what you don't like
  • Fast: App logic should run quickly, and when possible, in parallel
  • Productive: Changes should compile quickly ... waiting isn't fun

About

  • Features: A quick overview of Bevy's features.
  • News: A development blog that covers our progress, plans and shiny new features.

Docs

  • The Bevy Book: Bevy's official documentation. The best place to start learning Bevy.
  • Bevy Rust API Docs: Bevy's Rust API docs, which are automatically generated from the doc comments in this repo.
  • Official Examples: Bevy's dedicated, runnable examples, which are great for digging into specific concepts.
  • Community-Made Learning Resources: More tutorials, documentation, and examples made by the Bevy community.

Community

Before contributing or participating in discussions with the community, you should familiarize yourself with our **Code of Conduct.

  • Discord: Bevy's official discord server.
  • Reddit: Bevy's official subreddit.
  • GitHub Discussions: The best place for questions about Bevy, answered right here!
  • Bevy Assets: A collection of awesome Bevy projects, tools, plugins and learning materials.

If you'd like to help build Bevy, check out the Contributor's Guide. For simple problems, feel free to open an issue or PR and tackle it yourself!

For more complex architecture decisions and experimental mad science, please open an RFC (Request For Comments) so we can brainstorm together effectively!

Getting Started

We recommend checking out The Bevy Book for a full tutorial.

Follow the Setup guide to ensure your development environment is set up correctly. Once set up, you can quickly try out the examples by cloning this repo and running the following commands:

Fast Compiles

Bevy can be built just fine using default configuration on stable Rust. However for really fast iterative compiles, you should enable the "fast compiles" setup by following the instructions here.

Libraries Used

Bevy is only possible because of the hard work put into these foundational technologies:

  • wgpu: modern / low-level / cross-platform graphics library inspired by Vulkan
  • glam-rs: a simple and fast 3D math library for games and graphics
  • winit: cross-platform window creation and management in Rust
  • spirv-reflect: Reflection API in rust for SPIR-V shader byte code

Bevy Cargo Features

This list outlines the different cargo features supported by Bevy. These allow you to customize the Bevy feature set for your use-case.

Third Party Plugins

Plugins are very welcome to extend Bevy's features. Guidelines are available to help integration and usage.

Thanks and Alternatives

Additionally, we would like to thank the Amethyst, macroquad, coffee, ggez, rg3d, and Piston projects for providing solid examples of game engine development in Rust. If you are looking for a Rust game engine, it is worth considering all of your options. Each engine has different design goals, and some will likely resonate with you more than others.

License

Bevy is free and open source! All code in this repository is dual-licensed under either:

  • MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Issues

Collection of the latest Issues

james7132

james7132

C-Enhancement
Comment Icon0

What problem does this solve or what need does it fill?

More efficient mutation APIs for BufferVec than just push, reserve, and clear. Repeatedly pushing large quantities can be quite inefficient due to needing to repeatedly do size and capacity checks on the underlying Vec.

What solution would you like?

Expose more of the mutation APIs to more efficiently build BufferVecs. Most notably append for grouping chains of Vecs together.

What alternative(s) have you considered?

  • Repeatedly pushing the items onto the BufferVec.
  • DerefMut on the underlying Vec.

Additional context

This would both simplify and speed up the "prepare" stage of rendering of entities with large quantities of mutable values, including but not limited to particle systems and large scale batching.

colepoirier

colepoirier

C-Bug
Comment Icon3

On discord https://discord.com/channels/691052431525675048/749332104487108618/927078698035855420 while working on documenting bevy_assets @manokara noticed Handle::as_weak() takes a type U and wondered if "the handle would be invalid if U is different from T?"

@mockersf noted that "there's one place where that is used to convert a Handle to a Handle," and upon further investigation concluded that "the FontAtlasSet asset storage is handled manually, to have its handles in sync with fonts."

@mockersf said that this is "potentially bad and would require more thinking to improve," so I have created this issue to see what others think of the degree to which this is potentially bad and be a starting point for discussions of how to improve this.

vringar

vringar

C-Enhancement
Comment Icon1

What problem does this solve or what need does it fill?

I want to build a GLTF viewer that shows both the scene as well as the tree structure of a given GLTF scene.

For that to work I need to know which nodes are the basis of a scene. However currently all nodes just get added to the bevy Scene and it is impossible to tell which nodes created that scene. https://github.com/bevyengine/bevy/blob/1d0d8a3397bd6fc2c14d42ffd0668d2443748912/crates/bevy_gltf/src/loader.rs#L283-L294

What solution would you like?

I would like to keep a field scenes_to_node: HashMap<Handle<Scene>, Vec<Handle<GltfNode>>> in the Gltf file that preserves this information.

What alternative(s) have you considered?

I could load the file with the gltf::GLTF struct myself, get the indices of the nodes and then look them up in the nodes field of bevy::gltf::Gltf.

However this would require the program to load the file twice (and likely one time blockingly).

Additional context

I believe the implementation to be fairly trivial. If there is support/acceptance for this feature I'm willing to implement it myself, however I first wanted to reach out here.

tirithen

tirithen

C-Docs
Comment Icon0

How can Bevy's documentation be improved?

Hi! I'm trying to find a way to add a background shader for a 2D project I'm working on.

I'm no shader expert (yet), but the idea is to take in a black and white texture (image file), have it automatically repeat, and then use x, y uniforms to offset the background as the camera pans (top view).

After that the next step would be to tint the texture with colors form uniform data, from a pre-rendered biome 2D ndarray of enums (or converted to int or similar).

The first step is however to render a repeated texture with x y offsets that fills the 2D camera (OrthographicCameraBundle/OrthographicProjection) view.

I feel that I can understand the ECS parts of Bevy fine, those parts are both documented and great work has been put in to keep those APIs intuitive and with low complexity, trying to do custom shaders however, especially when I want them to fill the entire screen it feels like I'm hitting a wall that is to large for me to climb.

Does anyone have any hint on how to do this? I can try to write a guide afterwards for the documentation in return once I can get it working. It is fine with either using the released Bevy 0.5 API, or with the newer development version as I'm at an early stage in the project anyway.

Thankful for any hints on how to do this.

Calamari

Calamari

C-Crash
Comment Icon8

Bevy version

Bevy commit: b532cc9e

Operating system & version

Linux Mint 19.3 Tricia

Rust version

rustc 1.59.0-nightly (78fd0f633 2021-12-29)

What you did

Just run

What you expected to happen

Don't know. Probably a window showing instead of a seg fault.

What actually happened

Additional information

This happens in example and on my test project I build from the bevy book right after the plugin chapter.

If someone can tell me, what I can provide to pinpoint this, I will add what is needed.

alice-i-cecile

alice-i-cecile

C-Docs
Comment Icon1

How can Bevy's documentation be improved?

Simulating user input for use in tests is very important, but it's not always obvious how to do so.

We should document how to do this in two different places:

  1. The root tests directory, as part of an integration test.
  2. In a doc example in each of the input methods.

A user provided the following example for touch input, which should be helpful to get started.

mockersf

mockersf

C-Bug
Comment Icon1

Bevy version

current main d8d3fdf2cfa53c511e8e8156fe1c8a749a20f159

Operating system & version

macOS & webgl2

What you did

Run ui example at different scales

What you expected to happen

Clipping should work the same

What actually happened

Clipping has artefacts at scale greater than 1. They are more visible at the bottom of the list

scale 1: Screenshot 2021-12-30 at 04 09 41

scale 2: Screenshot 2021-12-30 at 04 07 09

scale 3: Screenshot 2021-12-30 at 04 10 51

Additional information

You can add

to the ui example to make it visible

alice-i-cecile

alice-i-cecile

C-Docs
Comment Icon14

Docs are great! However, it's easy to let them atrophy.

As Bevy grows and stabilizes, we want to be able to turn on #![warn(missing_docs)] (which will cause CI to fail if violated). This is helpful because it helpful for new users and contributors, and ensures that our code base's documentation state doesn't regress.

However, not everything is stable or well documented enough to do so already. We should turn this on one crate at a time, once it hits 100% coverage. If there's a crate

Let's check the current doc coverage.

  1. Set the following environment variable (on Windows, I used the $Env: syntax): RUSTDOCFLAGS="-Z unstable-options --show-coverage"
  2. Run cargo +nightly doc --workspace --all-features --no-deps

Run on 2021-12-29: Crate | Docs Coverage

  • bevy_utils | 35%
  • bevy_tasks | 78% (#3509)
  • bevy_derive | 33%
  • bevy_macro_utils | 10%
  • bevy_math | 33% (#3503)
  • bevy_app | 51%
  • bevy_ecs_macros | 10%
  • bevy_dynamic_plugin | 50%
  • bevy_window | 15%
  • bevy_crevice | 100% (Not our problem)
  • bevy_log | 67%
  • bevy_transform | 19%
  • bevy_core | 69%
  • bevy_reflect| 6%
  • bevy_input | 17%
  • bevy_gilrs | 0%
  • bevy_diagnostic | 50%
  • bevy_winit | 16%
  • bevy_audio | 46%
  • bevy_scene | 10%
  • bevy_asset | 26%
  • bevy_core_pipeline | 1.9%
  • bevy_gltf | 22%
  • bevy_sprite | 28%
  • bevy_ecs | 48%
  • bevy_dylib | 100% (warning not yet enabled) (#3515)
  • bevy_text | 16%
  • errors | 66%
  • bevy_internal | 82% (#3514)
  • bevy_pbr | 23%
  • bevy_ui | 1%
  • bevy_render | 34%
djeedai

djeedai

C-Bug
Comment Icon0

Bevy version

HEAD

Operating system & version

All

What you did

Look at code.

What you expected to happen

By analogy with PerspectiveCameraBundle::with_name, and for consistency with either OrthographicCameraBundle::new_2d or OrthographicCameraBundle::new_3d, the OrthographicCameraBundle::with_name should create the same camera as either new_2d or new_3d and only change its name.

What actually happened

The camera created by with_name is an unrelated camera with a different scaling mode from the one of new_3d and a different depth calculation of the one of new_2d.

Additional information

https://github.com/bevyengine/bevy/blob/601cc0cbe3dc73c0db1993184f4ec47783e83884/crates/bevy_render/src/camera/bundle.rs#L139-L161

Versions

Find the latest versions by id

Information - Updated Jan 03, 2022

Stars: 12.6K
Forks: 1.1K
Issues: 833

Repositories & Extras

Rust bindings for libinjection

Add libinjection to dependencies of Cargo

Rust bindings for libinjection

Rust Compiled Templates — ructe

This is my attempt at writing a HTML template system for Rust

Rust Compiled Templates — ructe

Rust bindings for the C++ api of PyTorch

LIghtweight wrapper for pytorch eg libtorch in rust

Rust bindings for the C++ api of PyTorch

Rust leveldb bindings

Almost-complete bindings for leveldb for Rust

Rust leveldb bindings

rust-analyzer is a modular compiler frontend for the Rust language

It also contains some tips &amp; tricks to help you be more productive when using rust-analyzer

rust-analyzer is a modular compiler frontend for the Rust language

Rust-Lightning is a Bitcoin Lightning library written in Rust

lightning, does not handle networking, persistence, or any other I/O

Rust-Lightning is a Bitcoin Lightning library written in Rust

Rust FUSE - Filesystem in Userspace

Rust library crate for easy implementation of Crate documentation

Rust FUSE - Filesystem in Userspace

Rust crate to implement a counterpart to the PBRT book's (3rd edition) C++ code:

Some images of the test scenes are shown below, but you can find more

Rust crate to implement a counterpart to the PBRT book's (3rd edition) C++ code:

Rust Persian Calendar

1** provides functionality for conversion among Persian (Solar Hijri) and Gregorian calendars

Rust Persian Calendar

Rust DjangoHashers

A Rust port of the password primitives used in alternatice implementation: the package library that requires OpenSSL

Rust DjangoHashers

Rust web application

Diesel (ORM) is used to work with the database

Rust web application

Rust bindings for Sciter

this page for other language bindings (Delphi / D / Go /

Rust bindings for Sciter
Facebook Instagram Twitter GitHub Dribbble
Privacy