SoftwareGuy / Ignorance

Ignorance utilizes the power of ENet to provide a reliable UDP networking transport for Mirror Networking.
Other
248 stars 31 forks source link

Unrealable udp #74

Closed leavittx closed 3 years ago

leavittx commented 3 years ago

Hi. I have a question regarding the Channels list inside Ignorance script parameters. Is there a specific reason why the minimum number of channels is 2 and it's not possible to choose unrealable only channel?

My project use case is local ethernet network only, so (assuming there won't be any packet loss) I would like to try to achieve minimum latency possible with unrealable udp connection (preserving packets order would be nice though)

SoftwareGuy commented 3 years ago

The minimum number of channels is 2 because Mirror expects channel 0 to be Reliable, while channel 1 is Unreliable. There is currently no support for having one channel and multiple packet delivery options on that channel. ENet does support this, but Mirror does not.

The default channels mimic Unity LLAPI channel configuration. If you want to use a different type of delivery, increase the Array size by one, select the packet type delivery and use it in your Command and RPCs like [Command(channel = newChannelIdentifier)].

You don't really need to worry about minimum latency on a LAN. There is always going to be some latency since it has to go through hops in your local network, such as Wire -> physical LAN port -> OS kernel -> ENet Native -> Unity + Mirror.

With the amount of optimization that's in Ignorance 1.4, you should worry about your own code bogging you down than your low-level networking.