A simple authoritative server networking library for Bevy.

Overview

Bevy Networking Plugin

version downloads

This is a simple networking plugin for the Bevy game engine. This plugin provides the building blocks which game developers can use to develop online multiplayer games using the authoritative server model.

Currently, this plugin provides full connection life cycle management over UDP.

By default, idle connections are dropped after 5 seconds, but this can be configured by changing the value of a NetworkResource's idle_timeout parameter.

Clients using the ClientPlugin automatically send a heartbeat packet every few seconds to keep the connection alive.

License

See LICENSE.

Comments
  • Add system labels

    Add system labels

    Add labels for the systems, so it's possible to use before and after. For example, if some action has to be done just before the messages are sent.

    server_recv_packet_system and client_recv_packet_system share the same label since I supposed that the client and the server plugins will never be both used at the same time.

    ServerSystem and ClientSystem are enums even if they contains only one element, so they can be easily extended in the future if needed.

    opened by tguichaoua 4
  • implement broadcast events

    implement broadcast events

    A server may want to send a broadcast event to every connected client. This is useful when you want to implement a chat message protocol or to notify other clients when a client has disconnected.

    opened by bacongobbler 2
  • Prepare to update to Bevy 0.6

    Prepare to update to Bevy 0.6

    Bevy 0.6 is not published yet, but it would be great to have a bevy_main branch that tracks the bevy main branch to prepare for the release of 0.6 in coming weeks.

    opened by auderer 1
  • break out into ServerPlugin and ClientPlugin

    break out into ServerPlugin and ClientPlugin

    Certain design decisions are different between how a client and a server handle their communication protocol. For example, a client wants to read incoming messages as soon as possible to update its current game state. A server will want to read all incoming messages at a fixed tick rate, update the game state as quickly as possible, then send out responses or broadcast messages on the next game tick.

    There are other design criteria like the fact that a client needs to send an empty packet (heartbeat) every NetworkTime tick to stay connected, whereas a server does not need to send a heartbeat. This is currently done automatically when the developer adds a auto_heartbeat_system to their game client.

    From a design perspective, it'd be better if a server added a ServerPlugin and a client added a ClientPlugin. That way the separation of concerns is clear: if you're building a server, use ServerPlugin. If you're building a game client, use ClientPlugin.

    opened by bacongobbler 1
  • tcp support

    tcp support

    There should be a way to support TCP connections. At the moment, both the *_recv_packet_system and send_packet_system both rely on a UdpSocket resource being present. We could split this out as a trait:

    pub trait Socket {
        fn recv(&self, &mut [u8]) -> io::Result<(usize, SocketAddr)>;
        fn send(&self, buf: &[u8], addr: SocketAddr) -> io::Result<usize>;
    }
    

    Then use the trait in both systems so that we can swap out a UdpSocket for a TcpListener.

    opened by bacongobbler 0
Releases(0.3.0)
  • 0.3.0(Jan 29, 2022)

  • 0.2.0(Oct 13, 2021)

    This release broke up the NetworkingPlugin into two parts: the ClientPlugin and the ServerPlugin. The ClientPlugin is responsible for connecting to a remote server, sending heartbeat packets every few seconds. The ServerPlugin is responsible for handling connection data as well as incoming messages from clients.

    Both plugins provide a NetworkEvent stream so the developer can send and respond to messages sent from either the client or the server.

    See the examples directory for more information.

    Source code(tar.gz)
    Source code(zip)
Owner
Matthew Fisher
Software Engineer at @microsoft. Core maintainer of the @helm project. Flamboyantly Canadian.
Matthew Fisher
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Gilles Henaux 65 Feb 20, 2023
General purpose client/server networking library written in Rust, built on top of the QUIC protocol which is implemented by quinn

Overview "This library stinks!" ... "Unless you like durian" durian is a client-server networking library built on top of the QUIC protocol which is i

Michael 92 Dec 31, 2022
A cross platform (wasm included) networking library!

bootleg_networking A cross platform (wasm included) networking library! A networking plugin for the Bevy game engine that wraps around bevy_networking

William Batista 51 Jan 1, 2023
A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

null 3 May 8, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
Solana Game Server is a decentralized game server running on Solana, designed for game developers

Solana Game Server* is the first decentralized Game Server (aka web3 game server) designed for game devs. (Think web3 SDK for game developers as a ser

Tardigrade Life Sciences, Inc 16 Dec 1, 2022
A prototype plugin providing a simple line drawing api for bevy.

bevy_debug_lines A prototype plugin providing a simple line drawing api for bevy. See docs.rs for documentation. Expect breakage on master. Click on t

Michael Palmos 92 Dec 31, 2022
Simple RUST game with the Bevy Engine

Simple RUST Game using the Bevy Engine YouTube videos for this code base: Episode 1 - Rust Game Development tutorial from Scratch with Bevy Engine Epi

null 150 Jan 7, 2023
Simple 2d pinball game for testing of bevy and rapier.

Pinball2D Using the Bevy game engine and Rapier physics engine for a simple 2D pinball game. pinball2d.mov Wrote a short piece about how the game was

Gunstein Vatnar 21 Dec 27, 2022
A simple camera for properly displaying tile-based low resolution pixel perfect 2D games in bevy.

Bevy Tiled Camera A simple camera for properly displaying low resolution pixel perfect 2D games in bevy. The camera will adjust the viewport to scale

sark 10 Oct 5, 2022
Simple island generator written in rust using bevy engine

Getting Started Easy enough to run cargo run --release Change generation speed Find the system set that looks like this .add_system_set(

Kris 3 Apr 21, 2022
Bevy is a refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

John Winston 3 Jun 3, 2022
Simple stupid noise primitives for WGSL and Rust (glam/bevy types)

noisy_bevy Simple stupid noise primitives for glam types (Vec2, Vec3) and wgsl. Main motivations are: ergonomic usage with Bevy same results on rust a

Johan Klokkhammer Helsing 10 Dec 10, 2022
A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that wraps around the screen!

Bevy Wrapping Square example A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that

Luciano Mammino 3 Oct 23, 2022
A simple helper for spawning objects in Bevy.

Spew A simple helper for spawning objects in Bevy. Usage First, create an enum that holds objects you might want to spawn: #[derive(Debug, Eq, Partial

Jan Hohenheim 6 Mar 20, 2023
Simple action system for Bevy.

bevy_action Simple action system for Bevy. Introduction This plugin exists mainly to facilitate a common action system for other plugins to hook in to

undersquire 4 Apr 15, 2023