A crate for using Bevy with the Godot Engine.

Overview

bevy_godot

A crate for using Bevy with the Godot Engine. This crate is in active development and is not ready for production use.

Features

  • Godot SceneTree integration
  • Detect Godot object collisions
  • Spawn Godot scenes from Bevy
  • Tracing behind the trace and trace_chrome feature flags

Quickstart

Browse the examples to get a feel for the API. The examples are cargo run-able if a godot executable is present in your enviroment path.

For a new Godot project, use one of the examples as a starting point. This crate requires the provided Autoload class to be added to the project's autoloads.

Supported Godot Versions

This library depends on godot-rust for the Godot API and follows their compatibility guidelines.

Comments
  • Allow for ability to handle godot `InputEvent`s

    Allow for ability to handle godot `InputEvent`s

    Hi, I wasn't able to find an nice way to get access to godot InputEvent handles that are normally passed via _input or _unhandled_input in nodes. I went ahead and made a very rough draft (partly as a learning exercise for myself) of getting these into bevy events here: https://github.com/jrockett6/bevy_godot/tree/godot-input-to-bevy-events

    If there already exists a good way to get access to InputEvent information I'd be curious to hear. Otherwise I'd be happy to open up a PR with the above changes and incorporate any feedback (I'm very new to the rust/godot/bevy ecosystem).

    Thanks very much for your awesome library!

    opened by jrockett6 2
  • Using assets will fail on export with path not found

    Using assets will fail on export with path not found

    Bevy's asset server first checks if the file exists at the path and then continues the loading. A workaround is placing an empty file at the paths not found.

    Not sure how we can work around this as we need Bevy's asset server to not care if the file exists because we map the filepath into the Godot res:// paths.

    opened by rand0m-cloud 2
  • feat(input): add support for Godot Input Events

    feat(input): add support for Godot Input Events

    Pass InputEvents that are normally caught in _unhandled_input(input: InputEvent) in Godot into Bevy events, giving us access to the InputEvent information.

    Also adds an associated example.

    Issue #13

    opened by jrockett6 1
  • Dodge the Creeps Example

    Dodge the Creeps Example

    New bevy_godot features:

    • fix(scene_tree): rework scene tree initialization to be correct for startup systems
    • feat: add Godot signals
    • feat(2d): add Transform2D and updating systems
    • fix: move post update godot transform systems to Last
    • feat(2d): removed additional check that prevented 2D collisions from working
    opened by rand0m-cloud 1
  • Improve error message in Godot runner script if the godot executable doesn't exist

    Improve error message in Godot runner script if the godot executable doesn't exist

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', spawn_scene/../run_godot.rs:11:10
    
    opened by rand0m-cloud 0
  • Version 0.2.0

    Version 0.2.0

    BREAKING CHANGES:

    • The Bevy app will update on the visual frame and physics frame. Use of Time's delta may lead to unexpected values when systems are scheduled for the visual frame or physics frame. Consider using the SystemDelta to keep track of your own delta time.

    Features:

    • Update to Bevy 0.8
    • Bevy Assets integration. Assets with a path ending with .tscn, .scn, .tres, and .res will be loaded with Godot's interactive loader
    • Godot scenes can be spawned from an Asset Handle
    • Godot object references can be used as an Asset
    • Full implementation of the Dodge the Creeps example game
    • Systems can be scheduled to only run on the visual frame or physics frame
    • SystemDelta system param to keep track of a system's own delta time
    • Errors rising from the internal NativeClasses will have a source location in the library
    opened by rand0m-cloud 0
  • feat(assets): add assets handling and example

    feat(assets): add assets handling and example

    New bevy_godot features:

    • Catch bevy app panics and prevent re-entry
    • Removed GodotReference type
    • ErasedGodotRef has added bounds to prevent misuse with Godot reference counted types
    opened by rand0m-cloud 0
  • rewrite the scene tree initialization to create the root and emit events for the rest of the tree

    rewrite the scene tree initialization to create the root and emit events for the rest of the tree

    this would unify the code path for creating a Bevy entity from Godot nodes.

    the end user would like a way to query added Godot nodes and also receive the ones found at startup.

    opened by rand0m-cloud 0
  • upgrade bevy to 0.9

    upgrade bevy to 0.9

    to maintain compatibility also upgrade:

    • bevy_asset_loader to 0.14
    • iyes_loopless to 0.9

    migration guide: https://bevyengine.org/learn/book/migration-guides/0.8-0.9/

    I think all code changes fall into one of these categories (copied from migration guide):

    Add #[derive(Resource)] to all types you are using as a resource.
    
    Plugins own their settings. Rework PluginGroup trait.
    
    // Old (Bevy 0.8)
    let dur: Duration = time.time_since_startup();
    let secs: f32 = time.time_since_startup().as_secs_f32();
    let secs: f64 = time.seconds_since_startup();
    
    // New (Bevy 0.9)
    let dur: Duration = time.elapsed();
    let secs: f32 = time.elapsed_seconds();
    let secs: f64 = time.elapsed_seconds_f64();
    
    // Old (0.8)
    commands.spawn()
      .insert_bundle(SomeBundle::default())
      .insert(SomeComponent);
    
    // New (0.9) - Option 1
    commands.spawn_empty().insert((
      SomeBundle::default(),
      SomeComponent,
    ))
    

    Testing

    All examples were ran successfully on my M1 Mac, except for dodge_the_creeps which fails with godot import errors. Though it should be migrated successfully.

    opened by jrockett6 0
Releases(0.3.0)
  • 0.3.0(Oct 25, 2022)

    Deprecated:

    • SystemDelta has been renamed to SystemDeltaTimer to highlight that the delta has to be manually ticked

    Features:

    • Godot's InputEvents are available through the InputEvent and UnhandledInputEvent Bevy events
    • The Bevy app updates on pause to enable pausing of elements like an audio player
    • Added helper methods to SceneTreeRef and GodotResource
    • Added NodeTreeView derive macro for generating views into the Scene Tree
    • Updated to gdnative 0.10.1
    • find_entity_by_name extension trait to search queries of (&Name, T) easier
    • Improved the prelude to include the most common imports
    • Added an error message to the Godot runner script

    Fixes:

    • Fixed crash where a CollisionEvent's origin or target didn't exist
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Aug 20, 2022)

    BREAKING CHANGES:

    • The Bevy app will update on the visual frame and physics frame. Use of Time's delta may lead to unexpected values when systems are scheduled for the visual frame or physics frame. Consider using the SystemDelta to keep track of your own delta time.

    Features:

    • Update to Bevy 0.8
    • Bevy Assets integration. Assets with a path ending with .tscn, .scn, .tres, and .res will be loaded with Godot's interactive loader
    • Godot scenes can be spawned from an Asset Handle
    • Godot object references can be used as an Asset
    • Full implementation of the Dodge the Creeps example game
    • Systems can be scheduled to only run on the visual frame or physics frame
    • SystemDelta system param to keep track of a system's own delta time
    • Errors rising from the internal NativeClasses will have a source location in the library
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jul 26, 2022)

