Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party Photon networking for fighting game?

Discussion in 'Multiplayer' started by HKSpadez, Oct 16, 2014.

  1. HKSpadez

    HKSpadez

    Joined:
    Apr 24, 2013
    Posts:
    87
    Hey guys,

    I'm creating a sort of fighting party game. and fighting games are pretty sensitive to lag.

    i'm currently planning to use photon. any ideas? is it powerful enough to handle something so sensitive? or is there a better networking solution.

    and if it is. i know most of the "netcode" will be finding ways to handle the lag gracefully so the users dont see/feel it as much.

    are there any guides for making networking/synchronization between players as smooth and lagless as possible?
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    If some solution is acceptable for your type of game and your personal taste can't be judged in general. You will have to try out things. Sorry.

    As tip for networking lag:
    In your case, I'd hide the lag by sending the input (e.g. "kick") immediately but execute it locally about ~100ms later. This gives the network message a headstart to travel to the other(s) and a fixed delay between 50ms and 150ms is hardly noticed (if the delay is fixed, that is).
     
  3. HKSpadez

    HKSpadez

    Joined:
    Apr 24, 2013
    Posts:
    87
    ohhh thats a smart way to handle lag. explains alot for fighting games like marvel and such. thanks!
     
  4. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    The way that I'm doing lag handling in my action-combat game is allowing a buffer of 200ms when the server calculates things such as damage, I take the targets position, the attack range, and the targets movement speed to calculate rather or not it was possible for the client to have hit something else.

    I then take the movement speed of the target and divide it by 5. ( I use Time.deltaTime for movement, so this effectively cuts it into how far a player could have moved in 200ms ) I then perform a calculation on the radius of the target based on that movement speed (The one that was divided by 5). The last thing that I check is if the attack range of the attacker could have reached inside of that radius, if it can then dealing damage over the network was a success.