Skip to content

Bentlybro/BAS-Multiplayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BAS Multiplayer (SpacetimeDB)

Experimental multiplayer for Blade & Sorcery (PCVR), backed by SpacetimeDB.

See each other as full-body avatars, fight the same enemies, sync your weapons, and hit each other — over the internet, with no port forwarding, no IP sharing, no dedicated server setup.

⚠️ Early and experimental. Built for B&S 1.2.1.x on PCVR (Steam). Not compatible with Nomad (Quest standalone).

What works

  • Sessions — host a public session from the in-game mod menu; friends hit Join and their game automatically loads whatever level you're in (and follows when you change maps)
  • Full-body avatars — real player-model bodies driven by each player's actual VR head and hand movement through the game's own ragdoll IK, with walking locomotion, bodies that turn to face where you look, and Steam-name tags
  • Item sync — grab any item and everyone sees it in your hand, tracking your swings exactly; throws and drops hand off to physics on every client
  • Co-op enemies — the host's NPCs are replicated to everyone (position, health, death), and members' hits relay back and genuinely damage them. Convention: only the host starts waves.
  • PvP — hitting another player's avatar damages the real player
  • Downed instead of dead — in a session, lethal damage downs you (red [DOWNED] name tag) and auto-revives you after ~8s, keeping everyone out of the desync-prone vanilla death menu

Known limitations

  • Enemy puppets on the joiner's screen don't visually swing their weapons yet (damage still works)
  • Two players grabbing the same item simultaneously: last grab wins
  • No spells/imbue sync yet; no session browser UI (join picks the first public session)

Install (players)

  1. Get the mod files (BASMultiplayer.dll, SpacetimeDB.ClientSDK.dll, SpacetimeDB.BSATN.Runtime.dll, manifest.json) from a release or build them (below).
  2. Put them in a folder at: <Blade & Sorcery>\BladeAndSorcery_Data\StreamingAssets\Mods\BASMultiplayer\ (note: inside BladeAndSorcery_Data\StreamingAssets\Mods, not a Mods folder next to the exe)
  3. Launch the game and allow scripted mods if prompted.
  4. Verify: Mods → My Mods → "BAS Multiplayer (SpacetimeDB)" with no error.

To play: the host loads into a map and turns on Mod Options → BAS Multiplayer → Multiplayer → Host Session. Everyone else turns on Join Session — their game loads the host's level automatically.

Repo layout

src/            C# client mod (ThunderScript DLL loaded by the game)
  Net/          SpacetimeDB connection, generated bindings, net-id registry
  Sync/         avatars, items, creatures, sessions, health — the replication logic
server/         SpacetimeDB server module (Rust): tables + reducers
tools/FakeClient/  headless fake player for solo testing (orbits you, can hold an item)
PLAN.txt        architecture notes, findings from the game-code survey, roadmap

Building from source

Prereqs: .NET SDK 8+, and for the server Rust + the SpacetimeDB CLI.

# client mod (set <GameDir> in src/BASMultiplayer.csproj if your install path differs)
cd src && dotnet build -c Release
# output: bin/Release/{BASMultiplayer,SpacetimeDB.ClientSDK,SpacetimeDB.BSATN.Runtime}.dll

# server module — publish your own instance, then point src/Net/Config.cs at it
cd server && spacetime publish -s maincloud <your-module-name>
# after ANY server schema change, regenerate the client bindings:
spacetime generate --lang csharp --out-dir ../src/Net/Generated --module-path .

Solo testing without a second headset:

cd tools/FakeClient
dotnet run -c Release                              # fake player orbits you
dotnet run -c Release --item SwordShortCommon      # ...holding a synced sword

How it works (short version)

SpacetimeDB hosts the entire backend as one database module: tables (player, session, net_item, net_creature) plus reducers. Clients subscribe and get row deltas — the "lobby server", state sync, and RPC layer are all just database operations, which is why there's no server code beyond the schema.

The interesting VR bit: player bodies are not synced bone-by-bone. Blade & Sorcery drives its player body by feeding VR head/hand transforms into an active-ragdoll IK system — so we sync just those anchors (~4 transforms at 20Hz), feed them into a locally-spawned creature's IK on every other client, and let each machine's physics solve the body. Authority is split: you own your own pose and health; whoever holds an item owns it; the session host owns the NPCs.

Status

Actively developed. Roadmap (see PLAN.txt): NPC attack-animation sync, spell/imbue sync, grab arbitration, session browser UI, synchronized mission retry, join handshake/versioning.

Built by Bentlybro.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors