ImmersiveMC

ImmersiveMC

2M Downloads

Mega Packet Customization

hammy275 opened this issue ยท 2 comments

commented

If we register the normal packets with the network handler, we can work with both packet types! As a result, this means we can add a server config to control mega packets. Here will be the options:

Always On: Always use mega packets.
Always Off: Use normal packets.
Dynamic (default): Use mega packets for those with low latency <100 and normal packets for those with high latency >100. Thought process being that with a higher latency, you're more likely to drop packets, so small packets are best, while with low latency, just sending all the packets without the overhead of a bunch of small packets is a good idea.

commented

Completely going to redo this. Instead, there's a single toggle, useMegaPackets, which defaults to true. When this is off, packets are sent like normal (not even queueing them up for the end of the tick!) If this is on however, packets are sent at the end of each tick, and if there are 4 or more packets going in either direction and the ping to the receiving player/server is considered good (<150 ms), the packets are bundled into a mega packet before being sent. Otherwise, the packets are all sent at the end of the tick as usual.

useMegaPackets is set by the server and enforced on clients. When useMegaPackets is set to false, the server should automatically reject all incoming mega packets.

commented

Change of plans, going to scrap mega packets as a whole. The overhead isn't major and it's honestly not worth maintaining much. Will save it into a separate branch just in case I decide to return to it