• Stars
    star
    1,173
  • Rank 39,852 (Top 0.8 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 2 years ago
  • Updated 5 months ago

Reviews

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

Repository Details

Radically simple multiplayer / networked WebAssembly

WARNING

This library is incredibly new. I value building in public so I'm making Tangle available very early. As a result Tangle has major bugs, TODOs, and known issues. The library is not stable: it will change constantly! Give it a try, be patient, and consider contributing!

Tangle

Tangle is a library that aims to make multiplayer apps and games far easier to build.

Tangle 'magically' wraps WebAssembly so you can write programs without worrying about message passing, serialization, or consensus.

Play with a live demo: 1500x500

Check out the examples to get started!

Questions

What is this for?

Tangle is a great fit for small games and apps that want to add multiplayer. In the future it may be useful for all sorts of things including (but not limited to): syncing programs between servers / clients, untrusted plugins in networked software, 'metaverse'-like scripting, and backend-less collaborative software.

Does this use WebSockets or WebRTC?

Under the hood Tangle uses peer to peer WebRTC connections. This may change!

How is this hosted?

Connections are peer to peer but the initial connection needs to be facilitated by a central server. Right now I run a free instance of that server but if it gets serious traffic I may offer a paid version.

How does it work?

Tangle syncs initial state and networks all subsequent inputs that could cause simulations to diverge. Tangle keeps every bit identical between all connected Wasm instances. 'Snapshots' are taken at each simulation step to enable 'rewinding' and 'replaying' events to ensure all peers apply events in the same order, without adding latency to user input.

TODO: Write a more detailed explainer.

What are its limitations?

Due to how rollback works frequently updated programs will have increased input latency if they do not keep CPU and memory usage low. This is an area that will see future improvement.

Tangle does nothing to merge long stretches of offline editing. It is not a CRDT.

What languages does this support?

In theory: Any language that targets WebAssembly. In practice I've only tested AssemblyScript and Rust.

Is this web only?

Right now Tangle is implemented as a TypeScript library for web but its fundamental architecture could eventually be made to work on native platforms.

More Repositories

1

koi

A game engine.
Rust
139
star
2

devserver

A simple HTTPS server for local development. Implemented in Rust.
Rust
95
star
3

LD46

An entry to Ludum Dare 46, written with Rust for Web
Rust
72
star
4

kapp

A pure Rust window and input library for Windows, Mac, and Web. (Work in progress)
Rust
56
star
5

open_world_game

Just a quick terrain generation experiment.
Rust
44
star
6

Bloom3D

A public issue tracker for Bloom3D.com
34
star
7

kudo

An Entity Component System for Rust. Fast, easy, and predictable. (Work in progress)
Rust
19
star
8

hello_triangle_wasm_rust

A zero-dependency 'hello triangle' sample that uses Rust, Wasm, and WebGL.
Rust
13
star
9

sprinkles

A tiny game engine for a blog post
HTML
5
star
10

Experiments

My own personal repository to store game development experiments not yet worthy of their own repository. Code is incomplete, broken, or bad, use at your own risk!
C#
5
star
11

wasm_set_stack_pointer

Expose a function from Rust WebAssembly that allows the host to set the stack pointer
Rust
3
star
12

tangle_website

Rust
3
star
13

minimal_uefi

A minimal Rust project to get started with UEFI
Shell
2
star
14

wasm_guardian

Rust
2
star
15

NoahsDilemma

A game for Ludum Dare 42. The theme is "Running out of space"
C#
2
star
16

LD48

An entry to Ludum Dare 48
Rust
2
star
17

kcolor

A Rust library for handling color in interactive applications (Work in progress)
Rust
2
star
18

LD50

Work-in-progress Ludum Dare entry
Rust
1
star
19

kgltf

glTF loader / saver for Rust
Rust
1
star
20

kui

UI toolkit experiments.
Rust
1
star
21

pacifickernel

A minimalist x86-64 C kernel.
C
1
star
22

kaudio

Unusable work in progress. An audio callback library for Rust. (Windows only)
Rust
1
star
23

rust_ecs

A test of writing an ECS using generic associated types. Unfinished
Rust
1
star