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

I have this weird issue I don’t know what error is this.

The scenario
I created a test local server for 2 players.
Both clients have output open
From the first player perspective (Green circle)
when the second player (Red Circle) Invoke the server to get a result the first player receives this error.
But when the first player Invoke the server to get a result It does not receive an error.

This works vise-versa
the first player fires a remote… well now from the output of the second player also outputs an error the same.

I solve this by not using the invoke. Instead when player request some data I re-fire it to the player from the server.

Although I didn’t want this because I needed the yield to make sure the data was sent back to the player before the script moves to the next line.

Fixed in the next version. Thank you for the bug report!

2 Likes

I keep getting a “Unable to cast value to object” error at line 286 in the server bridge. Any ideas why this could be happening?

EDIT: I wasn’t including the player target in my module, my bad!


I having this issue, it only error when :FireToAllExcept() is called from server. When new update?

If you noticed the output print nil because the client wasn’t receiving parameter from server

How do you set this up? Is there a tutorial somewhere? Sorry I am not really that good at this stuff but I really want this since it’s interesting

May I know a temporary fix for this? while we wait for an update?

Make sure that the character exists before running the check. I don’t think there is one.

This issue occurs when starting the game in studio, It also happens inconsistently.


Any idea what might be causing this?

Are you sending any nil arguments through?

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