Will there be some way of deciding the data type in Declare? Apparently you can get way better results doing stuff like encoding ints from 0 to 255 as bytes, as well as big savings from obscure data types like Vector3int16. It would be great if there was functionality for this.
There’s functionality planned, however this is separate to RemoteEvents- I plan on creating an abstraction for string.pack
I’m working pretty hard on 2.0 which is already jam-packed with improvements, so this likely won’t come soon.
2.0.0-rc4
Reminder- rc stands for release candidate. This version, and this module, are unstable. It’s available on the Roblox marketplace, and on Wally under ffrostflame/bridgenet@2.0.0-rc4
. I will be updating the roblox-ts port when 2.0.0 fully releases.
- Unpacked arguments on server receive (Thank you @MELON-Om4r)
- Fixed numerous queue-related bugs
- Invoke UUIDs are now packed for less network usage (34 bytes → 18 bytes)
- The Identifiers function is a closure again
- Added outbound middleware
- Added middleware to the client
- Middleware now passes in the
plr
argument on the server - Overall middleware improvements
- Client-sided improvements w/ connections
- Added .GetQueue() for debugging purposes
- General improvements to client receive
- Temporarily removed warning signals until I can figure out a better way to add them, they’re kind of a mess right now.
- Removed config symbols
- Removed logging features- it turns out I forgot to fully implement them, plus nobody used them.
- Removed BridgeNet.Start(), the module now runs when you require it for the first time.
- Removed :InvokeServer()
- Removed both dependencies
I’m very happy with the current state of BridgeNet. This update should help accessibility and usability across architectures, and it also significantly speeds up development. I will be releasing 2.0.0 likely soon.
I keep getting this error everytime I try to run my code:
14:26:38.266 Infinite yield possible on 'ReplicatedStorage:WaitForChild("AutoSerde")' - Studio
14:26:38.266 Stack Begin - Studio
14:26:38.266 Script 'ReplicatedStorage.Utils.BridgeNet.SerdesLayer', Line 38 - function _start - Studio - SerdesLayer:38
14:26:38.267 Script 'ReplicatedStorage.Utils.BridgeNet', Line 73 - Studio - BridgeNet:73
14:26:38.267 Stack End - Studio
The code:
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage.Utils.BridgeNet)
local Remote = BridgeNet.CreateBridge("Remote")
Remote:Connect(function(stringA, stringB)
print(stringA .. stringB) -- Prints
-- Hello, world!
-- Hello, someone!
end)
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage.Utils.BridgeNet)
local Remote = BridgeNet.CreateBridge("Remote")
while true do
Remote:FireAll("Hello, ", "world!") -- Fires to everyone
Remote:FireTo(game.Players.Someone, "Hello, ", "someone!") -- Fires to a specific player
task.wait(1)
end
It seems the roblox model that you can get on the marketplace is currently broken, I downloaded the latest relase from the github and that worked. One last problem though, it only starts working when you call bridgenet.Start(), I thought it does that automatically when you require the module for the first time? I made sure I’m using the 2.0.0 release btw.
ehm, .Start is literally not in the code. I think I might’ve uploaded the wrong version?
Could you take a screenshot of the BridgeNet modulescript itself? It should look like this:
Sure, here you go:
Yep, outdated version. It should be fixed.
oops.
Hi, with the most recent version of bridgenet, anything I run does not work.
I tried using my own code and the example code from the documentation, both return 2 errors.
attempt to call a nil value
From both the client and the server.
Not sure if this would be classified as a bug or I am doing something wrong, so decided to post here instead of making an issue on github
This is most likely because you’re using the .Start() functionality it previously had, which is now removed and it works as intended on require. Exact same error I got, tripped me up for a sec cuz the docs were outdated lol
yeeep. I will be updating the docs when 2.0.0 fully releases.
And likely adding this as a warn message lol
This is the first time I have actually had time to test BridgeNet’s capabilities, and the results are astonishing.
2-3KB receive on the server (using packetprofiler) and 50+ ping on the client while replicating 128 NPCs’ position per frame without implementing any additional optimization than what’s already provided.
i’m curious- can you try doing the same test with a 20hz replication rate? you should be able to just do Bridge:SetReplicationRate(20)
Most of the time, the packet size is 2840 bytes…
… and rarely it is 5680 bytes
and the ping is 50ms+ (50 → 60 to be specific)
However, when I ran the test again with replicationrate as 60hz, the results were the same. I will test both 20hz and 60hz using robloxs’ performance tab instead to double check accuracy.
EDIT:
I had maxRatePerMinute as 60 during the whole tests, so does it matter?
I don’t think maxRatePerMinute should matter- rate limiting is not added yet.
20hz should compress it more and have slightly less data size- could you print .GetQueue every heartbeat?
Do you mean ._returnQueue? I have 2.0.0-rc4 and that’s probably why I don’t have it.
BridgeNet.GetQueue()
- it should be in 2.0.0-rc4, it’s in BridgeNet itself, not the object.
I’m writing the documentation for 2.0.0 right now, actually.
I lowered the NPCs count to 4 so that my studio can handle the enormous prints’. Anyways, here is a picture of two getqueues calls.