BridgeNet2, v1.0.0 | A blazing fast networking library for Roblox

BridgeNet2


About

BridgeNet2 is a networking library for Roblox with a focus on performance. It cuts out header data from RemoteEvent calls by 7 bytes, which is beneficial because it cuts down on the total number of packets per player. This in turn decreases server bandwidth used, so you can send more data. Games using BridgeNet2 will never hit the RemoteEvent throttle limit. BridgeNet2 also decreases the amount of time to process packets on the client by approximately 75-80%.


Benchmarks

  • Roblox, with 200 blank remote calls per frame:
    image

  • BridgeNet2, with 200 blank remote calls a frame:
    image


Full Feature List

Expand to see the full feature list
  • Significantly faster than the default networking systems in Roblox.
  • Reduces the overhead of remote calls: client to server takes 5 bytes, server to client takes 2 bytes.
  • Identifier system to reduce bandwidth usage for static strings, which take 3 or 4 bytes regardless of size.
  • Utilities for optimization such as FromHex, ToHex.
  • Customizable rate limiting for all bridges to prevent remote spamming.
  • Provides middleware for easy typechecking and security implementation.
  • Internally secure to protect against exploiters.
  • Queues up remote calls to a player until they are loaded, eliminating the need to worry about the invocation queue/players not being loaded.
  • Abstracts instances, eliminating the need to use RemoteEvents directly.
  • Removes the need to consider client/server boundaries when defining bridges using ReferenceBridge.
  • Hoarcekat compatible
  • Logging: you can use Bridge.Logging = true for full logging on that specific bridge, which counts remote packet size too.

Installation

You can see the installation steps here.
(do keep in mind the documentation is unfinished and quite outdated, BridgeNet2 is currently on version 1.0.0, you cannot just copy past the wally section.)


I found a bug / I have a question / I’m getting an error

Please @ me in the BridgeNet2 thread within the Roblox OSS discord, or you can open a new issue in the GitHub repository, or you can reply to this post here. Any of these options work, I look in all these places!

205 Likes

OH MY GOD BRO THIS CAME IN SUCH CLUTCH

Thank you finally releasing this, was just about to finish writing my framework today until I saw this. Also, is it possible for you to use a module such as GoodSignal to handle your signals? I currently use it for my framework and I really don’t want my syntax to be different. Also just wanted to say that typing for BridgeNet is sort of useless right now:


Theres also no functions like FireAllClients or FireAllClientsExcept

16 Likes

The reason I use my “custom” signal implementation (I say custom because it’s just thread reuse from goodsignal) is because nanosecond improvement (I love seeing the funny number go down, and it’s actually a pretty noticable difference + goodsignal has a few pointless features for me that slow the library down)

As per typings, I’ll investigate that. I likely have an accidental invalid type or something. Will be fixed within the next week or so, although if you have any other issues, lmk. I don’t want to make an entire release to fix one thing

5 Likes

Nice this finally released.
When will documentation be fully written?
Also, there isn’t a release in Releases · ffrostflame/BridgeNet2 · GitHub.

5 Likes

I’m likely going to just finish the documentation with ChatGPT in a few days. There’s only a few things missing.

oops, forgot to make a github release. Will fix that
edit: fixed no github release being made

11 Likes

Alright, sounds good! I’ll probably make a PR to add the other fire client functions, and is there a way you can possibly make support for good signal/add once and wait? Thanks!

EDIT: I just noticed there’s only a single function because you can add player types. Cool!

4 Likes

tried to convert my project to bridgenet 2.0, faced many issues
so i compiled a list of missing for you to work on:

the firing to client queue simply doesnt work at all, and the replication for it was bugged

there is no invoke implementation

no :Once connections

a way to only fire to one player, without making a table each time

for now, ill probably move to red as it has more refined features and should work easier
either way my game’s network usage is around 2kbps peak on full load rn (effect calls, move calls, and other stuff) with bridgenet 1.0, so it should lower it even further i hope :smirk_cat:

great module overall, but just needs some finishing, polishing, and refining

6 Likes

I need a reproduction of this and more details, my tests show it works

Intentional, you’re supposed to implement your own. there is no reason to overcomplicate things on my end which you can do with 3 lines

I could implement this pretty easily but you can also implement it super easily. I guess I’ll implement it

this is already implemented next release

4 Likes

I also want once and wait connections. As said, it would be nice for some API consistency. Invoking really isn’t needed though, would be better to write your own.

4 Likes

I modified BridgeNet2 to make it a little easier for me to use for my framework.
It now has FireAll, FireExcept, and FireTo methods for a Server Bridge and you don’t have to wrap all the arguments you’re passing into a table. I cannot assure its perfect as I just threw it together in a few minutes and the API for BridgeNet2 is a little lacking at the moment.

BridgeNet2 Modified.rbxm (19.2 KB)

4 Likes

This is half the point of bridgenet2, there’s a reason I did this and it is because you lose a crazy amount of performance. You also lose simplicity, the ability to easily pass nil, and a lot more.

4 Likes

Please release the documentation for this as soon as possible as I want to get started with it for my new game. For the time being, I will try to understand usage through function names but documentation would be lovely!

Thank you for putting time into making this module, I plan on using it for all of my own projects as it is amazing.

7 Likes

Is the API for this, the same as the first BridgeNet API and can I use it as a reference? never used bridgenet before btw

4 Likes

Docs are still being worked on and haven’t been released yet.

4 Likes

I’m aware of that, thats why I’m asking if I can use the docs from BridgeNet since I assume the API is similair

5 Likes

fixing the documentation right now, it should be up today

BridgeNet2 and BridgeNet do not have identical APIs no

7 Likes

Partially did documentation, new update coming along nicely too

4 Likes

I see in the commit you added once and wait. I cannot express how much I can thank you

5 Likes
  1. im unsure how to replicate it, just firing to client was doing nothing at all, and there was 0 implementation in the client bridge of it working, itd just not fire the callback. i think its a keying issue, so check how you add things to the client control tables and how callbacks are called.

the implementation was exactly the same as the one you use in your benchmark

  1. yeah, but it’d be nicer and a lot more streamlined if it was built into the module

  2. once connections just makes life simple, would be nicer inbuilt into the module

  3. neat

i think its better for you to implement features like this into the module, as it saves people from having to update their edits to the module every single update to accommodate for your changes, and is probably easier for you than it is for us - considering you wrote the networker you know all the ins and outs.

great module, just unfinished, once you finish this, i guarantee itll be a game changer

4 Likes

Just because I was curious, I ran a test that would run a function that returned a tuple 10,000 times, and a function that just printed a table 10,000 times. Here’s what I got:

Spoiler: Tables win!

6 Likes