MCPcopy Index your code
hub / github.com/cscorley/bevy_ggrs_rapier_example

github.com/cscorley/bevy_ggrs_rapier_example @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
45 symbols 48 edges 10 files 1 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Bevy GGRS Rapier example

This is my quest to get GGRS and Rapier to work together in the Bevy engine, using the plugins.

Is it perfect? No. But is well-written? Also no.

Hopefully this will serve as a crash course to getting your fun weekend project going.

Things I have going

  • Deterministic physics and rollbacks (allegedly)
  • Desync detection (1v1 only)
  • Plenty poorly strung-together comments
  • And a whole lot of debug learning

Keys

  • WASD movement
  • R turn on random movement for this window
  • T turn off random movement for this window

Running

This demo has no menus other than the debugging inspector. This demo assumes that you will run it twice, which establishes a connection between the two and runs the simulation.

Native

From the root directory:

cargo run

In VS Code, you can also run two of them with (Ctrl|Cmd)+Shift+B, which will run the demo twice.

WASM

From the root directory (requires wasm-server-runner):

cargo run --target wasm32-unknown-unknown --features web

Or, use the wasm.sh script which runs several commands. This will produce an optimized WASM build and launch a test HTTP server (requires wasm-bindgen-cli, binaryen, and simple-http-server).

You will need to launch the demo in two windows. It is recommended to not use tabs to avoid and auto-sleep behavior from your browser.

Testing

  • You can test rollbacks locally
  • On Linux, I use the included slowmode.sh script.
    • Run with root/sudo.
    • Run again to restore.
  • On Windows, I use clumsy https://jagt.github.io/clumsy/

Contributing

Please do! Pull requests are always welcome; and don't be afraid to checkout the Bevy discord for more help.

Core symbols most depended-on inside this repo

Shape

Function 21
Class 14
Method 9
Enum 1

Languages

Rust100%

Modules by API surface

src/physics.rs12 symbols
src/frames.rs7 symbols
src/rollback.rs5 symbols
src/log_plugin.rs4 symbols
src/startup.rs3 symbols
src/spawn.rs3 symbols
src/network.rs3 symbols
src/main.rs3 symbols
src/colliders.rs3 symbols
src/random_movement.rs2 symbols

For agents

$ claude mcp add bevy_ggrs_rapier_example \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page