[Submitting] Lidgren Authorative Networking Example

Lidgren Authoritative Networking Example

This is a complete example project that implements an authorative server with the excellent lidgren networking library. This download only contains code and there is no documentation, if it’s popular enough I will expand on it and write proper documentation.

The project implements the following techniques:

  • Authorative server that has control over movement, actions, etc.
  • Client input prediction which allows the local player to move instantly and not wait for the server
  • Entity smoothing which makes the movement of remote objects smooth and nice on non-local clients
  • Lag compensation which allows the server to rewind player position and compensate for client lag when doing hit calculations

Edit: Note that the current implementation does not do extrapolation in the the event of dropped packages so the clients will “skip” when this happens.

The code is as bare-bone as possible and no other calculations then necessary to demonstrate the techniques are done.

The two main resources used when building this were:

Forum download link: Removed
External download link: Removed

Example of a server with two clients running:

oh nice, i will have a look later.
Thanks :slight_smile:

Oh wow, this is awesome, thanks a lot for this!

good ,the most good thing i find for mmo,
this can be better than photon and smartfox, though there many part can’t be the same leve with this two softwart.
when i get this soft ware from google , i find it so good for the beginner , very easy to use ,and the idear of the programming is not so complex as photon,
perhap there are many area should be extend of the lidgren when we want to make mmo . but that must be the best choice for the beginner who want to make mmo with unity .

Wooow! Thanks so much :slight_smile:

A bump for a worthy effort. Make sure to put it on the wiki.

Certainly a benefit to the community. The more networking libraries the better!

Thank you!

Yep, i’m working my way through the code step by step and it’s a realy good example.

Does the client’s framerate slow down significantly as time passes for everyone? It takes about 10 minutes to go from 130 to 40 and another 10 to go to 15. Restarting it resets it.

doeko: Was a while since I wrote this code, but I have not experienced any problems like this.

Hi, I would like to thank you for putting this together. This is a great platform for an FPS. I am still relatively new to networking, especially time sensative fps style networking. I would like to + 1 for request for either video tutorial(prefered) or documentation, explaining the program flow and why you did it how you did. Perhaps implementing portions at a time. Basic client / server connection > Message Handling Types > Actor management > etc… also it would be awesome to see implementation of instant hit bullets.

Cin: I have developed another server framework called SlimNet over the past couple of months, it will go into open beta/alpha testing today and will be free until it’s done.

I’m new to unity and this tutorial is really helping me to understand how to work with the unity engine.
I have one question though, when I shut off the server, the client can move for a few seconds, then it teleports my local client back to the spot I was at when I shutdown the server.

How does it know to do this?

Thank you for the tutorial!

Fantastic. Thank you for sharing with us. Will look into it ASAP.

The links to this example have been removed, can you provide them ?

Not available anymore, sorry.

Did you remove this because the material is covered in your “Lidgren Basic Setup,” or was there some other reason? If it’s the former, you should probably mention that in the original post.

I would be happy to pay the $25 if I knew, but I didn’t see any mention of the more advanced features (e.g. prediction, interpolation) in the description.

fholm, If you are not providing the example code anymore why not remove this thread. It is irritating. Like a tease.

2 Likes