When I run the test below it does not show the correct values and returns a table for Val1 and nil for Val2 and 3.
What am I doing wrong?
23:06:25.493 plr CanterCrow - Server - BNet-Client-To-Server-SS:7
23:06:25.493 Val1 table: 0x986ee00f34d665e4 - Server - BNet-Client-To-Server-SS:8
23:06:25.493 Val2 nil - Server - BNet-Client-To-Server-SS:9
23:06:25.493 Val3 nil - Server - BNet-Client-To-Server-SS:10
–Local Script
local BridgeNet = require(game.ReplicatedStorage.Modules.BridgeNet)
BridgeNet.Start({})
local ClientRemoteLS = BridgeNet.CreateBridge(“Remote”)
while true do
ClientRemoteLS:Fire(“Val1”, “Val2”, “Val3”)
task.wait(1)
end
Apologies for this- this is due to an oversight I missed in testing. This will be fixed in 2.0.0-rc4, which should come out soon-ish (I would say within 2 days or so). I’ve been working pretty hard on it.
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.
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.
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
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.
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?