Search Unity

[Submitting] Lidgren Authorative Networking Example

Discussion in 'Multiplayer' started by fholm, Sep 1, 2011.

  1. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    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:

    1. Authorative server that has control over movement, actions, etc.
    2. Client input prediction which allows the local player to move instantly and not wait for the server
    3. Entity smoothing which makes the movement of remote objects smooth and nice on non-local clients
    4. 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:

     
    Last edited: Feb 15, 2012
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    oh nice, i will have a look later.
    Thanks :)
     
  3. Josh_Amsterdam

    Josh_Amsterdam

    Joined:
    Feb 22, 2011
    Posts:
    68
    Oh wow, this is awesome, thanks a lot for this!
     
  4. cez1230

    cez1230

    Joined:
    Feb 10, 2011
    Posts:
    31
    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 .
     
  5. 95KillerZ95

    95KillerZ95

    Joined:
    May 27, 2011
    Posts:
    253
    Wooow! Thanks so much :)
     
  6. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    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!
     
  7. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Thank you!
     
  8. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Yep, i'm working my way through the code step by step and it's a realy good example.
     
  9. Doeko

    Doeko

    Joined:
    Aug 8, 2009
    Posts:
    17
    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.
     
  10. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    doeko: Was a while since I wrote this code, but I have not experienced any problems like this.
     
  11. Cin

    Cin

    Joined:
    Nov 8, 2011
    Posts:
    1
    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.
     
  12. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    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.
     
  13. gkraken

    gkraken

    Joined:
    Dec 16, 2011
    Posts:
    1
    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!
     
  14. Agrios

    Agrios

    Joined:
    Aug 21, 2009
    Posts:
    50
    Fantastic. Thank you for sharing with us. Will look into it ASAP.
     
  15. nosila

    nosila

    Joined:
    Feb 12, 2013
    Posts:
    1
    The links to this example have been removed, can you provide them ?
     
  16. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Not available anymore, sorry.
     
  17. Neverender-io

    Neverender-io

    Joined:
    Jun 12, 2013
    Posts:
    3
    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.
     
  18. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    fholm, If you are not providing the example code anymore why not remove this thread. It is irritating. Like a tease.
     
    theakirasan and Recons like this.