Giter VIP home page Giter VIP logo

red's Introduction

Red

What is Red?

Red is a networking library for Roblox that combines blazingly fast performance with a simple API. With Red's tiny size, it is suitable for any project, from tiny experiments to games that serve millions of players.

Features

⚡Blazingly Fast

Red achieves high performance by packing events in a compressed format, using up to 75% less bandwidth. Red uses a single remote event with identifiers to reduce bandwidth, and increase performance.

⚙️No Config

Red is designed to work out of the box with no configuration required. Just require the library and begin developing. No config means less boilerplate and more time to focus on what matters: your project.

🔐Type Safety

Red is written with type safety in mind, so you can use Luau and get full intellisense and linting right in your editor. Full intellisense without any extra work means faster development with autocomplete and catching bugs before they happen.

🔎Obfuscation

As part of it's optimization features, Red obfuscates network data to make it harder for cheaters to read networking logs. This makes it significantly harder for cheaters to reverse engineer and cheat in your game.

Documentation

Red's documentation can be found here.

red's People

Contributors

jackdotink avatar tazmondo avatar blizzero avatar regginator avatar

Stargazers

Baekhyeon Sung avatar A ya Whitekali avatar Anthony O'Brien avatar  avatar Pada avatar kyle avatar OwkDevs avatar strange avatar  avatar Yuruzuu avatar peezus avatar  avatar Sarim avatar Ulric avatar Ahd libya avatar  avatar LolloDev avatar Carter avatar atlantos01 avatar Matt Marcin avatar  avatar Hugo avatar cal avatar Lior S. avatar Saul Montealvo avatar  avatar 2jammers avatar เอกภพ เชน ซีกัล avatar Nicole avatar Conz avatar  avatar  avatar  avatar AizakkuZ avatar  avatar Maxwell Ruben avatar Luxxe avatar Lewin Kelly avatar Neon avatar Suray avatar Kalrnlo avatar Rakha avatar  avatar Vezipe avatar  avatar

Watchers

 avatar  avatar  avatar

red's Issues

Implementing SharedEvents

Figured I could take a shot at implementing these so you no longer have to explicitly call :Server and :Client when requiring events.

I've read the code you wrote for this around a month ago but since your mind may have changed on how to implement it in that time, I think it would be good to get it figured out here.

Call Modes

Call

Only one listener. It is called directly in a new thread, rather than going through the slight overhead of a Signal object.

Signal

Any number of listeners. Slightly worse for performance as it needs to go through the Signal:Fire code, which while very small, does add some slight overhead.

Event Declaration

Follows the same format as regular events

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Red = require(ReplicatedStorage.Packages.Red)

return Red.SharedEvent({
    Name = "Name",
    Unreliable = false,
    CallMode = "Signal"
}, function() end)

If the Reliability and CallMode, are not specified, it will choose sensible defaults.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Red = require(ReplicatedStorage.Packages.Red)

-- Defaults to Reliable, and Signal call mode.
return Red.SharedEvent("Identifier", function() end)

Usage

Call Mode

-- Client
local SharedEvent = require(ReplicatedStorage.SharedEvent)
SharedEvent:SetClientListener(...)
SharedEvent:FireServer(...)

SharedEvent:FireClient(...) -- errors

-- Server
local SharedEvent = require(ReplicatedStorage.SharedEvent)
SharedEvent:SetServerListener(...)
SharedEvent:FireClient(...)

SharedEvent:FireServer(...) -- errors

Signal Mode

-- Client
local SharedEvent = require(ReplicatedStorage.SharedEvent)
SharedEvent:OnClient(...)
SharedEvent:FireServer(...)

SharedEvent:FireClient(...) -- errors

-- Server
local SharedEvent = require(ReplicatedStorage.SharedEvent)
SharedEvent:OnServer(...)
SharedEvent:FireClient(...)

SharedEvent:FireServer(...) -- errors

Final Note

I'm happy to write the tests for these once the implementation is finalized, but what were the issues in implementation you encountered when writing them? Would be useful to know so I don't end up running into the same brick wall.

UnreliableEvent producing larger payloads than expected.

I tried to migrate an UnreliableRemoteEvent over to Red and started seeing oversized payloads.
Normally we're able to fit under the 900 byte limit, but going through Red makes it overflow by 500-600 bytes.

image

Is there anything you guys could do to shrink the overhead of what's being sent over the unreliable wire?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.