1 of 16

Group 2

B07901028 黃靖傑

B07901122 王譽凱

B07901133 顏子鈞

ICN Final Project

2 of 16

Outline

  • Game server
  • Game client
  • Problem encountered and resolve
  • Network optimization
  • Work distribution

3 of 16

Game server

- IP address

- port

request4

request1

request3

request2

ID 1, time = 5 min

ID 2, time = 4:50

ID 3, time = 4:45

ID 4, time = 3:00

4 of 16

Server’s job

In game action

In game action

In game action

In game action

  • Receive every change made by client
  • Compute final game logic
    • Gun position
    • Player position & movement
    • Player status
    • shots, bombs
    • Progress bar, Game time

​

Game information

Game information

Game information

Game information

UDP

TCP

Data that can’t tolerate latency: UDP

Data that can tolerate latency: TCP

​

5 of 16

Game Client

TCP/UDP

Press B to bomb people -->

application received input 🡪

encode packet --->

send to server

Server send all game logic

CHANGED in the previous frame

  • Other player position & action
  • Bomb instance/Gun projectile
  • Progress bar increase
  • Many more….
  • Collect all client’s information and integrate into one packet to reduce Bandwidth usage

6 of 16

�player’s self logic & other player’s logic

  • For a particular in game utility (such as dropping bomb)

when we handling such utility, separate into 2 script:

- 1 for handling self’s input to change scene

- 1 for handling other player’s input to change scene

​

with this, we can resolve conflict of our gameplay, as:

- when game application receive input from player, change scene

- when game application receive packet from server, change scene

*won’t render bomb twice at a same time.

7 of 16

We preserved all IN GAME utility in our multiplayer mode of Launch the Rocket (that TA has done!) �

  • Player position & movement
  • Red team gather resource’s animation & head icon changed
  • Red team update progress bar, all other player’s progress bar also update
  • Render the rocket image according to value of progress bar
  • Red team and blue team can put bomb
  • Blue team can show/hide gun, and display gun’s pointing direction
  • Blue team can fire gun, bullet projectile can be seen by all player
  • Resource collected by red team will disappear if player getting damaged
  • Red/blue team getting damaged will display the “stunned” animation

​

8 of 16

Improve Gameplay logic by our own consideration

  • Gun & bomb has a cooldown set to 2.1sec

(for balance gameplay)

  • Include red/blue team friendly fire

9 of 16

Network optimization

  1. Consider RTT of our data transfer delay to any game logic that is

SENSITIVE to time.

​

Example: Game Timer

  • If the remaining timer = 270s, RTT = 0.1s
  • Server will broadcast the timer as (270-0.1/2) = 269.95s to all player.
  • If player drop a bomb (that triggers explosion after 2 sec)

- Server will broadcast the explosion timer of bomb as

(2-0.1/2) = 1.95s to all player.

10 of 16

Network optimization (Cont’)

2. game object Interpolation

Network traffic busy -> PACKET LOSS!

​

​

Example:

​

Actual player position: (0,0,0) -> (2,0,0) -> (4,0,0) -> (4,2,0) -> (4,4,0)

Likely scenario when packet loss occur:

Other player received: (0,0,0) -> x -> x -> (4,2,0) -> (4,4,0)

Teleport?

11 of 16

Network optimization (Cont’)

2. Game object Interpolation

  • What we improve is:

Next position = 0.7*(previous position) + 0.3*(actual position)

(0,0,0) -> (0,0,0) -> (0,0,0) -> (1.2, 0.6,0) -> (2.04, 1.62,0) -> (2.628, 2.334,0)

-> ….. -> (4,4,0)

​

What we can achieve: smoother display (less lagging)

*more frame will be produced*

12 of 16

Network optimization (Cont’)

3. Tune our packet transfer rate

  • Tradeoff between rate of game logic update vs. packet loss probability
  • Goal: Not affecting gaming experience
  • Reduce server’s burden (send TOO MUCH packet/s)
  • Reduce probability of packet loss in busy network traffic

​

30 packet/s 🡪 20 packet/s 🡪 15 packet/s

13 of 16

Conclusion

  1. Clients do most game decisions while servers only provides enough information
  2. Status of client side is prior to status sent from server
  3. Pros: Reduce loading of server, reduce latency
  4. Cons: this may cause some inconsistency among all clients

14 of 16

Work distribution

靖傑

譽凱

子鈞

Game server implement

Game server modify

Report

處理各種game logic / display游戲畫面 / unity platform的設置(modify prefab component等等)

Network optimization for providing better QoS

各種bug tracking, 我們都會互相溝通和討論

15 of 16

�----------------Demo Phase----------------�Thanks for your attention!

​

16 of 16

For Mac users

if there’s problem when opening the game:

  1. open terminal
  2. type “sudo chmod -R 777 <file direction>”
  3. at SystemsPreference/security&privacy/general
  4. allow the app