BridgeNet | Insanely optimized, easy-to-use networking library full of utilities, now with roblox-ts! | v1.9.9-beta

I don’t fire any bridge net remotes when the game is initialized. It is also weird that it does not happen every time the game starts.

Edit: I have no idea what is going on here.


Second edit: I found out the issue, sorry for rushing to reply to this thread my bad.

Regrettably, I’m going to be dropping support for BridgeNet. I might release v2.0.0- maybe I will, maybe I won’t. I know I’ll at least release the W.I.P. code I have right now the second I know it’s stable.

Here’s why I’m dropping support:

  1. I’ve come up with a better way of reducing Roblox’s overhead.
    This new way takes only 2 bytes for subsequent calls to the same bridge- but it has 7 bytes of overhead per bridge too. The thing is, I’d have to re-write ServerBridge.luau
  2. Messy code
    I’m not going to lie, BridgeNet was built upon a prototype. Just a showcase that it’s possible. There are many instances of messy, disorganized code in BridgeNet’s codebase.
  3. Flawed API
    The API that BridgeNet has right now, is extremely flawed.
    Firstly, it is designed to be slow. Call times can be disturbingly high when there are lots of players- particularly with functions like :FireAllInRange(). The API also has messy interaction with the internal queue system that BridgeNet has.
    Secondly, it is messy. There are tons of :Fire() methods on ServerBridge, and the way of creating the Bridge object is awful. CreateBridgeTree is a symptom of these problems- but the layer of abstraction it gives is nothing more than a thinly veiled property setter. There are tons of things I could have done better- made namespaces better, made differentiating client vs. server better, and made the overall API better.
  4. Bad error handling
    BridgeNet has awful error handling. The second something goes wrong, the output is instantly spammed to hell- this is because BridgeNet manipulates the contents of what you send. It shouldn’t do that. There are better ways of handling this.
  5. BridgeNet doesn’t provide much, apart from bandwidth reduction
    This is my biggest pet peeve. If you look at Knit, EasyNetwork, and RbxNet, they all provide something: A cleaner way of doing networking, a better way, one with rate limiting, middleware, a nice interface, and all that- BridgeNet doesn’t do that. It’s a barebones object-oriented wrapper around RemoteEvents, with a cool queueing feature built-in, and some other neat party tricks.
  6. BridgeNet wasn’t designed to be production-ready
    There are so many points of failure in BridgeNet, and so much unsafe code, I don’t think that getting to a production-ready state would be possible. Every single time I add a feature, I break a few unrelated features. While automated testing is very nice, it’s not going to help BridgeNet’s source code. It’s not going to remove the awful points of failure. (I’m definitely taking the framework @sinlernick set up in a PR though)
  7. I can do better, and I will do better
    I’ve decided to make BridgeNet2. It’s a completely rewritten version of BridgeNet, designed in a way that showcases the new method I talked about in reason 1. It’s going to be written clean from the start- not based on a prototype. Its API will be written in a way that’s both intuitive, and type-safe, and it won’t care about packet contents. This means better error handling- a better API means BridgeNet2 will provide something. It will mean BridgeNet2 can be production-ready.

See you all in a few days :wave:

19 Likes

Well damn… I am now beginning to regret using your library… I have created a game using your BridgeNet as it was easy to use and set up… and my progress in the game has gone too far now. I’m still hoping to get new update fixes for the bugs I have found but, either way, time to re-write now.

1 Like

You won’t be re-writing much. I’ve already made quite a bit of it, and it’s looking to be pretty easy to migrate from this version to the new version- it’s mainly identifiers & the creation of bridges that are changed, alongside a few other small changes.

It should be just as easy to use and set up- if not easier.

7 Likes

I have done the same thing except I have rewritten my entire game using BridgeNet

2 Likes

Very excited for this. I wish more devs had the gumption to overcome the sunk cost fallacy and start anew with the lessons learned in previous projects. Bridgenet 1 was a great resource and I can’t wait to see what comes next.

