NetRay 2.0 - Advanced Roblox Networking Library

Okay. Nice to hear a fix for an issue found is being worked on, but still unsure if I am doing something wrong.

Since I am using the client->server event trigger. How should my setup look when using :FireServer without any additional arguments? Just to make sure I am understanding correctly.

1 Like

NetRay v2.0.2

  • Fixed Multiple issues
  • Binary encoding enabled
  • improved module layout
  • Not backwards compatible

You just have to require the module and then use :FireServer() that’s all for the client

I have added in the latest version 2.0.2. Still having issues. Not sure what is going on. I was really looking to get this setup and hopefully start seeing some benefits. Here is my setup below. Am I doing something wrong?

My Server Script:
Screenshot 2025-03-23 203318

My Local Script - Inside of ReplicatedStorage:
(You can see my previous :FireServer() disabled. That one works just fine.)
Screenshot 2025-03-23 204215
Screenshot 2025-03-23 203500

My ReplicatedStorage:
Screenshot 2025-03-23 203736

My Console Log:
(When I hit my “spacebar”, this triggers the jump event - but you can see it returns a nil.)
image

*When the “JumpEvent” is triggered, it activates my vehicle to then jump for the player. As mentioned before, this all works with no problems and when I try to incorporate NetRay, the jump does not work.

1 Like

You no longer need to call the setup function as it does it automatically once u require the module for the first time.

Also, you’re not listening to the event on the server and not sending any arguments (you don’t necessarily need to)

Here is an updated Script for you to try
Server

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetRay = require(ReplicatedStorage:WaitForChild("NetRay"))

NetRay:RegisterEvent("JumpEvent")

NetRay:RegisterRequestHandler("JumpEvent", function(plr, args)
	print(args) -- Will print what you sent, in this case "Testing"
end)

Client Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetRay = require(ReplicatedStorage:WaitForChild("NetRay"))

-- Logic
NetRay:FireServer("JumpEvent","Testing")

image
You should get something like this in your output

Okay, I got it working. I did not realize I needed to also modify my event listeners to NetRay :RegisterRequestHandler as well.

I did notice the print log in my console being triggered twice everytime? Is that normal or is it something on my side? If it is not NetRay, I will look to resolve the issue.
Screenshot 2025-03-23 233336

1 Like

Did you run :Setup() anywhere by chance?

Dang. Of course I did. I forgot to remove after your latest changes. All looks good now! Appreciate the assistance.

1 Like

No problem, if you have another other issues let me know or find any bugs. You can also delete the print in the module I accidentally left it there from testing

1 Like

Sorry for the late reply,
This is default Roblox sending 200 10kb payloads per frame as a baseline

ByteNet, I was just getting constant errors and it wouldn’t work so I can’t give u a screenshot.

This is With NetRay with throttle and rate limiting off

Both were firing a 10-KB payload every frame.

Roblox: 129187.12 KB/s
NetRay: 35.85 KB/s

That’s a 99.9722% decrease

Ping
Roblox : 70.87 ms
NetRay: 48.01ms

32.2562% decrease
My Ping doing nothing is around 36-46ms baseline

1 Like

what code did you test this with

1 Like
NetRayContinuousFireConnection = RunService.Heartbeat:Connect(function()
			if IsNetRayContinuousFireActive then
				for i = 1 , 200 do
					NetRay:FireServer('NetRayContinuousFire', {
						id = 'NetRay_CF_' .. os.time() .. '_' .. math.random(1, 1000),
						payload = PAYLOAD
					})
				end
			end
		end)

		RemoteEventContinuousFireConnection = RunService.Heartbeat:Connect(function()
			if IsRemoteEventContinuousFireActive then
				for i = 1 , 200 do
					RemoteEvent:FireServer({
						id = 'RE_CF_' .. os.time() .. '_' .. math.random(1, 1000),
						type = 'Continuous Fire Event',
						payload = PAYLOAD
					})
				end
			end
		end)

I tested them separately in the same game and place during same testing session

3 Likes

After testing with buffers, the benefits are not worth using them

I attempted to use buffers myself and another module (suphies packet module), and they both had the same issue. HUGE CPU usage and HUGE FPS and Ping increases wich doesn’t justify the reduction in memory used when sending over events.

Some screenshots from testing
image
image

This was with suphis new packet module, The ping also reduced my frames to about 9fps

I am improving the binary encoder to encode everything before being sent over the event, which hopefully will reduce memory usage even more.

I am still going to keep at buffers until I can get them to be beneficial for me

1 Like

btw ByteNet or Packet or even BridgeNet2 is way better than this module

Hello,

I’ve already tried them, this module performed better and has more features and allot more user friendly with it’s simple and basic API/functions.

Really? when i tested mine somehow NetRay performed the worst.

i did a for loop 1k times and send the number 100 using NetRay.

Now this is compared to ByteNet

image

Almost 90% better than NetRay

Also Packet has simple API/functions and performances same as ByteNet

I already tested packet and send a screen above, also sending the number 100 has no compressional advantage since you can’t compress that short of a number down losslessly.

When I tried bytenet sending a 10kb payload 200 times a frame is just kept failing by erroring.
I’ll be able to show you once I’m awake since it’s 2am for me right now

I didnt lag using Packet even tho i spammed this in a while true loop



idk man stable 60 fps and barley any cpu/gpu usage (ON A 13 YEAR OLD PC btw)

Dude most of the time its the SERVER sending info not client