Serverside Hit Detection
-
So, after a sleepless night I have figured out how to make hit detection completely serverside.
First: What is serverside hit detection?
Freelancer uses client side only hit detection, that means the server trusts the client 100% on wether the client scored a hit. Of course this can be abused, you can send the server whatever hit-info you want. That is why a lot of weapon/projectile related cheats are possible and working.
Serverside hit detection now does no longer trust the client in any way. What Iam doing here is basically the same the server does for the NPCs: First, it is being checked if you are allowed to fire (taking in account weapon energy, weapon angle, refire rate, etc…) - then the server creates a new beam to calculate the projectile. Client-hit data is completely ignored.Drawbacks:
Problems can occur because of sync issues between the client and the server. (for example you see your lasers hit, but they dont danage anything)
Main reason this can happen is lag/ping. I tested it with a 40ms ping and I didnt really notice any issues - in fact it ran surprisingly well.Anyways, if you want to help test this, especially if you are far away from Europe with a high ping, Ive put up a server.
Feel free to test any weapon-mod related cheats!IP/PORT: 193.192.58.150:2303
-
You know, I’m not big on FLHook, simply because I’m not a multi-player fan, but I think this is a great development. I wasn’t aware of this problem, but having this fix, combined with custom SURs, makes the hit detection far more accurate. Well done.
MK
-
So, after a sleepless night I have figured out how to make hit detection completely serverside.
Lol yes, saw you still being online this morning around 8:30ish.
Other than that, its a great thing that this issue, wich has been abused by some baaaad individuals, is taken care off now.
I can immagine indeed with low ping / lag players that this feature won’t work that good as more info has to be send from server to client and vise versa wich makes the player lag even more and possible get kicked for lag or lag mods (download managers etc) …You might consider putting a timer on it, so that the server detects a gun shot at a object and if the player passes it stops the check on that player.
-
Sounds GREAT!
;D -
Yes, it means additional serverload. How much I dont know yet…
I can immagine indeed with low ping / lag players that this feature won’t work that good as more info has to be send from server to client and vise versa wich makes the player lag even more and possible get kicked for lag or lag mods (download managers etc) …
No additional data is being sent. Only more processing power on the server is needed.
-
Wow Wodka strikes again
How about making a admin command to turn this specific feature on/off (only if its causes high serverload)?
-
I’m guessing the addition will probably be released in due time in its own plugin or as a feature in the AC plugin, which then can be deactivated through the config INI.
-
Yes i know, i means via command like .load sshd / .unload sshd for securitys and admins this would allow to turn the feature on when u need it.
-
PS: I deactivated missiles on the test server due to spam abuse
now that can be discussed…as my opinion is that there is nothing as spam abuse…FL was created the way that u could use missiles…
Good luck with that theory M8, Freelancer has no Magic pill any other online sim has ever thought up. Real time High Speed Missiles just don’t translate to a virtual environment with lag that at times is as long as one and a half second full loop. So even one missile from your buddy in Sidney will kill you before your client even has a chance to pretend to fire a countermeasure. Tossing in a half dozen missiles is just plain overkill. Client side hits make this a certainty, but seen it done on host side hit scheme as well as hybrid hit scheme. None can handle missiles with the current internet speeds outside of the 1/4 speed simulations. And I have to ask, anyone else here tried to fight a 1/4 speed aircraft dogfight?? Trust me, you will go bald, or Hoarse from screaming at the thing to hurry up…
So in sad truth, in Multi-player, any Missile use is really an example of abuse…
-
Yes, it means additional serverload. How much I dont know yet…
I can immagine indeed with low ping / lag players that this feature won’t work that good as more info has to be send from server to client and vise versa wich makes the player lag even more and possible get kicked for lag or lag mods (download managers etc) …
No additional data is being sent. Only more processing power on the server is needed.
Sorry on Double Post, last one was off kuff a bit and I forgot to add this… ::)
I like Host side Hit detection, it will add server load no way around it. But it will also “Shorten the Loop” as the data now does this in a “Serial” fashion.
Client2 Position > Server > Client1 (Hit Calc) Client1 > Server > Client2 {Report Hit}
It will Shorten to this “Parallel” fashion…
Client1 Position > +
Client2 Position > Server (Hit Calc) Server > Client2 {Report Hit}Both cases Client1 fires, Client2 gets shot ;D
-
Anyways, if you want to help test this, especially if you are far away from Europe with a high ping, Ive put up a server.
I tested it and less than half of the shots that I saw hit the target actually damaged it. I had a 198ms ping though. Which may explain how badly I did in PvP against Woodoo, who was also on the server.