Owner
Abby Bryant
Abby Bryant
Plugin to generate flowfields from tilemaps in the Godot Engine!

Godot Tilemap Flowfields RTS-Style optimized path-finding for crowds of agents. Built for the Godot game engine, written with performance in mind in R

Arne Winter 18 Jan 10, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
A CLI tool to manage your godot-rust projects

ftw A CLI tool to manage your godot-rust project! Table of contents General Information Setup Usage Contact General Information This is a tool to help

Michael Angelo Calimlim 77 Dec 13, 2022
compare gdnative rust based physics against Godot built-in physics

Godot vs. Rapier Rapier is an open source physics framework written in Rust. This project pits godots built-in physics against Rapier. It uses godot-r

Stephan Dilly 75 Nov 17, 2022
A tool to generate inbetweens for animated sprites, written in godot-rust

Bitmapflow is a tool to help you generate inbetweens for animated sprites. In other words, it makes your animations smoother. It uses optical flow to

null 411 Dec 21, 2022
An egui backend for godot-rust

Godot Egui An egui backend for godot-rust. Rationale Godot has a perfectly valid GUI system, so why egui? Here are my personal reasons: Simplicity: No

null 109 Jan 4, 2023
GDDB is a superfast in-memory database designed for use in Godot

GDDB GDDB is a superfast in-memory database designed for use in Godot. This database aims to provide an easy frontend to an efficient in-memory databa

Richard Patching 5 Dec 4, 2022
jlang--godot bridge, built in rust

jlang-rs-gd J is an extremely high-level mathematical notation and programming language. Godot is a game / gui / multimedia engine. jlang-rs-gd lets y

tangentstorm 2 Feb 15, 2022
A Godot 3.4 binding for Live2D

godot-cubism A Godot 3.4 binding for cubism-rs which itself is a binding for the native cubism sdk. Usage var factory = load("path_to_your_native_scri

null 16 Dec 23, 2022
An artisanally made PSD Importer for Godot, written in Rust

PSD Importer for Godot Speed up your import workflow ✨ An artisanally made PSD Importer for Godot 3.5, written in Rust. ✨ Getting Started | ?? Documen

Bram Dingelstad 4 Jan 26, 2023
A direct ecs to low-level server implementation for Godot 4.1

godot_ecs What if Godot 4.1 and Bevy got married? Well, you'd get one interesting duo of data driven goodness. In Development This crate is not produc

null 5 Oct 6, 2023
An extendable system made up of autonomous execution services known as nodes organized in a tree of processes. Inspired by Godot!

NodeTree NodeTree is a framework to create large scalable programs and games through a tree of processes. Each process is fully autonomous and is capa

LunaticWyrm 3 Apr 10, 2024
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Introduction Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions. (hand interaction with boxes missing

Mika 52 Nov 14, 2022
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021
Simple island generator written in rust using bevy engine

Getting Started Easy enough to run cargo run --release Change generation speed Find the system set that looks like this .add_system_set(

Kris 3 Apr 21, 2022
Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine.

Brine Brine is my attempt at writing a Minecraft client in Rust using the Bevy game engine. It's EXTREMELY work-in-progress. The thing that makes Brin

Ben Reeves 34 Dec 26, 2022
Wheeled vehicle simulation using Bevy engine with Rapier's joints

⚠️ Legacy branch! ⚠️ 'master' branch is currently broken due to migration to newer rapier and bevy_rapier so unless you want to compare old and new ve

null 29 Nov 14, 2022
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Gilles Henaux 65 Feb 20, 2023