Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goktug97/bevy_modding_experiment
A simple approach to add modding to a Bevy game
https://github.com/goktug97/bevy_modding_experiment
bevy game-development gamedev rust
Last synced: 4 days ago
JSON representation
A simple approach to add modding to a Bevy game
- Host: GitHub
- URL: https://github.com/goktug97/bevy_modding_experiment
- Owner: goktug97
- Created: 2024-06-01T13:12:48.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-01T20:00:55.000Z (7 months ago)
- Last Synced: 2024-10-31T23:06:31.091Z (about 2 months ago)
- Topics: bevy, game-development, gamedev, rust
- Language: Rust
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bevy Modding Experiment
This project demonstrates a simple approach to adding modding capabilities to a Bevy game, inspired by [bevy_dynamic_plugin](https://docs.rs/bevy_dynamic_plugin/latest/bevy_dynamic_plugin/index.html).
## Limitations
- Both the main application and plugins must use the same Bevy version and dynamically link Bevy using the `bevy/dynamic_linking` feature.
- Components intended for use by plugins must reside in a separate dynamic library (dylib) crate and should not be subdirectory of the main application (?).
- No WASM
- Unsafe Code## Getting Started
To run the project, follow these steps:
```bash
git clone https://github.com/goktug97/bevy_modding_experiment
cd bevy_modding_experiment/plugin
cargo build --release
cd ../bevy_modding
cargo run --release
```## How It Works
- **Main Application:** The core application initializes a scene featuring a camera and a stationary circle. It dynamically loads the plugin shared library using [libloading](https://docs.rs/libloading/latest/libloading/). Then it calls the `setup` function, passing a mutable reference to the `App` instance (`&mut App`). This function is a required implementation within the plugin.
- **Plugin:** The plugin is responsible for implementing the `setup` function. In this example, the plugin adds a system to move the circle.