11.01.2013 Views

Dynamic Bayesian Approach for Detecting Cheats in Multi-Player ...

Dynamic Bayesian Approach for Detecting Cheats in Multi-Player ...

Dynamic Bayesian Approach for Detecting Cheats in Multi-Player ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

16<br />

17<br />

18<br />

19<br />

20<br />

21<br />

22<br />

23<br />

24<br />

25<br />

26<br />

27<br />

28<br />

29<br />

30<br />

31<br />

32<br />

33<br />

34<br />

35<br />

36<br />

37<br />

38<br />

39<br />

40<br />

41<br />

42<br />

43<br />

44<br />

45<br />

46<br />

47<br />

48<br />

49<br />

50<br />

51<br />

52<br />

53<br />

54<br />

55<br />

56<br />

57<br />

58<br />

59<br />

60<br />

61<br />

62<br />

63<br />

64<br />

65<br />

10 S.F. Yeung, John C.S. Lui<br />

obta<strong>in</strong>ed directly, or derived from the game states conta<strong>in</strong>ed<br />

<strong>in</strong> the update packets by various players. For example, by<br />

compar<strong>in</strong>g the current position and the latest recorded position<br />

of a player, we know whether the player is mov<strong>in</strong>g<br />

or not. Dur<strong>in</strong>g a game session, a player will meet different<br />

targets <strong>in</strong> the virtual world, and it is very common to meet<br />

more than one target at the same time. We def<strong>in</strong>e a player’s<br />

current target as the latest target the player’s crosshair hov-<br />

ered over. To illustrate, let player A’s crosshair hovered over<br />

player B, then <strong>for</strong> player A, ˜<br />

TargetA = B until player A’s<br />

crosshair hovered over another player or player B became<br />

<strong>in</strong>visible to player A. The variables Distance (D) and Accuracy<br />

(A) are both derived aga<strong>in</strong>st this current target. Also, <strong>for</strong><br />

those random variables hav<strong>in</strong>g cont<strong>in</strong>uous values, i.e. Distance<br />

(D) and Accuracy (A), we discretize them <strong>in</strong>to a f<strong>in</strong>ite<br />

field. There<strong>for</strong>e, <strong>in</strong> tra<strong>in</strong><strong>in</strong>g the dynamic <strong>Bayesian</strong> network,<br />

we need to consider the follow<strong>in</strong>g random variables which<br />

take on the follow<strong>in</strong>g values:<br />

1. Cheat<strong>in</strong>g (C), with C ∈ [true, false],<br />

2. <strong>Player</strong> mov<strong>in</strong>g (M p ) with M p ∈ [true, false],<br />

3. Target mov<strong>in</strong>g (M t ) with M t ∈ [true, false],<br />

4. Mov<strong>in</strong>g crosshair (△P ), with △P ∈ [true, false],<br />

5. Distance from the aim<strong>in</strong>g target (D), with D ∈ [0, 1, 2, 3]<br />

<strong>in</strong> which larger the value implies further away is the distance,<br />

6. Change <strong>in</strong> D (△D), with △D ∈ [0, 1, 2, 3],<br />

7. Aim<strong>in</strong>g accuracy (A) with A ∈ [0, 1, 2, 3] <strong>in</strong> which the<br />

lower the value implies higher is the aim<strong>in</strong>g accuracy<br />

and,<br />

8. Change <strong>in</strong> A (△A) with △A ∈ [0, 1, 2, 3].<br />

Us<strong>in</strong>g these data, one can compute the follow<strong>in</strong>g prior<br />

probability distributions:<br />

1. P(Ct|Ct−1), and<br />

2. P(At|At−1, Ct, M p<br />

t , Mt t , Pt, Dt, △Dt, △At),<br />

Inferr<strong>in</strong>g the probability of cheat<strong>in</strong>g <strong>for</strong> any particular player<br />

follows the follow<strong>in</strong>g steps. At the very first time slice where<br />

t = 0, we <strong>in</strong>itialize P( ˜ C0 = true) to 0.5 (i.e., a player is<br />

equally likely to be a cheater or an honest player). For each<br />

time slice t, the <strong>in</strong>ference carries out <strong>in</strong> two stages:<br />

Stage 1: estimates the outcome of ˜ Ct based on Ct−1, ˜ this<br />

estimation can be carried out by the follow<strong>in</strong>g equation:<br />

P(C1 = T)<br />

= P(Ct = T |Ct−1 = T)P(Ct−1 = T)<br />

+P(Ct = T |Ct−1 = F)P(Ct−1 = F)<br />

