• This repository has been archived on 16/Apr/2022
  • Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 4 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Networking plugin for Bevy engine running on naia-socket and turbulence libraries

bevy_networking_turbulence

Networking plugin for Bevy engine running on naia-socket and turbulence libraries.

Combination of naia-socket and turbulence allows for exchange of raw messages over UDP or UDP-like connection (over WebRTC), or building unreliable/reliable channels of structured messages over such UDP/UDP-like messages.

This plugin works both in native (Linux, Windows, MacOS) over UDP packets and in Browser/WASM over UDP-like messages in WebRTC channel.

Still unfinished, but main features are working. For details see Milestones.

Testing

Native

On one terminal run:

$ env RUST_LOG=debug cargo run --example simple -- --server

On other terminal run:

$ env RUST_LOG=debug cargo run --example simple -- --client

Observe PING/PONG exchange between server and client. You can run more clients in more terminals.

WASM

On one terminal run:

$ env RUST_LOG=debug cargo run --example simple --no-default-features --features use-webrtc -- --server

Change IP address in examples/simple.rs / startup() function to point to your local machine, and run:

$ cargo build --example simple --target wasm32-unknown-unknown --no-default-features --features use-webrtc
$ wasm-bindgen --out-dir target --target web target/wasm32-unknown-unknown/debug/examples/simple.wasm

Serve project directory over HTTP. For example (cargo install basic-http-server):

$ basic-http-server .

Open http://127.0.0.1:4000 and watch Browser's console in Developer Tools. You will see the same PING/PONG exchange as in the Native mode.

Channels

On one terminal run:

$ env RUST_LOG=debug cargo run --example channels --features use-udp,bevy/default -- --server

On second terminal run:

$ env RUST_LOG=warn cargo run --example channels --features use-udp,bevy/default -- --client

On third (and fourth, and more...) terminal run:

$ env RUST_LOG=warn cargo run --example channels --features use-udp,bevy/default -- --client

You can focus any of client windows and use Arrow-Left/Arrow-Right cursor keys to change "ball" trajectory. Observe your controlled ball gets synchronized to all other clients.

WASM with Graphics and Channels networking

Due to additional dependencies required, we've decided to keep the browser based graphical channels example in a separate repository. See https://github.com/ostwilkens/arugio project. It evolved a bit from the simple square balls example and may serve as a basis of your game.

client screenshot

More Repositories

1

pebble

Unofficial Pebble watch support for SailfishOS/Jolla
C++
70
star
2

bevy_miniquad

Bevy engine + miniquad render plugin
Rust
38
star
3

qtcreator-themes

29
star
4

rust_roguelike_tutorial

Rust Roguelike Tutorial + Legion ECS + RON prefabs
Rust
21
star
5

bevy_doryen

bevyengine + doryen-rs
Rust
16
star
6

libconcurrency

A lightweight concurrency library for C, featuring symmetric coroutines as the main control flow abstraction.
C
11
star
7

fbv

fbv (FrameBuffer Viewer) is a simple program to view pictures on a Linux framebuffer device
C
10
star
8

brunch-with-dragons

Brunch with Dragons - application starter
LiveScript
8
star
9

jsmn-zig

jsmn JSON parser and serializer in Zig
Zig
6
star
10

wrte

microkernel-like environment to run untrusted applications in browser
JavaScript
4
star
11

qml-parser

Parser for QML (Qt Modeling Language) that allows providing own `import` processing rules.
Rust
3
star
12

jabberd3

jabberd XMPP server - third generation
C
3
star
13

gwg-bindgen

good-web-game + wasm-bindgen example
JavaScript
2
star
14

jabberd14

Original Jabber server
C++
2
star
15

tgt

TGT (TextmodeGUIToolkit) is an object-oriented library, written in C, for creating user interfaces under Linux console
C
2
star
16

rip

REST.Is.Popular - RESTful microframework for Go
Go
2
star
17

mydns-ng

MyDNS-NG is the Next Generation DNS Server for fast and scalable sql based DNS services
C
1
star
18

hecs_rapier

Physics engine for hecs ECS
Rust
1
star
19

wpjabber

Jabberd fork by Wirtualna Polska
C
1
star
20

plp-demo

Product Listing Page demo
JavaScript
1
star
21

traffx

Auto-scaleable XMPP server for The Cloud in Node.js
JavaScript
1
star