Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Announce] FPS Networking Kit

Discussion in 'Assets and Asset Store' started by fholm, Jul 21, 2012.

  1. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052

    I'm here by announcing my next product comming to the asset store in a short while; The "FPS Networking Kit". The package aims at filling a current void in the Unity universe: FPS games with an authoritative server and AAA networking techniques. The package is built on-top of the excellent Lidgren networking library and is aimed at Web Player, Windows and OS X. It will run on both Unity Free and Unity Pro. The package implements several advanced techniques to provide the best possible platform to build a multiplayer FPS ontop of. The short version is that it implements the same techniques that are used in Quake 3 and Counter-Strike, and most other modern FPS games.

    Hitboxes

    Hitboxes that are wrapped around the body of the player characters, this allows detection of hits on specific body parts to allow application extra damage or effects, such as head shots or limping if a leg is shot. The hitbox system also allows you to detect shots that are close by but not hitting a player, to apply effects like specific sounds or the now famous Battlefield 3 supression effect: http://www.youtube.com/watch?v=slvCVuU5efM



    Client/Input Prediction

    Input prediction allows the local player to move instantly on his screen by approximating the result the server will produce when the command reaches it, but if the prediction is wrong the server is authoritative over movement and will correct the position of the client. This is explained in detail on this article by valve software: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

    The input sampling runs at separately timed fixed interval which implements temporal anti-aliasing (http://en.wikipedia.org/wiki/Temporal_anti-aliasing) which guarantees that the local player moves smoothly without any stuttering/aliasing no matter what frame rate or vsync settings are used.

    Entity Interpolation Animation Synchronization

    Interpolates remote players for each client, giving a smooth and nice representation of remote players. The interpolation is lag and packet loss resistant and can deal with spikes in delay or dropped packages without the illusion of a smooth moving player breaking. All animations are kept in sync with the position and rotation of the interpolated entity.



    Lag Compensation

    This is the big feature that is currently not available in any other FPS kit for unity, it's a technique popularized by Counter Strike 1.6 that allows players to aim directly at their opponents (instead of leading a head of them, to manually compensate for lag - as you have to in Quake 3 for example). It works by having the server be aware of the lag of each individual player, and rewind the world for each hit-calculations to make sure that they happen at the point in time the client was viewing locally when the weapon was fired.



    This technique is described in great detail in this article by Valve Software: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

    Feature List
    • Client input prediction
    • Entity Interpolation /w Animation Synchronization
    • Lag compensated shooting
    • Temporal Anti-Aliasing
    • Weapon System /w Recoil
    • Hit detection for different body parts
    • Map/Level loading support
    • Console /w Rcon

    Questions

    This package will be available within one or two weeks on the store, and while I normally don't announce packages this far a head, I have been working on this code for a long time and come to a point where it's mostly polish and bug-fixing left. But since I've been working on it alone and in pretty much isolation, I have two questions I would like to ask the public/potential buyers:

    • Is there some feature that you would like to see / consider a must have?
    • What would you be willing to pay for this package?

    Make sure to stay tuned for some video updates and more information during the following 1-2 weeks.
     
    Last edited: Jul 21, 2012
  2. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Does this do matchmaking, or is this purely game management? Also, how extensible is that. I think it would be difficult to make a server that would be compatible with almost every FPS game out there!
     
  3. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    There is no matchmaking or external services, the kit focuses on the really hard technical aspects of building the networking for an FPS game.

    This is a base to build your multiplayer FPS on top of, since the core way all FPS games do networking today is the same (Prediction + Interpolation + Compensation) I see no hindrance in building whatever type of FPS you want on-top of it.
     
  4. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Okay, great. So how much will it cost?
     
  5. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    That's one of the questions I had, what are people willing to pay? I understand that a lot of people will say "free" or something like 5$. But I would prefer realistic suggestions, right now I'm leaning to somewhere between 30-90$

    I also updated with a shorter feature list:

    Feature List
    • Client input prediction
    • Entity Interpolation /w Animation Synchronization
    • Lag compensated shooting
    • Temporal Anti-Aliasing
    • Weapon System /w Recoil
    • Hit detection for different body parts
    • Map/Level loading support
    • Console /w Rcon
     
  6. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    I'd be interested if you could make this more generic than FPS, and make it easy to plug into games already in development, like a TPS.

    A lot of the same principles apply, so if you were able to make it easy to plug in our own systems into it, I may be interested. Also, would this kit require using standard unity networking, or can third party solutions like photon/ulink work?

    Will it be multiplayer out of the box, or only provide those mechanics like dead reckoning and such, to make it behave correctly when you do make it multiplayer?
     
  7. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,632
    If it's <= 90$ I'm in.

    Nice of Valve to share technique and code, huh?

    What I really hate is this:
    "We can't allow that simply because a game server can't trust the clients on such important decisions."

    Gorramn cheaters make it hell for programmers too.

    Maybe a question:

    - how would you describe a typical setup outline (what do you need to do to get up and running)?
     
    Last edited: Jul 21, 2012
  8. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Thank you!

    Very nice of them, yes :) But the techniques are well known before Valve used them, and they did not share any code :)

    Yup :(
     
  9. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I find that while in a high level the same principles apply, on a lower level/actual implementation this does not hold true.

    The kit is built using the Lidgren networking library, so that is what is being used. You can in theory replace it with whatever you want, but expect to re-write a lot of code.

    Multiplayer is the core thing in the entire package, so yes it will run right out of the box.
     
  10. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I would price it at $45 to $55, with a bonus version with lesser used features for $90. And you know I'm being honest when I say that because I personally wouldn't want to pay that, but given your pack's abilities, if I make a multiplayer shooter I probably will.
     
  11. liverolA

    liverolA

    Joined:
    Feb 10, 2009
    Posts:
    347
    50$-60$ is a good start,I am in!
    I have a suggestion,current there are few people using lidgren for their game,why not use this valve theory to build some fps kits for photon/ulink/smartfox, I think a lot of people will buy it!

    As for me,I will pay at least $150 for a smartfox/ulink conversion of this!
     
    Last edited: Jul 22, 2012
  12. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Thanks for the feedback!


    There is a major problem with building something like this on both Photon and Smartfox, as they do not have access to any physics/animation libraries and run outside of Unity - making it impossible to create an authoritative server. I will look into uLink, but I'm not aware of any huge crowd using uLink currently (I know a few people) and it's also very expensive to obtain.

    Ok, very good to know!
     
  13. Nanity

    Nanity

    Joined:
    Jul 6, 2012
    Posts:
    148
    I didn't bother yet to read all the unity documentation about networking yet, so I'm very unexperienced on this topic. From what I read a third party server is obligatory, means this package can't be used for local networking with one unity build as host and the others as clients?
     
  14. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I think you must have miss-understood something about how (the unity) networking works, a third party server is not mandatory - neither with this or any other package as it will run inside unity (that is the entire point of using Lidgren, most other networking solutions other then Unitys own runs as an external third party server). running inside unity is required to have access to physics, etc.

    If you ever used to run your own Quake or Counter-Strike server for example, this is how this package works. You start the same .exe as you would otherwise, but with the "-server" flag set.
     
  15. Nanity

    Nanity

    Joined:
    Jul 6, 2012
    Posts:
    148
    Sounds promising and thanks for the explanation! Guess a price below $50 should be considered "too cheap" then ;)
     
  16. Kilo_

    Kilo_

    Joined:
    Mar 21, 2012
    Posts:
    8
    Would the peer based Scalify Badumna benefit from this?

    From what I can determine from their documents. Each peer takes information directly from another peer which i assume is the unity game client. Only limited arbitration is handled from a central server Trusted Peer. But I think that it is very flexible on what needs to be central and what is peer only.

    In your opinion how would this approach be useful in such a peer to peer situation?
     
  17. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    The setup that I have built for this kit, does not really work well with peer-to-peer, as it relies on a central server making all authoritative decisions.
     
  18. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,092
    Could the server be a player without needing to start up a server exe?
     
  19. EiKON-Andy

    EiKON-Andy

    Joined:
    Nov 13, 2010
    Posts:
    66
    I'll definitely be picking this up if it's anything up to the ~$50 mark. Sounds like exactly what I've been after!

    On the weapon side of things - do you support projectiles / raycast / both?
     
  20. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I've been wondering the exact same thing.
     
  21. UnlimitedEdition

    UnlimitedEdition

    Joined:
    Feb 27, 2012
    Posts:
    287
    Yah, does this have at least decent weapon support and what is the code written in... I'm assuming C# because I thought I've seen some of your other stuff be in C#.

    P.S.

    40-50 especially if you have good weapon support.
    Which after actually reading your feature list it appears you do have.
     
  22. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    This is what's traditionally called a Listen server, currently it does not support this - frankly because it's quite a lot of extra work and FPS games are usually not played that way.
     
  23. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Ok, good to know!

    It depends a bit on what you mean with projectiles, if you mean grenades and rockets then yes that is supported. But fast-firing weapons like assault rifles, pistols, etc. are raycasted.
     
  24. EiKON-Andy

    EiKON-Andy

    Joined:
    Nov 13, 2010
    Posts:
    66
    Great stuff - thanks. Guaranteed sale here!
     
  25. dreadt9

    dreadt9

    Joined:
    Jan 13, 2012
    Posts:
    143
    Excellent stuff :D
    Guaranteed sale for me too
     
  26. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    880
    I have a hard time understanding how you where able to develop Lag compensated shooting.

    Rigidbody.position, Rigidbody.MovePosition and transform.position only is applied after FixedUpdate or Update. This makes it very hard to move hit boxes around in order to do hit tests vs. them.

    The only way I could think to do it would be to spawn colliders and then run hit test vs. them before destroying said colliders, seems very inefficient.
     
  27. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Well, it was not easy.

    This is correct.

    That is the naive way (and the initial way I tried) of doing it, and it does not work because it's very slow and inefficient. However, I do not want to share how this is done as that would giving away half the secret (aka. the reason people will buy my pack).

    Also, if you're just interested in the lag compensation, I have split that code out of the main pack and it's soled separately, here: http://forum.unity3d.com/threads/145095-Announce-Rewinder
     
  28. LeWyRaWr

    LeWyRaWr

    Joined:
    Jul 6, 2012
    Posts:
    12
    Looks promising!

    Is this a full game online system, or if I had my own engine, would be it easy to port the online section over?
     
  29. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Depends on what you mean with own engine, if it something which doesn't run in Unity then no. If it's inside unity then maybe, depends a bit on how it's down.

    Not easy to give a clear cut answer, sorry.
     
  30. LeWyRaWr

    LeWyRaWr

    Joined:
    Jul 6, 2012
    Posts:
    12
    I'm sorry for being confusing! :)

    What I meant what.. I have everything already set up.. Player controller, raycasting.. All that stuff. Would it be easy to integrate the online side?(Connecting, syncing moving etc)
     
  31. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Last edited: Aug 3, 2012
  32. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    I second @leWyRaWr's question - I would be very interested in this if it is relatively easy to connect to an existing FPS Setup (specifically my FPS Constructor), mostly for the possibility of recommending this as an extension for people already using the FPS Constructor.
     
  33. yunspace

    yunspace

    Joined:
    Nov 8, 2010
    Posts:
    41
    I'm also quite interested in the same question on whether the networking component is pluggable into other FPS systems. Considering I've just bought DB's FPS Constructor and have been attempting to hook it into ULink.
     
  34. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    In short, no. It's just to many part of the setup that need to align properly with each other to give a perfect experience. But, it's not really intended as "just a networking kit" that you plug into another "fps kit". It's intended to be a complete FPS solution, including networking. So the idea is to replace something like DB's FPS Constructor, not complement it.

    I also updated the HUD demo again: http://dl.dropbox.com/u/19877504/FpsHudDemo/WebPlayer/WebPlayer.html
     
    Last edited: Aug 3, 2012
  35. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    I'm currently looking for an FPS kit for a small project that I'm working on and I'm glad that you are working on one with a networking feature built-in as well.

    Since you aim to replace current FPS kits out there can you give us a bit more details on the non networking side features of this kit?
     
  36. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Sure, what exactly are you looking for?
     
  37. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    - Basic FPS features (similar to BF3 and/or Deus Ex: Human Revolution)
    - Multiple animation support
    - Melee weapons support
    - Optional 3rd person mode if possible
    - Lean left/right while standing or crouching would be nice as well but I think that would fall under the animation feature.

    Just saw your edit in OP. I'd say between $50-$100 for a complete full featured FPS kit would be great specially if it's fairly easy to setup for non programmers like me :)

    I'm looking forward to this FPS kit, specially the networking and hitbox features!
     
    Last edited: Aug 3, 2012
  38. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Unicron: I will make a proper feature list during tomorrow and post it, with a lot more details.

    I updated the HUD preview also: http://dl.dropbox.com/u/19877504/FpsHudDemo/WebPlayer/WebPlayer.html

    New features are:
    * three different (normal, circle, dot) crosshairs + spreading of crosshairs
    * splatter effect for when taking damage (test by clicking on button)
    * UI for health, including active heart beat monitor that changes depending on your HP
    * some minor icon changes, etc.
     
  39. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    Awesome! Looking forward to that features list. Also that HUD is perfect for my project, can't wait to see it fully functioning.
     
    Last edited: Aug 4, 2012
  40. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Preview of the scope feature (click on image for 1920x1080 version):
     
  41. dreadt9

    dreadt9

    Joined:
    Jan 13, 2012
    Posts:
    143
    Wow this is getting good,
    @Anyone but fholm
    I think he updates the demo of the hud so check it out :D
     
  42. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    Yup, noticed that too, it's getting real good. I'm liking how he's going towards a more futuristic theme, definitely excited to see more.
     
  43. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I realized I forgot to post the promised feature list, I figured I'd do a little bit better of a job and provide a nice feature break down. The set of all possible features are broken down into three sub sets in my head: Will be in first release, Will be in a later release, Will not be in at all. The things that will be in the first release are as follows.

    Things that will be in initial release

    • Client Input Prediction, A custom fixed timestep input scheme has been developed to avoid any temporal aliasing (this means 100% smooth movement, locally)
    • Remote Entity Interpolation, makes the game resitant to packet loss and lag, also includes animation and event synchronization.
    • Lag Compensation, Will allows clients to aim where their opponents are on their screen, instead of leading targets to manually compensate for lag.
    • Custom Character Controller, loosely based on my RPG Controller assets character motor I've ported it to work better in an FPS setting, this gives you unrivaled movement precision and smoothness compared to the existing Rigidbody and CharacterController based ones.
    • Hitboxes, this is a fine grained hit box implementation which can already be seen in my "Rewinder" asset, which allows you to identify both hits on different body parts but also hits close to a person to play special effects like suppression screen effects or ricochet sounds.
    • HUD, a very modern UI with a lot of features will be available, some of the highlights are: Several different types of cross-hairs that also react to recoil, "Blood Splatter" effect when shot, Minimap/Radar with several different zoom levels (BF3-style), Sniper scope with high quality scope textures. An early, unfinished version of the HUD can be seen here: http://dl.dropbox.com/u/19877504/FpsHudDemo/WebPlayer/WebPlayer.html. The HUD will also be sold separately for people that just want to get a hold of it.
    • Hitscan Weapons, this is your standard "raycast" weapons which don't have a bullet travel time, supported features for the weapon system are things such as Vertical/Horizontal recoil patterns, Recoil decay, Fire RPM, Min/Max recoil, integration into HUD for expanding cross-hairs, etc.
    • Grenades / Projectile Weapons, support for grenades and other "one-shot" projectile weapons, these do not use hitscans but rather bounce/fly around the level and then land and explode.
    • Console, An pretty standard "FPS Console" like you can see in most games and bring down on a key-press, it also supports "rcon" (with password) for logging into the server console and running commands on the server from a remote client.
    • Multiplayer level loading, Allows you to load maps, restart games, etc. and have all clients take the appropriate actions.
    • This is just a list of the highlights, a lot of other things that are mandatory such as spawn systems, connecting to servers, configuration, etc. are also included but if I were to list every tiny feature the list would become huge

    Is there anything that is missing on this list that any of you would consider a "must have" feature? Specifically things available from the other FPS kits that I may have missed, etc.
     
    Last edited: Aug 7, 2012
  44. dreadt9

    dreadt9

    Joined:
    Jan 13, 2012
    Posts:
    143
    Possibly Knifing? Also any chance of a offline mode where you can fight enemy AI's?
     
  45. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Melee weapons, check. Will make sure that works. Offline is possible already, but I'm not going to write a Bot AI sorry (too much work).
     
  46. EiKON-Andy

    EiKON-Andy

    Joined:
    Nov 13, 2010
    Posts:
    66
    Apologies in advance for asking this - I know how frustrating a question it is...! Do you have an estimated release date? If you are still unsure at present, I will sit back and try and be patient :)
     
  47. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    I planned to have it finished before my vacation was done, but I had a couple of other assets in the pipeline and the HUD took longer then I expected. It will probably be as long as 3-4 weeks before it's done as I'm forced to spend 8-10/h day at my day job (the horror!)
     
  48. EiKON-Andy

    EiKON-Andy

    Joined:
    Nov 13, 2010
    Posts:
    66
    Hehe, I know that feeling! Thanks!
     
  49. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191


    I'm very glad to hear that a melee feature will also be available. That will be very awesome with the hitbox feature, going to be possible to chop off limbs!

    Must haves (for me anyway):
    - Seamless stand/crouch/prone stances
    - Vault/hurdle over obstacles (BF3)
    - Bullet penetration
    - Item interaction, ie picking up ammo, medkits, weapons, upgrades, etc.
    - Object interaction, ie pushing buttons, levers, etc.
    - Dual wield
    - Weapon/item upgrade system

    Of course I'd like everything to be easily tweak-able in the inspector as well.

    Other requests:
    - Noise level feature, ie noise level increases/decreases depending on player stance and movement (maybe using OverlapSphere) sphere size gets bigger/smaller and NPC's will react if within the sphere. Something that can be used with an AI package for NPC behaviors.
    - Hide in the shadows feature, ie Visibility level is lower when you are in shadow/low light areas, for used with an AI package for NPC behaviors.
    - Low gravity/moon walk
    - Drop-able items
    - Movable objects/items like in HL2/Skyrim
    - Decal and FX system
    - Wall climbing/running feature (mirrors edge)

    That's just the on top of my head list. Looking forward to the initial release.
     
    Last edited: Aug 7, 2012
  50. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052