From aafeee251f8d15fac102c8bebf0cba6ff8c0804e Mon Sep 17 00:00:00 2001 From: Lucas Poffo Date: Tue, 24 Dec 2024 15:50:48 -0300 Subject: [PATCH] 1.0 Release Some overall README updates --- README.md | 12 ++++++++---- bevy_renet/Cargo.toml | 8 ++++---- bevy_renet/README.md | 5 +++++ demo_bevy/README.md | 14 +++++++++++++- demo_chat/Cargo.toml | 4 ++-- renet/Cargo.toml | 4 ++-- renet_netcode/Cargo.toml | 8 ++++---- renet_steam/Cargo.toml | 6 +++--- renet_visualizer/Cargo.toml | 6 +++--- renetcode/Cargo.toml | 4 ++-- 10 files changed, 46 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index da5d2541..8e62491b 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Renet aims to have a simple API that is easy to integrate with any code base. Po ```rust let mut server = RenetServer::new(ConnectionConfig::default()); -// Setup transport layer +// Setup transport layer using renet_netcode const SERVER_ADDR: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 5000); let socket: UdpSocket = UdpSocket::bind(SERVER_ADDR).unwrap(); let server_config = ServerConfig { @@ -119,7 +119,7 @@ loop { ```rust let mut client = RenetClient::new(ConnectionConfig::default()); -// Setup transport layer +// Setup transport layer using renet_netcode const server_addr: SocketAddr = "127.0.0.1:5000".parse().unwrap(); let socket = UdpSocket::bind("127.0.0.1:0").unwrap(); let current_time = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap(); @@ -156,6 +156,12 @@ loop { } ``` +## Transport Layers + +Checkout [renet_netcode](https://github.com/lucaspoffo/renet/tree/master/renet_netcode) if you want to use UDP with the [netcode](https://github.com/lucaspoffo/renet/tree/master/renetcode) protocol. + +Checkout [renet_steam](https://github.com/lucaspoffo/renet/tree/master/renet_steam) if you want to use the steam transport layer. + ## Demos You can checkout the [echo example](https://github.com/lucaspoffo/renet/blob/master/renet/examples/echo.rs) for a simple usage of the library. Usage: @@ -191,8 +197,6 @@ Simple chat application made with egui to demonstrate how you could handle error Checkout [bevy_renet](https://github.com/lucaspoffo/renet/tree/master/bevy_renet) if you want to use renet as a plugin with the [Bevy engine](https://bevyengine.org/). -Checkout [renet_steam](https://github.com/lucaspoffo/renet/tree/master/renet_steam) if you want to use the steam transport layer instead of the default one. - ## Visualizer Checkout [renet_visualizer](https://github.com/lucaspoffo/renet/tree/master/renet_visualizer) for a egui plugin to plot metrics data from renet clients and servers: diff --git a/bevy_renet/Cargo.toml b/bevy_renet/Cargo.toml index b8dd39a0..d104e01c 100644 --- a/bevy_renet/Cargo.toml +++ b/bevy_renet/Cargo.toml @@ -6,7 +6,7 @@ keywords = ["gamedev", "networking"] license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/lucaspoffo/renet" -version = "0.0.12" +version = "1.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -23,9 +23,9 @@ required-features = ["netcode"] bevy_app = "0.15" bevy_ecs = "0.15" bevy_time = "0.15" -renet = { path="../renet", version = "0.0.16", features = ["bevy"] } -renet_netcode = { path="../renet_netcode", version = "0.0.1", features = ["bevy"], optional = true } -renet_steam = { path="../renet_steam", version = "0.0.2", features = ["bevy"], optional = true } +renet = { path="../renet", version = "1.0.0", features = ["bevy"] } +renet_netcode = { path="../renet_netcode", version = "1.0.0", features = ["bevy"], optional = true } +renet_steam = { path="../renet_steam", version = "1.0.0", features = ["bevy"], optional = true } [dev-dependencies] bevy = {version = "0.15.0", default-features = false, features = ["bevy_core_pipeline", "bevy_render", "bevy_asset", "bevy_pbr", "x11", "tonemapping_luts", "ktx2", "zstd", "bevy_window"]} diff --git a/bevy_renet/README.md b/bevy_renet/README.md index 6cdae076..0d00b253 100644 --- a/bevy_renet/README.md +++ b/bevy_renet/README.md @@ -132,6 +132,7 @@ If you want a more complex example you can checkout the [demo_bevy](https://gith |bevy|bevy_renet| |---|---| +|0.15|1.0| |0.14|0.0.12| |0.13|0.0.11| |0.12|0.0.10| @@ -148,3 +149,7 @@ By default `bevy_renet` uses `renet_netcode` as the transport layer, but you can This adds the transport structs `SteamServerTransport`, `SteamClientTransport` and the bevy plugins `SteamServerPlugin`, `SteamClientPlugin`, the setup should be similar to default transport layer. You can check the [Bevy Demo](https://github.com/lucaspoffo/renet/tree/master/demo_bevy) for how to use the default and steam transport switching between them using feature flags. + +# Custom Schedules + +If you want more control over how renet is run, instead of adding the `RenetServerPlugin`, `RenetClientPlugin`, you can manually setup the functions they implement (they are all public). Make sure to also setup the plugins for the desired Transport layer. diff --git a/demo_bevy/README.md b/demo_bevy/README.md index 6db48a1b..c2ad14f8 100644 --- a/demo_bevy/README.md +++ b/demo_bevy/README.md @@ -4,6 +4,8 @@ Simple bevy application to demonstrates how you could replicate entities and sen [Bevy Demo.webm](https://user-images.githubusercontent.com/35241085/180664609-f8c969e0-d313-45c0-9c04-8a116896d0bd.webm) +## How to run + Running using the netcode transport: - server: `cargo run --bin server --features netcode` @@ -15,4 +17,14 @@ Running using the steam transport: - client: `cargo run --bin client --features steam -- [HOST_STEAM_ID]` - The `HOST_STEAM_ID` is printed in the console when the server is started -You can toogle [renet_visualizer](https://github.com/lucaspoffo/renet/tree/master/renet_visualizer) with `F1` in the client. +## Controls + +Client: + +- AWSD for movement +- Mouse to AIM, left buttom to shoot +- F1 to toogle [renet_visualizer](https://github.com/lucaspoffo/renet/tree/master/renet_visualizer) + +Server: + +- SPACE to spawn a bot that shoots a lot of bullets (stress test) diff --git a/demo_chat/Cargo.toml b/demo_chat/Cargo.toml index e15a35c3..4614a646 100644 --- a/demo_chat/Cargo.toml +++ b/demo_chat/Cargo.toml @@ -11,8 +11,8 @@ edition = "2021" renet = { path = "../renet" } renet_netcode = { path = "../renet_netcode" } renet_visualizer = { path = "../renet_visualizer" } -eframe = "0.29.1" +eframe = "0.29" serde = { version = "1.0", features = ["derive"] } bincode = "1.3" -log = { version = "0.4", features = ["std"] } +log = "0.4.22" env_logger = "0.11" diff --git a/renet/Cargo.toml b/renet/Cargo.toml index 47850265..cd80cf49 100644 --- a/renet/Cargo.toml +++ b/renet/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["gamedev", "networking"] license = "MIT OR Apache-2.0" readme = "../README.md" repository = "https://github.com/lucaspoffo/renet" -version = "0.0.16" +version = "1.0.0" [features] bevy = ["dep:bevy_ecs"] @@ -15,7 +15,7 @@ bevy = ["dep:bevy_ecs"] [dependencies] bevy_ecs = { version = "0.15", optional = true } bytes = "1.1" -log = "0.4.17" +log = "0.4.22" octets = "0.3" [dev-dependencies] diff --git a/renet_netcode/Cargo.toml b/renet_netcode/Cargo.toml index a0814840..7c570ce4 100644 --- a/renet_netcode/Cargo.toml +++ b/renet_netcode/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "renet_netcode" -version = "0.0.1" +version = "1.0.0" edition = "2021" keywords = ["gamedev", "networking", "transport"] description = "netcode transport for the renet crate: Server/Client network library for multiplayer games" @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" bevy = ["dep:bevy_ecs"] [dependencies] -renet = { version = "0.0.16", path = "../renet" } -renetcode = { path = "../renetcode", version = "0.0.12" } +renet = { version = "1.0.0", path = "../renet" } +renetcode = { path = "../renetcode", version = "1.0.0" } bevy_ecs = { version = "0.15", optional = true } -log = "0.4.19" +log = "0.4.22" diff --git a/renet_steam/Cargo.toml b/renet_steam/Cargo.toml index 49dec817..b801ff5c 100644 --- a/renet_steam/Cargo.toml +++ b/renet_steam/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "renet_steam" -version = "0.0.2" +version = "1.0.0" keywords = ["gamedev", "networking", "transport"] description = "steam transport for the renet crate: Server/Client network library for multiplayer games" repository = "https://github.com/lucaspoffo/renet" @@ -14,9 +14,9 @@ edition = "2021" bevy = ["dep:bevy_ecs"] [dependencies] -renet = { version = "0.0.16", path = "../renet" } +renet = { version = "1.0.0", path = "../renet" } steamworks = "0.11" -log = "0.4.19" +log = "0.4.22" bevy_ecs = { version = "0.15", optional = true } [dev-dependencies] diff --git a/renet_visualizer/Cargo.toml b/renet_visualizer/Cargo.toml index df5c8a4b..615d394e 100644 --- a/renet_visualizer/Cargo.toml +++ b/renet_visualizer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "renet_visualizer" -version = "0.0.9" +version = "1.0.0" keywords = ["gamedev", "networking"] description = "Egui metrics visualizer for the renet crate: Server/Client network library for multiplayer games" repository = "https://github.com/lucaspoffo/renet" @@ -13,6 +13,6 @@ edition = "2021" bevy = ["dep:bevy_ecs"] [dependencies] -renet = { path = "../renet", version = "0.0.16" } -egui = "0.29.1" +renet = { path = "../renet", version = "1.0.0" } +egui = "0.29" bevy_ecs = { version = "0.15", optional = true } diff --git a/renetcode/Cargo.toml b/renetcode/Cargo.toml index a131d444..2fc25f06 100644 --- a/renetcode/Cargo.toml +++ b/renetcode/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "renetcode" -version = "0.0.12" +version = "1.0.0" description = "Server/Client network protocol library for multiplayer games" keywords = ["gamedev", "networking", "cryptography"] repository = "https://github.com/lucaspoffo/renet" @@ -12,4 +12,4 @@ edition = "2021" [dependencies] chacha20poly1305 = "0.10.0" -log = "0.4.17" \ No newline at end of file +log = "0.4.22" \ No newline at end of file