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

If you mean storing a constructed signal in a modulescript, then it should.

2 Likes

Is it possible to fire remotes from inside a module script?

1 Like

Fundamentally, there is no difference between a ModuleScript and a script, except for the fact that a module can return a value. I havenā€™t used BridgeNet yet, but whatever can be done with Scripts/LocalScripts, can also be done with a module.

1 Like

First of all, great module man I appreciate your work, and keep it up!
I came across 2 errors tho :sweat_smile:

At line 727 in ā€˜ServerBridgeā€™ self.Name seems to be nil (This caused Bridge:Destroy() to error)

serdeLayer.DestroyIdentifier(self.Name)

Fix

serdeLayer.DestroyIdentifier(self._name)

Iā€™ve checked the key inside of receiveDict and sendDict and they both match up the self._name string so this should do.

The second error is caused by any ā€˜bridgeā€™ being invoked with ServerInvoke/InvokeServerAsync from a different client.

ReplicatedStorage.Modules.BridgeNet.ClientBridge:125: invalid argument #1 to 'spawn' (function or thread expected)
  Stack Begin
  Script 'ReplicatedStorage.Modules.BridgeNet.ClientBridge', Line 125
  Stack End

On line 120 in ā€˜ClientBridgeā€™ at the elseif statement, ā€˜threads[uuid]ā€™ seems to be nil for clients that did not invoke this bridge. Iā€™ve implemented this as a simple fix although Iā€™m unsure if this would break/ cause problems for anyone else.

local uuid = args[2]
if threads[uuid] then
	table.remove(args, 1)
	table.remove(args, 1)
	argCount -= 2
	task.spawn(threads[uuid], unpack(args, 1, argCount))
	threads[uuid] = nil -- don't want a memory leak ;)						
end
3 Likes

Donā€™t know how you tested it, but read the reviews on the main post. In my case BridgeNet reduced the ping 30x. This has tons of practical uses, I personally used it for waist C0 replication to server, which would be literally impossible to do without bridge net (Or it would cause the ping to be 3k+, as my tests showed).

1 Like

Iā€™m interested - what changed in your replication data? If possible, could you use my plugin to check out the differences before and after using bridgenet? https://devforum.roblox.com/t/packet-profiler-accurately-measure-remote-packet-bandwidth/1890924

Iā€™m mainly curious since I also replicate C0 data for player head rotation, and am interested in what kind of optimizations are taking place.

1 Like

So this is the code I was using without bridge net. For my gameā€™s purposes I needed the rotation to be replicated exactly to the server, not just to other clients, + even if I replicated to other clients only, ping results would be the same if not worse.
So with this code the ping was 3K+ if there were 100 players on the same server

I only changed the repEvent:FireServer line with firing a BridgeNet remote, and on the server listening to that BridgeNet remote, nothing else changed. The ping dropped down to on average 100 ping with 100 players on the same server.

6 Likes

Iā€™ve also had this problem before but managed to fix it by doing

Add task.wait() before creating a bridge.

1 Like

Thanks for the report! Iā€™ll definitely fix this in the next version alongside a bunch of other changes.

1 Like

OMG, this is a fantastic module. Saved me a ton of time

1 Like

a small question from a wally user;

Is the current wally version (v0.1.0) the same as the latest version (v1.9.8-beta)?

1 Like

The wally version should be on 1.9.9, not 0.1.0. Curious, where are you getting the 0.1.0 number from?

Oh yeah, I just checked wally-index and found it.

The docā€™s installation page.

1 Like

Hi, great module!

Unfortunately though, I am getting this error spammed every second in my game right now and I donā€™t think Iā€™ve done anything wrong;

This isnā€™t breaking anything I donā€™t think but Iā€™d just like to make sure.

Thanks!

1 Like

What are you passing In Bridge:Connect() ?

1 Like

This error occurs when you pass an invalid parameter into :Invoke. Iā€™ll see if I can improve the typechecking/error messages in 2.0 which will release shortly.

If this isnā€™t the issue, please send me what youā€™re sending over / the server sided code.

1 Like

Hey bomb, Iā€™m having a replication issue that I canā€™t seem to figure out, Iā€™m creating the bridge on both the client and server, starting it aswell yet still have issues, if I WaitForBridge in external scripts it just infinite yields/the code below it doesnā€™t work.



You need to require BridgeNet before running the start function.

Oops just noticed that, I scrunched the code together for screenshot purposes but yeah I require it before starting.

Hereā€™s a complete picture

Made a hotfix for this issue. Itā€™s not supposed to happen, but BridgeNet was designed for single-script architecture. It should be fixed in this latest release that Iā€™m about to put out.

1 Like