Skip to content

Packet Types

Ryan edited this page Jun 27, 2020 · 5 revisions

Packet Types

For the most part you wont need to manually send a packet as NetTools/RPCs/NetworkFields handle that for you, however there is a few different ways of sending packets you should be aware of.

Buffered & Non-Buffered Packets

Non-Buffered packets are the easiest to understand. Once sent they will go to all existing clients, however clients that join later wont get them. So using "Buffered" packets once sent the server will keep them in memory and whenever a client connects it will send them all to that new client.

For the most part, you won't need to edit the packet directly. However when instantiating/destroying an object over the networking, editing network fields, or sending RPCs there is usually an option to send it as a buffered or non buffered packet.

Proximity Packets

They will make it so you only have to send certain packets when a client is in proximity to them. Such as animations, they only need to be updated when the player is on screen. By default special ENS_ packets will be proximity based.

Packet Culling

Packet Culling is when you want a newer buffered packet to override an older one that is no longer needed. Useful for editing variables, or calling RPCs. It is highly recommended you use culled buffered packets as it'll prevent your buffered packet queue from getting ridiciously big.

Packet Culling has been implemented for RPCs & Network Fields. By default the RPC sendType will be culledbuffered however if you change it to buffered it won't cull.

NetworkFields get automatically synced when a client joins, so there is no purpose/reason for NetworkFields to be buffered. Meaning you don't need to worry about it for them. However the logic is there just in case!

Todo: Culling Instantiated packets/packets related to that object when a culledbuffered Destroy packet is used on said object.

Clone this wiki locally