playMaker

Author Topic: Photon - Hit Delay With Street Brawler  (Read 1903 times)

kavery

  • Full Member
  • ***
  • Posts: 149
Photon - Hit Delay With Street Brawler
« on: July 19, 2016, 09:30:16 AM »
So after many weeks of persistence I finally have my street brawler working with photon. Player and enemy positions are well synced but now I'm faced with the ever familiar lag issues.

The game is a 3D take on the traditional street brawler .. but you can walk and fight in multiple directions. Each player spawns a number of enemies, so a typical moment involves a few enemies that are 'yours' and a few that are not. The problem delay occurs when the player you are controlling fights an enemy that is not yours. There is of course delay that kills the feeling of impact as you punch. The impact happens when you bring your fist back.

Since you can't use client side prediction with a fighter, I'm not sure where to go with it. I've done a bunch of reading but not sure how to pull off something in playmaker. Maybe a rollback method?

I'd love to know of a way to make all enemies 'yours' but I'm not sure if that's possible while maintaining the network sync. I could spawn enemies only from my side, but then player 2 would fight only non-owned enemies?


Sid

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Photon - Hit Delay With Street Brawler
« Reply #1 on: July 19, 2016, 10:40:55 AM »
Hi.  Your game sounds cool.

Why are not all the enemies spawned by the host?  What is the advantage of having client-spawned enemies?

Why can't you use client-side prediction in your fighter?  You could set it so when the client collides with a hitbox on their end that the reaction is instant and the delay is at least only seen by other players. 

Have you tried increasing your Photon send rates?  You could set them to 100 to see if that helps with the lag.

Actions:
Photon Network Set Send Rate
Photon Network Set Send Rate On Serialize

kavery

  • Full Member
  • ***
  • Posts: 149
Re: Photon - Hit Delay With Street Brawler
« Reply #2 on: July 19, 2016, 12:55:28 PM »
Thanks Sid.. I had no idea about setting the transfer frequency. I will look into that tonight.

I have clients spawn enemies as a way to test the difference in behavior, and also to balance enemy count per player, but I certainly don't have to do it that way.

I might be missing some understanding of how ownership works, but it seems if I spawn by host, other players will always face the lag problems when fighting those enemies. I have seperate FSMs active depending on owned or not owned. The not owned FSM is designed to receive instructions, the owned sends.

The local hitbox thing might work if I can tighten up the location sync just a tad more. If you are in a slightly different location, the hit doesn't register. I don't mind if the hits are off for the other view.. as long as the player you control and the corresponding opponent feels responsive. 

« Last Edit: July 19, 2016, 01:08:54 PM by kavery »

kavery

  • Full Member
  • ***
  • Posts: 149
Re: Photon - Hit Delay With Street Brawler
« Reply #3 on: July 20, 2016, 08:13:42 AM »
So I changed the send rates from 20 and 10 to 40 and 20... things are so much  more responsive now. I'm also only spawning from the host.

It feels great to finally have this network stuff in order after many weeks of thinking I was done and realizing I was nowhere close. It's a long struggle but worth it!