#multiplayer-game #networking #renet #gamedev #metrics #egui #visualizer

renet_visualizer

Egui metrics visualizer for the renet crate: Server/Client network library for multiplayer games

10 releases (1 stable)

1.0.0 Dec 24, 2024
0.0.9 Jul 20, 2024
0.0.8 Feb 21, 2024
0.0.7 Nov 12, 2023
0.0.2 Jul 25, 2022

#5 in #renet

Download history 42/week @ 2024-09-25 23/week @ 2024-10-02 1/week @ 2024-10-09 5/week @ 2024-10-16 18/week @ 2024-10-23 1/week @ 2024-11-13 1/week @ 2024-11-27 9/week @ 2024-12-04 50/week @ 2024-12-11 65/week @ 2024-12-18 63/week @ 2024-12-25 7/week @ 2025-01-01 10/week @ 2025-01-08

145 downloads per month

MIT/Apache

140KB
2.5K SLoC

Renet Visualizer

Latest version Documentation MIT Apache

A egui metrics visualizer for the renet crate with simple usage.

https://user-images.githubusercontent.com/35241085/175834010-b1eafd77-7ea2-47dc-a915-a399099c7a99.mp4

Usage

Client

let mut visualizer = RenetClientVisualizer::<200>::new(RenetVisualizerStyle::default());
// ..

loop {
    // Update Renet Client
    client.update(delta).unwrap();
    // Add metrics to the visualizer
    visualizer.add_network_info(client.network_info());

    // Draws a new egui window with the metrics
    visualizer.show_window(egui_ctx);

    // ..
}

Server

let mut visualizer = RenetServerVisualizer::<200>::new(RenetVisualizerStyle::default());
// ..

loop {
    // Update Renet Server
    server.update(delta).unwrap();

    // Add/Remove clients from the visualizer
    while let Some(event) = server.get_event() {
        match event {
            ServerEvent::ClientConnected(client_id, user_data) => {
                visualizer.add_client(client_id);
                // ...
            }
            ServerEvent::ClientDisconnected(client_id) => {
                visualizer.remove_client(client_id);
                // ...
            }
        }
    }

    // Add all clients metrics to the visualizer
    visualizer.update(&server);

    // Draws a new egui window with all clients metrics
    visualizer.show_window(egui_ctx);

    // ..
}

Dependencies

~4–13MB
~143K SLoC