Author Topic: Primary weapon lag in multiplayer  (Read 5005 times)

0 Members and 1 Guest are viewing this topic.

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Primary weapon lag in multiplayer
This is one of the bigger problems with multiplayer FS2 right now and eventually needs to be addressed in some way. If you aren't familiar with the issue, for players other than the host, it can be quite difficult to hit fast moving targets like fighters with primary weapons. This is basically caused by a combination of lag and the low object updates, as the fighter's true location is somewhere in front of what the client sees. It can be partially mitigated by firing in front of the target, so that the shots appear to pass in front of it on the client side, but this becomes hard to do when the ping is more than about 100 or is simply varying a lot.

I can think of a couple of possible solutions:

1: Modify the target lead indicator on the HUD so that it not only takes the target's speed into account, but also the current ping time, and interpolates the fighter's true location from that. This wouldn't help with hitting fighters that are turning a lot, but it would be a major improvement over what we have now. This is probably the easiest solution to implement.

2: Do all primary weapon calculations on the server side, not only the hits but also the movements. Almost all commercial FPS games do it this way. There would now be a slight delay between when you fire and when your weapons actually appear, but they would be more accurate after they show up. Note that secondary weapons in FS2 are already done like this and don't suffer from the whole issue.

3: Do all primary weapon calculations on the client side. This is not done in most games since it's more vulnerable to cheats and gives an edge to people with bad connections over those with good ones, but it's one option.

 

Offline Turey

  • Installer dude
  • 211
  • The diminutive form of Turambar.
    • FreeSpace Open Installer Homepage
Re: Primary weapon lag in multiplayer
2: Do all primary weapon calculations on the server side, not only the hits but also the movements. Almost all commercial FPS games do it this way. There would now be a slight delay between when you fire and when your weapons actually appear, but they would be more accurate after they show up. Note that secondary weapons in FS2 are already done like this and don't suffer from the whole issue.

I think it already does this for both primaries and secondaries.
Creator of the FreeSpace Open Installer.
"Calm. The ****. Down." -Taristin
why would an SCP error be considered as news? :wtf: *smacks Cobra*It's a feature.

  

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Primary weapon lag in multiplayer
Maybe I didn't phrase it the right way. Right now, the primary weapon fire timings are done independently on the server and client ends. This doubles the effect of the lag in some sense. The client sees the fighter somewhere and aims at the lead indicator, even though the true (server) position of the fighter is not exactly at the same spot. When the client hits the fire button, the shots appear immediately on his end, but they show up on the server, say, 150ms later. So the client effectively sees the offset between his shots and the target by 300ms on his end. The secondary weapon firing, in contrast, seems to be synchronized between the client and server, and the missiles will only appear on the client side after they're registered on the server.

Now that I think about it though, #1 is probably the best solution despite being the simplest one to add in. #2 may not necessarily improve things any, and #3 would work very well in co-op but would mess up TvT and dogfight to some degree.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Primary weapon lag in multiplayer
So make #3 be default in co-op, #2 in TvT and dogfight, and #1 for all.

 

Offline Turey

  • Installer dude
  • 211
  • The diminutive form of Turambar.
    • FreeSpace Open Installer Homepage
Re: Primary weapon lag in multiplayer
So make #3 be default in co-op, #2 in TvT and dogfight, and #1 for all.

Uhhhhh... no. There's no way we're doing #3 for ANYTHING. Even in Co-op, it'd allow for cheating and easy kills.

I vote #1. I'll look into implementing it.
Creator of the FreeSpace Open Installer.
"Calm. The ****. Down." -Taristin
why would an SCP error be considered as news? :wtf: *smacks Cobra*It's a feature.

 

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
Re: Primary weapon lag in multiplayer
Maybe try something crazy like...

On server side, for each primary hit on Client, adjust:
DamageMade = OriginalDamage / max(1, (DamagedClientPing*C1-ShootingClientPing*C2)/C3)
Where C3 = about 70..100ms, C1 and C2 adjusted by trial and error :D :P

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Primary weapon lag in multiplayer
you could probibly generate lead solutions for both server and client, then simply average the 2 with some vector intrepolation. then to nullify server host-advantage, the host's lead solution is averaged with a lead solution based on an average of all the client's positional data. that way the server's lead solution is only as good as that of the average client.
« Last Edit: September 27, 2007, 12:54:45 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Primary weapon lag in multiplayer
The lead for each is most likely generated on each machine independently. In which case you shouldn't touch the server side code at all.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Primary weapon lag in multiplayer
i wonder if you could scale the weapon velocity to the clients ping. pingyer clients shots will be slightly faster to compensate for lag. if you have really fast ping, like if youre the host. then youre weapon shots slow down and more lead must be done to make the hit.

ping is the biggest factor on how fair the gameplay is people with lower ping will always have the advantage. o this idea gives a little bit more fairness back to people with slow connections. on the other hand it still does nothing to improve the accuracy of the lead indicator.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: Primary weapon lag in multiplayer
100+ ping? Sounds to me like the problem is everyone using dialup... in BF1942 multiplayer ping rarely exceeds 50.

If you're playing on a dedicated server (I don't know if SCP allows this) then you should not have those ridiculous numbers. Or it may be that the SCP team never gotten around to fixing FreeSpace's oldest problem, mutliplayer slowdowns.

 

Offline Turey

  • Installer dude
  • 211
  • The diminutive form of Turambar.
    • FreeSpace Open Installer Homepage
Re: Primary weapon lag in multiplayer
If you're playing on a dedicated server (I don't know if SCP allows this)

No one is playing on a dedicated server.
Creator of the FreeSpace Open Installer.
"Calm. The ****. Down." -Taristin
why would an SCP error be considered as news? :wtf: *smacks Cobra*It's a feature.

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Primary weapon lag in multiplayer
Yeah, that feature is broken at the moment. The high pings are probably due to the overseas connections. Although in most games you can still hit targets pretty effectively with 100-ish pings, much better than in FS2.

 

Offline captain-custard

  • previously known as andicirk
  • 210
  • one sandwich short of a picnic
Re: Primary weapon lag in multiplayer
my ping on average in the saturday night game is around 120- 150 depending on whos hosting, im not on dial up , ok my connection is not the fastest in the world but its ok.......... i still manage to hit things even in dogfights, i dont win  but i still leave with a serious grin on m face,

just to say thanks to all who are trying to get these multiplaer issues sorted


 :D
"Duct tape is like the force. It has a light side, a dark side, and it holds the universe together."