Stage 2: updates ˜ Ct with all of the evidences at time slice t.<br />

This computation can be carried out by the follow<strong>in</strong>g equation:<br />

P(Ct = true|At, At−1, M p<br />

t , M t t,Pt, Dt, △Dt, △At)<br />

= P(at|at−1, Ct, m p<br />

t,m t t, pt, dt, △dt, △at)P(Ct = true)<br />

�false c=true P(at|at−1, Ct = c, m p<br />

t,m t t, △dt, dt)P(Ct = c) .<br />

The pseudo-code to per<strong>for</strong>m this <strong>in</strong>ference computation<br />

on the game server is as follows:<br />

Server Loop<br />

1. while (gameover == false) {<br />

2. <strong>for</strong> each player() {<br />

3. playerStates = receive player state update();<br />

// stage 1 computation based on Eq. (1)<br />

4. pPredict = cptCheat<strong>in</strong>g[cheat<strong>in</strong>g] * pCheat<strong>in</strong>g[t-1]<br />

+ cptCheat<strong>in</strong>g[!cheat<strong>in</strong>g] * (1.0 - pCheat<strong>in</strong>g[t-1]);<br />

// stage 2 computation based on Eq. (2)<br />

5. T = cptAccuracy[playerStates][cheat<strong>in</strong>g]<br />

* pPredict;<br />

6. F = cptAccuracy[playerStates][!cheat<strong>in</strong>g]<br />

* (1.0 - pPredict);<br />

7. pCheat<strong>in</strong>g[t] = T / (T + F);<br />

8. }<br />

9. timeframe++;<br />

10. }<br />

Computational Analysis: Based on the above pseudo-code,<br />

we see that to estimate the cheat<strong>in</strong>g probability, we require a<br />

total of n<strong>in</strong>e float<strong>in</strong>g po<strong>in</strong>t operations (from l<strong>in</strong>e 4 to l<strong>in</strong>e 8)<br />

per player with<strong>in</strong> each time slice. One can easily see that<br />

this is a light weighted computation. Assum<strong>in</strong>g that each<br />

time slice is 40 ms, i.e. 25 frames per second, this implies<br />

that to detect 100,000 simultaneous players, it only requires<br />

9 ∗25 ∗100, 000 = 22, 500, 000 float<strong>in</strong>g po<strong>in</strong>t operations per<br />

second. Us<strong>in</strong>g a P4 2.0GHz server as an example, which can<br />

per<strong>for</strong>m about one billion float<strong>in</strong>g po<strong>in</strong>t operations per second,<br />

there<strong>for</strong>e the overhead to detect 100,000 simultaneous<br />

players uses only 22.5% of the CPU capacity.<br />

For example, <strong>in</strong> commercial games such as counter-strike<br />

and Quake, the game clients send all commands (keyboard<br />

<strong>in</strong>puts) to the server. The server runs the simulation of the<br />

whole game because all game states must be authorized by<br />

the server be<strong>for</strong>e the server broadcasts the <strong>in</strong><strong>for</strong>mation to<br />

other players. There<strong>for</strong>e, the server already knows the position<br />

and the aim<strong>in</strong>g direction of all players at each <strong>in</strong>stance<br />

of the game. In our proposed method, the only additional<br />

computation requires to per<strong>for</strong>m prior to the <strong>Bayesian</strong> <strong>in</strong>ference<br />

rout<strong>in</strong>e is to compute the “distance between a player’s<br />

aim<strong>in</strong>g trajectory and the player’s current target”, i.e., the<br />

player’s accuracy. That is, to compute the distance between<br />

a po<strong>in</strong>t and a l<strong>in</strong>e which <strong>in</strong>volves a cross-product operation.<br />

Moreover, as we mentioned be<strong>for</strong>e, the computation only<br />

occurs when there is any visible target, and the server only<br />

needs to trace the accuracy with respect to the current target,<br />

until it is not visible to the player or their distance is<br />

beyond a certa<strong>in</strong> threshold. Also, <strong>for</strong> FPS games the number<br />

of players <strong>in</strong>volved <strong>in</strong> the same game session typically<br />

varies from 8 to 32. Hence, the computational overhead <strong>in</strong>duced<br />

should not be much. Moreover, <strong>in</strong> practical implementation<br />

one could create an <strong>in</strong>dividual queue to store a copy<br />

of the user states, and then carries out the computation of<br />

the player’s accuracy and also the <strong>Bayesian</strong> <strong>in</strong>ference rout<strong>in</strong>e<br />

<strong>in</strong> a computational thread, which is separated from the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!