Best way to handle Remote Events in a combat game or game that requires a lot of them

Hello, I have thought of this topic some time ago which i researched but never got a proper answer

What the best way to use remote events in a combat game?

By combat games, I mean the type of games with different characters and move sets. Like if the player presses the “E” key it fires the server and uses the ability which everyone on the server sees. But when i thought about it if you add a lot of moves it will also require a lot of remote events. And at first it thought you could just use one across all clients but after researching i learned that it could potentially be bad.

So which is the best way to handle it: separate remote events for each moveset, or ability. Or same remote events all clients use to replicate on the server. Or is there another way?

I want to know which is the better in latency and performance.

1 Like

Think of remotes like the Transport layer on OSI model. 7-layer model/theory that explains how the internet actually works. There are two protocols, you should care about UDP (User Datagram Protocol), and TCP (Transmission Control Protocol).

TCP is reliable, making it so the data is guaranteed to get the destination, but does that you should use it? TCP is great for transferring data, but it involves a lot of math and has to maintain the TCP 3-way handshake (beyond the scope of this message, all you know is that the destination is expecting this message). Keeps track of sequence,

UDP is Best Effort, meaning it will send the message, but doesn’t mean it will get there in the right sequence or destination won’t know they will get a message, ahead of time. Think of best effort like those random advertisements in the mail, that we all throw out. You don’t know they are coming, and you could get one late, and another too early. (No, I am not saying the postal service is unreliable)

UDP is commonly used in video. If you miss a frame, then your eyes probably won’t notice it.

Long story, short for event you might be sending hundred times per second/minute, try UDP, unreliable remote events.

From personally experience, there is no difference, but to prevent spaghetti code, try one per movement/ability.

Unless you have the ability to handle networking infrastructure and control strength of people’s 802.11 (Wi-Fi aka Wireless Fidelity), there no way to control latency as the time between source and destination. Wired is always faster than wireless, unless you with IBM “HoneyOptic” project, (I could’ve got the name wrong)

Just like drinking too much water, cause drowning. Too much oxygen, can cause oxygen poisoning. (probably better term for it) Too much of anything will cause problems, best way to combat it is use them wisely, and condense, when possible.

My suggestion, use Maid to help combat memory usage, and a networking package like Warp to help networking.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.