Forum

> > CS2D > General > on lost bullets and "buffered shots"
Forums overviewCS2D overviewGeneral overviewLog in to reply

English on lost bullets and "buffered shots"

12 replies
To the start Previous 1 Next To the start

old on lost bullets and "buffered shots"

aperson
COMMUNITY BANNED Off Offline

Quote
cs2d has a protection mechanism where if a (hacking) client fires too quickly, some of his bullets are ignored

basically, a normal client's firing pattern looks like: (horizontal axis is time, 'x' is a fired bullet)
x-----x-----x-----x-----x-----x
and the server is fine with that. all the bullets are registered.

a hacking client could potentially do this:
x-x-x-x-x-x-x-x-x-x-x-x-x-x
i.e. firing at a much higher rate
the server recognizes this and drops bullets if they are too close together. so the bullets that the server keeps look like
x-----x-----x-----x-----x--

this prevents hackers from gaining an advantage by increasing the rate of fire.
sounds good right? well it is a good idea. however, there is the issue of network instability (i.e. fluctuating ping/latency).

a normal client may do this:
x-----x-----x-----x-----x-----x
and the server could potentially get something like
x----x-------x---x------x------x
now for the 2nd and 4th bullets, the time between them and the previous bullets is lower than usual. this not due to hacking but due to fluctuating latency. unfortunately, the cs2d server can't tell the difference and ends up dropping those bullets.

the bullets that actually do damage look like:
x------------x----------x------x

this is what is going on here (a very extreme example):
http://www.youtube.com/watch?v=iohPyxKoyb8

in cs2d b0.1.1.9 this was added:
Quote
ADDED
Attack buffer to minimize server sided attack packet drops


however, the behavior of this attack buffer is quite weird actually. the dropped bullets get put in a the "attack buffer" and the bullets in the buffer get fired every second after the client stops shooting.

for the previous example:
a spectator would see this pattern of bullets:
x------------x----------x------x-----(1second)-----x-----(1second)-----x

anyway, this is how it would be like ideally:
the server receives:
x----x-------x---x------x------x
these are the ones usually dropped
-----*-----------*--------------
ideally, it would look like
x-----y------x-----y-----y-----x

DC if you want i'll post some pseudocode later for how to implement this

old Re: on lost bullets and "buffered shots"

aperson
COMMUNITY BANNED Off Offline

Quote
user Time has written
How come I've never seen anyone hack the rate of fire?

because if anyone did, the server would drop the bullets that come too fast. those dropped bullets aren't seen by other players and spectators.

old Re: on lost bullets and "buffered shots"

Time
User Off Offline

Quote
Well then, why would anyone hack rof if they cannot use it? I'm sure that anyone who would be able to hack it is already aware of the protection mechanism and not even bother.

old Re: on lost bullets and "buffered shots"

aperson
COMMUNITY BANNED Off Offline

Quote
user Time has written
Well then, why would anyone hack rof if they cannot use it? I'm sure that anyone who would be able to hack it is already aware of the protection mechanism and not even bother.

exactly

anyway that's not the main point of this thread

old Re: on lost bullets and "buffered shots"

Torque
User Off Offline

Quote
apersons suggestion would make the game a lot more fair since different people have different amounts of 'loss' on the same server.
It would certainly be a step forward for the game!

old Re: on lost bullets and "buffered shots"

DC
Admin Off Offline

Quote
I simply was too lazy to save which weapons have been used for those shots to get the right timings. I guess it's no big deal to change this.

old Re: on lost bullets and "buffered shots"

gotya2
GAME BANNED Off Offline

Quote
My idea: use a leaky bucket to make sure all bullets are conforming the time constraints of the weapon's rate of fire. http://en.wikipedia.org/wiki/Leaky_bucket

The rate of the leaky bucket should be adjustable to the weapons ROF.

Next thing: hit detection should be done on the clientside to account for high pings. The server should verify if the hit was possible to some extends. The hit doesn't have to be perfect, but if the bullet is close to the enemy then it should account as a hit. The delayed view of a client of the total gamestate isn't troublesome anymore.
This also addresses the issue of the failing lag compensation.

old Re: on lost bullets and "buffered shots"

DC
Admin Off Offline

Quote
@user gotya2: The current implementation equals "leaky bucket" (I only took a look at that picture and I knew it). Only the ROF is ignored. The "leak rate" is 1 sec because I was too lazy for a better implementation (see my previous post).

Also this is no suggestion thread so please don't go off-topic by suggesting additional improvements. Just to comment it anyway: client sided decision making is always a very very very bad idea (when taking about decisions which are crucial for the gameplay). It can be hacked to a minimal extent to improve the own accuracy and this sucks very hard and is totally no option. There is a server sided lag compensation which simply needs to be improved/fixed.

Fun story: The old CS2D version (non max) actually had something like that implemented at some point and time.

old Re: on lost bullets and "buffered shots"

aperson
COMMUNITY BANNED Off Offline

Quote
user DC has written
I simply was too lazy to save which weapons have been used for those shots to get the right timings. I guess it's no big deal to change this.

hey i don't think it's too much effort to fix it. well i don't know how you implemented it but still the whole thing isn't too difficult.

besides doesn't the source already have the timings for each weapon since you need the timings for blocking the bullets that are too fast?

old Re: on lost bullets and "buffered shots"

DC
Admin Off Offline

Quote
Of course I have those timings in the code. I just have to save the buffered shots in another data structure (amount + used weapon instead of just the amount). That's basically it.

As I already said
user DC has written
I guess it's no big deal to change this.

old Re: on lost bullets and "buffered shots"

gotya2
GAME BANNED Off Offline

Quote
user DC has written
@user gotya2: The current implementation equals "leaky bucket" (I only took a look at that picture and I knew it). Only the ROF is ignored. The "leak rate" is 1 sec because I was too lazy for a better implementation (see my previous post).

Also this is no suggestion thread so please don't go off-topic by suggesting additional improvements. Just to comment it anyway: client sided decision making is always a very very very bad idea (when taking about decisions which are crucial for the gameplay). It can be hacked to a minimal extent to improve the own accuracy and this sucks very hard and is totally no option. There is a server sided lag compensation which simply needs to be improved/fixed.

Fun story: The old CS2D version (non max) actually had something like that implemented at some point and time.


Yes and many agree that the hit detection was much better in older versions. (pre 0.1.0.5)
If you look at modern hit implementations in current game, they are almost all based on clientside hit detection, and verification on the serverside ( battlefield 3, cs:source ( with rewinding ) ).

old Re: on lost bullets and "buffered shots"

aperson
COMMUNITY BANNED Off Offline

Quote
user DC has written
Of course I have those timings in the code. I just have to save the buffered shots in another data structure (amount + used weapon instead of just the amount). That's basically it.

As I already said
user DC has written
I guess it's no big deal to change this.

okay cool hope you can fix it by next version

actually it is quite a big deal in competitive cs2d. if 10% of your bullets get lost (due to shitty internet or whatever) you would be at a huge disadvantage. most players don't have this problem, but some, including myself, do and it's quite frustrating sometimes.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview