@nxrighthere hi! Can you add latest LiteNetLib from master to becnh results? I make some critical optimisations and want see your results)
Sure, Ruslan. Donāt worry, I saw those changes.
@RevenantX Well, itās faster than the previous version but slower than interop with native sockets for about 6 seconds, and resources usage a bit higher. Can we get back the unsafe preprocessor directives?
@nxrighthere i think there is no sense in unsafe version, because who wants unsafe can use Enet library.
Iām using the unsafe version in the application currently. All right, Iāll update the results soon.
Done. At least in the simulation with 1000 clients memory usage is a bit lower than before.
@nxrighthere this is strange results. Because on my pc 500 clients - 14-20% cpu, 1000 - 50-60%ā¦ But anyway this is fine)
Different hardware produces different results. Thereās nothing new here. My homeās PC is pretty old, and I donāt know when Iāll upgrade it. Hardware prices in my country are inadequate.
Hi, can u add Hlapi Pro? thanx!
HLAPI Pro is not a UDP transport. It uses UNet.
Never heard of NetDrone Engine being added?, it seems limited only until 30 CCU, i just wanted to know the system resources usage of NetDrone with 30 CCU.
I donāt add support for CCU limited solutions.
Quick update: LiteNetLib and DarkRift are updated to the latest versions, both libraries now a bit more optimized and work faster. Also, Lidgren was rebuilt with optimized functionality to avoid using expensive WinAPI calls for resolving a network interface. You can see the difference in resources usage here (thanks to @aienabled for the contribution).
So wanted to run something by this group and see if anyone else has better ideas.
So normally I use protobuf-net for encoding. But it has some quirks and I hit a couple of cases where I couldnāt work around them. Mainly it boxes value types which is why I use ref types for messaging with protobuf. But that was starting to cause pain in other areas. So over the weekend I decided to fix it, and at the same time it made sense to just look at better ways to pack the data.
So the basic idea is I still use varints, I just ripped some existing code for that out of protobuf-net. But instead of using tags for each type which take up one varint, I use a bit packed header to say which fields have non default values. I use code generation so that the field ordering is at compile time. Which is the only clean way I could think of to make it work without using reflection. Delegates might have been another option but my gut was code generation would allow for the most optimization.
The bit packing is the main thing Iām curious if maybe there is some better approach Iām not thinking of. The header I abstracted out into a BitVector64. It wraps 2 BitVector32ās, using the second one only if needed. When serializing messages I write the header as a varint(s), so it doesnāt always take up a full 4 bytes per BitVector32.
Iāll put it all up on github once I know itās working as intended. I have some basic unit testing but want to put it into our game to test against real data before putting it out into the wild.
Is this an official patch PRed into the Lidgren repo or is it a fork? Could you link the patch.
The funny thing is that itās been there for ages, but I didnāt know about it until the guy told me that.
PlatformConstrained.cs and PlatformWin32.cs (expensive implementation).
@snacktime Recently found a good asset that might help you with this.
The MLAPI has open source implementations that offer similar compression if thatās what are after. Both ranged floats and varinted floats. (We convert the float to uint using a struct with explicit memory layout, then reverse the order to make the field more likley to be small as the flag bits are in the start. Then we do normal varint).
Actual value encoding I"m good on. The challenge was more about the most efficient way to signify that specific fields should be included, like when you have logic for serializing an entire class/custom value type.
Using a bit per field where the sum of those get encoded as a varint(s) is what I came up with. But it seems that given the context of code generation there might be a more efficient method available.
Soā¦ Time to shift on DarkRift for creating Games ?
Donāt want to stay with Unet since itās deprecated, and no real information on new System.
What do you think about choosing DarkRift for now ?