Ps
One feature I’d love to see is middleware that affects all bridges. I’d like to setup naieve authentication with server authoritative rotating keys attached to each player which is sent in every bridge to make exploiting mildly more annoying

Keep up the great work!

4 Likes

What do you suggest to use in the meantime

Hey man, your resource is awesome nonetheless, very excited for BridgNet 2! - I’m personally using your module for a large dinosaur game, had no issues and the results it has provided me is just insane, really able to push the boundaries of server performance with a lot of players thanks to your module.

Much love, your decision is respected and we’re all going to stick with you and BridgeNet’s journey.

1 Like

either keep using bridgenet or just temporarily port your game to easynetwork, etc.

1 Like

Keep using BridgeNet - The problems it does solve aren’t solved by any other module, at least in an effective way.

1 Like

How should ‘replrate’ be interpreted as?

like what is the difference in using 20 versus 60 replrate?

edit: nvm it says in the script:

“ReplicationRate = 20, – twenty times per second”


I really like the test runs so far :smile: I’ll be sure to check out the 2nd one but for now will be using this

D: Hope this is soon, I wanna debug it again :eye::lips::eye:

Will the new module provide benefits other networking modules provide? I want BridgeNetV2 to give us all the benefits of all other good networking modules and yet be good for bandwidth usage. Is this the case already or are you going to see how much benefits you can implement from other good networking modules?
An example of this would be rate limiting and etc.

Something the other modules do good is rate limiting and I really want BridgeNet to provide this benefit as well!

I forgot to reply to this. I already wrote up a feature list for BridgeNet2:

Features: Performance

  • A lot faster than Roblox’s default systems.
  • Reduces Roblox’s overhead per remote call: client to server takes 5 bytes, server to client takes 2 bytes.
  • Identifier system to reduce the bandwidth used on static strings; any size string will take 3 or 4 bytes.
  • Utilities for optimization: FromHex, ToHex, DictionaryToTable, and more.
  • Thread re-usage on connections for extreme efficiency.

Features: Security

  • Customizable rate limiting across all bridges- never worry about remote spamming again.
  • Supports middleware for easy typechecking and security implementation.
  • Internally secure. It is impossible to cause an error in the library as an exploiter, as opposed to regular BridgeNet.

Features: Abstraction

  • Queues up remote calls to a player until they are loaded- never worry about the invocation queue again.
  • Instances are abstracted away- never worry about RemoteEvents again.
  • Abstract any optimization needed away from you- convert dictionaries to arrays and back easily.
  • Don’t worry about client/server boundaries when defining remotes. ReferenceBridge and CreateTree have you!

Features: API

  • Fully typed in strict Luau.
  • Extremely performant. Never worry about API performance, ever.
  • Very easy to pick up.
  • No more tuples- which means a much easier time using strict typing.
  • API is built to be extendable; you can implement your own systems and whitelists.
  • A new testing mode has been added; when you call BridgeNet.Testing(boolean), the module will activate a mock mode that never yields.
15 Likes

It’s nice that you’re creating a v2! I can’t wait to see something even faster than it already was.

Can’t wait! :slight_smile:
Kind of bummed out that I only just looked at this even though I implemented a few things around it.
Though it is good I made a wrapper of your wrapper so converting over will be seemless for the most part. Looking forward to it, design well and code cleanly my good sir :+1:

You never seem to fail when it comes to impressing. Thank you. I’m amazed.

1 Like

could you also make it easy to add to my game or includes a simple tutorial if it releases because i get too confused with modules :disappointed: :disappointed:

1 Like

I’ve been using BridgeNet for a few projects because it is painful to manage RemoteEvents with Rojo, had a really great time using the module so I look forward to seeing the v2.
Also, is this a feature list of things implemented right now? That would be really impressive.
Regardless, thank you for making BridgeNet. :smile:

1 Like

I dont understand, this still uses roblox remotes.

2 Likes