Coder Social home page Coder Social logo

rerun-io / revy Goto Github PK

View Code? Open in Web Editor NEW
308.0 4.0 4.0 59 KB

Proof-of-concept time-travel debugger for the Bevy game engine, built using Rerun.

Home Page: https://www.rerun.io/

License: Apache License 2.0

Rust 100.00%
bevy debugger gamedev rerun tools visualizer

revy's Introduction

Revy

Latest version Documentation MIT Apache

Revy is a proof-of-concept time-travel debugger for the Bevy game engine, built using Rerun.

The general idea is that one would use Revy to investigate gameplay/physics/general-behavior-ish kinds of bugs.
Revy is not a graphics debugger: for that you'd use e.g. RenderDoc.
It is not a performance profiler either: for that, Bevy integrates well with e.g. Tracy.

Revy works by snapshotting diffs of the Bevy database every frame that are then logged into the Rerun database.
This allows you to inspect and visualize the state of the engine at any point in time, either in real-time or after the fact.
These recordings can then be shared to be replayed or e.g. attached to bug reports.

revy.mp4

Examples

Breakout 3D shapes Alien Cake Addict
Live demo Live demo Live demo

โš ๏ธ This is not an official Rerun project. This is a side-experiment meant to explore the possibilities that a tool like Rerun could open when it comes to gamedev. It is not a full-fledged, properly maintained thing -- nor does it aim to be. It's also probably buggy and slow in many ways, and it certainly is full of code abominations ๐Ÿ™ƒ.

Usage

  1. Install the Rerun Viewer (0.14).

  2. Add revy to your dependencies:

    revy = "0.14"  # always matches the rerun version
  3. Initialize the rerun plugin:

    .add_plugins({
        let rec = revy::RecordingStreamBuilder::new("<your_app_name>").spawn().unwrap();
        revy::RerunPlugin { rec }
    })

    This will start a Rerun Viewer in the background and stream the recording data to it.
    Check out the RecordingStreamBuilder docs for other options (saving to file, connecting to a remote viewer, etc).

Custom loggers

Revy will record every components of every single entity (), either using one of the builtin dedicated loggers, or using the generic reflection-based logger.

You can also register your own custom loggers by inserting a RerunComponentLoggers resource:

.insert_resource(revy::RerunComponentLoggers::new([
    (
        "bevy_render::view::visibility::ViewVisibility".into(),
        Some(revy::RerunLogger::new(
            |_world, _all_entities, entity, _component| {
                let suffix = None;

                use revy::external::rerun;
                let data = entity
                    .get::<ViewVisibility>()
                    .map(|vviz| {
                        revy::Aliased::<rerun::components::Text>::new(
                            "ViewVisibility",
                            rerun::components::Text(
                                if vviz.get() { ":)))" } else { ":'(" }.into(),
                            ),
                        )
                    })
                    .map(|data| Box::new(data) as _);

                (suffix, data)
            },
        )),
    ),
]))

Compatibility

Bevy Revy Rerun
0.13 0.14 0.14

revy's People

Contributors

teh-cmc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.