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

I would like to suggest better naming and better documentation of this module, as it is very confusing on what is what, as it took me more than an hour to set it up. I would suggest documenting how to do server → client and via versa.

This is a good module nonetheless, and I will be rewriting my game into this.

1 Like

You need to define DefaultReceive and DefaultSend. It’s not broken.

If it truly is broken I get home on Sunday, I’ll be able to investigate the issue again. It is in beta after all.

Documentation is a known issue I need to improve, and a new release should be out Sunday which improves naming and documentation.

It also will stabilize global logging, add rate limiting, and fix a multitude of features.

It’s not broken here is a code that should fix the error.

BridgeNet.Start({
	[BridgeNet.DefaultSend] = 60,
	[BridgeNet.DefaultReceive] = 60,
})
1 Like

I’ve updated this devforum post with a little note explaining why a feature is important. Please take the time to read it.

This is really awesome! I would definetely use this for my tetris game soon.

1 Like

This is very interesting. Can you possibly explain in detail how this works and why this is much faster than RemoteEvents. Where do RemoteEvents go wrong, which this module corrects, which causes it to be so much faster? I could learn a thing or two.

2 Likes

1.4.4-beta

Get it here.

  • You no longer need to declare DefaultReceive and DefaultSend- they default to 60.
  • Fixed ServerBridge:Destroy()
  • Added print message while waiting for the ClientBridge to be replicated
  • Removed the print statement in OnClientEvent. oops!

Thank you @Baileyeatspizza for your contributions

Sorry for the wait! A lot of stuff that should’ve been pushed earlier- however I was not at my computer. Documentation updates coming most likely tomorrow - I’m tired and I just got home.

Would you consider adding a way to fire remotes to all clients in a given range (eg. from a part)?
I am building realistic “network repeaters”, and it would help out a lot if it was included as an utility;
I also need to figure out how to make the network repeaters communicate with each other and form a mesh network

1 Like

So you don’t need to use this anymore?

BridgeNet.Start({
	[BridgeNet.DefaultSend] = 60,
	[BridgeNet.DefaultReceive] = 60,
})

If you read the release notes, which is literally the first thing, no, you don’t need them anymore.

2 Likes
local RangeThingHere = BridgeNet.CreateBridge("Remote")

RangeThingFire:FireAllInRange(Vector3.new(0,0,0, 20, "Whatever", "here")

There is support for it!

1 Like

1.4.5-beta

  • Documentation changes. Fixed typos / grammar issues, overall improvements.
  • roblox-ts port! :tada: :tada:
  • Fixes for existing typescript files

You do not need to update to the latest version for this.

3 Likes

1.5.5-beta

Get it here or from the Roblox marketplace.

  • Added “RemoteFunction”-type API [UNSTABLE]
    • Added ServerBridge:OnInvoke(function() end)
    • Added ClientBridge:InvokeServerAsync(), yields.
    • Added ClientBridge:InvokeServer(), returns a promise instead of yielding.
  • Refactored some code to be better-organized.
  • Refactored project structure / testing code to allow for dependencies
  • Added Promise as a dependency
  • Added GoodSignal as a dependency

There is no documentation as of right now because I kind of rushed releasing this.
:InvokeServer(), :OnInvoke(), and :InvokeServerAsync() are all experimental features- please don’t rely on them. However if you do experience any bugs, please don’t be afraid to DM me about it, or open an issue on the GitHub repository.

4 Likes

Hello there,
I was using BridgeNet in my game and ran into a problem. When the player respawns, for some reason, I’m not able to fire remotes created using bridgenet. Here is an example script that has the same problem for me:
Server:

local BridgeNet = require(game.ReplicatedStorage.BridgeNet)

BridgeNet.Start({
	[BridgeNet.DefaultReceive] = 60,
	[BridgeNet.DefaultSend] = 60
})


Remote = BridgeNet.CreateBridge("Remote")

Remote:Connect(function(player, message)
	print("\n" .. player.Name .. " wanted to say the following message:\n" .. message)
end)

Client:

local BridgeNet = require(game.ReplicatedStorage.BridgeNet)
local UserInputService = game:GetService("UserInputService")
local success, err = pcall(function()
BridgeNet.Start({
	[BridgeNet.DefaultReceive] = 60,
	[BridgeNet.DefaultSend] = 60
})
end)
if success then print("Started") elseif err then print("Already Started") end
local Remote = BridgeNet.CreateBridge("Remote")

UserInputService.InputBegan:Connect(function(key,gampross)
	if gampross then return; end
	if key.KeyCode == Enum.KeyCode.E then
		Remote:Fire("I am the best")
	end
end)

After resetting, the remote just doesn’t work. If there is a solution or if there is something that I’m doing wrong let me know.
The localscript is inside the “StarterCharacterScripts.”

I actually deleted all of the remote events from my game and shifted to bridgenet but I forgot to keep a backup file. It would really suck if I had to change everything back to being functional with remote events as it took me quite a lot of time.

Edit: After moving the BridgeNet.Start thing into a separate local script inside “StarterPlayerScripts”, the problem was solved. If possible I would still like to know to reason as to why it wasn’t working when respawning with the old code.

It’s most likely because you were running it in StarterCharacterScripts- BridgeNet.Start isn’t supposed to be ran multiple times. There’s supposed to be a check that runs when BridgeNet runs multiple times though.

BridgeNet.Start creates the instances required for BridgeNet to run, and handles a ton of internal logic like connecting to heartbeat. Connecting this logic multiple times can mess BridgeNet up.

1 Like

1.6.5-beta

Get it here or from the Roblox marketplace.

  • Fixed and improved invokes (Thank you @Baileyeatspizza!)
  • Added documentation for invokes
  • Added .CreateBridgesFromDictionary()
  • Significantly improved / fixed roblox-ts typings

Is there any limits to number of parmaters being sent over the BridgeEvent, or type of parmaters it can send?

I’m losing data through an event.
A Client Event, sends to the Server some Data, and then the Server sends back to another Client that Data, but all the Data is turning up nil upon receving of the signal.

(NIL POST)

There are not supposed to be limits. Can you send your code?
It may be because one of the parameters you’re sending is nil- BridgeNet doesn’t allow for that due to performance.
What I mean:

local Object = BridgeNet.CreateBridge("Remote")

Object:Fire("test", nil, "test2") -- Unpredictable behavior. May cut off parameters.

If this still isn’t the issue, I’ll be releasing a debug mode probably tonight that may help diagnose your issue.

Lol I was just about to come edit my post, one of my parmeters being sent was nil (when it wasnt supposed to be), so it was turning the entire tuple nil. I fixed the issue tho.

Thank you for the reply. Epic Module too, I think it improved network performance a lot… just wish I could like compare and see how much its improving compared to the old standard remote event usage.

1 Like