cs4344 09/10 lecture 1: introduction
DESCRIPTION
TRANSCRIPT
Lecture 1Introduction to CS4344
11 January 2010
1
About CS4344
3
• To learn about technical issues and solutions in networked/mobile game development
• Complements CS4213 “Game Development”
4
2 Hour Lecture10am - 12noon
5
We are at the frontier of the topic
6
No perfect textbook for this class. But we will use
7
SGD 180
8
SGD 160
9
10
Additional materials comes from online resources and
research papers.
11
So, don’t swallow everything you read (and I say) without
thinking.
12
35%
40%
25%
Final Exam Assignments Quizzes/Midterm
CS4344 Assessment
13
2
26
Lecture Prepare Homework
CS4344 Workload/Week (hours)
14
More info about assignments coming soon
15
http://blog.nus.edu.sg/cs4344/
16
Student Feedback
17
Overall Opinion
418
Likely Grade
4.219
Difficulty
3.720
Questions?
21
“Networked Games” ?
22
Games that involve more than one hosts
communicating over the network
23
24
Games that involve more than one player
communicating over the Internet/LAN
25
Turn-based Multi-player Games
26
Real-time Multi-player Gameshttp://www.gameslander.com/world-of-warcraft-game-review-94.phtml
27
We focus on real-time multi-player games in
CS4344
28
MMORPGhttp://www.gameslander.com/world-of-warcraft-game-review-94.phtml
29
First Person Shooterhttp://playstation3.files.wordpress.com/2005/12/Unreal-tournament-2007-screenshot4.jpg
30
Real-time Strategy Gamehttp://www.auran.com/games/images/frontline_fields_of_thunder/screenshots/large1.jpg
31
We focus on real-time multi-player games in
CS4344
32
and other similar applications
33
http://www.defenselink.mil/transformation/images/photos/photo_archive/index_2005-05.html
Military Training Simulator
34
Networked Virtual Environmenthttp://www.archiveshub.ac.uk/blog/2007_04_01_archiveshubblog_archive.html
35
interactive,distributed simulations
36
An Abstract Model for Networked Games
37
A generic loop for games
Collect Events
Simulate Game
Render
Wait
38
A generic loop for games
Collect Events
Simulate Game
Render
Wait
GameStates
events
states
39
Time
States
Can be viewed as a sequence of states that changes over time, in reaction to events.
40
Time
A state can be discrete or continuous.
State changes over time
41
Time
Example events: user input, timer, messages from other hosts.
42
Time
A host may send messages to other hosts.Message can be state or event.
43
Example: Two-player Pong
States: position of peddles and ball Events: movement
44
Player A
Player B
A moves peddle
B moves peddle
Ball hits peddle
45
BasicCommunication Architectures
46
Centralized Architecture
47
Player A
Client sends events to the server. Server computes new states and updates clients with new states.
Player B
Server
48
Player A
Client sends events to the server. Server computes new states and updates clients with new states.
Player B
Server
49
or
Collect Events
Render
Wait
GameStates
events
states
Simulate Game
GameStates
50
“Smart” server, dumb clients
Role of serverMaintain statesSimulate gamesNotify clientsResolve conflicts
51
Dumb server, smart clients
Role of serverNotify clientsResolve conflicts
Role of clientsMaintain statesSimulate games
52
Player A
Clients simulate and maintain states. Server resolves conflicts and forwards events to clients.
Player B
Server
53
Collect Events
Simulate Game
Render
Wait
GameStates
events
statesServer
54
Point-to-Point Architecture
55
Point-to-Point Architecture
Role of clientsNotify clientsResolve conflictsMaintain statesSimulate games
56
Player A
Clients simulate the game, maintain states, and forward message to each other.
Player B
57
Collect
Simulate
Render
Wait
GameStates
Collect
Simulate
Render
Wait
GameStates
58
Player A
Maintaining consistency is not trivial.
Player B
59
Centralized vs. Distributed
60
Design Requirements
61
Responsive
(reacts to player’s action)
62
Consistent
(players have the same view of the game state)
63
Cheat Proof
(player cannot cheat)
64
Fair
(should be fair to all players)
65
Resource Efficient
(minimal amount of network traffic, CPU cycles, memory)
66
Scalable
(able to handle large number of players)
67
Robust
(able to handle failure gracefully)
68
Simple
(easy to implement/maintain)
69
Why Difficult?
70
Internet is a best-effort network
71
Packets take time to travel.
72
Packets can be dropped or corrupted
X
73
A hits ball
Ideally, updates should reach other players immediately, so that states are consistent at all time.
74
A hits ball
Delay and loss lead to inconsistent states.
X
75
number of players can be huge
76
77
78
Huge cost in network/CPU resources
80
players are competitive
81
http://www.msxsecurity.com/bbf21421.jpg
Players cheat to gain advantage
82
games should be fair to all players
83
network delay and losses
large number of users
cheating
84
Latency
Robustness
Conflict/Cheating
Consistency
Accounting
Scalability
Complexity
85