Title: CMPSEM027 Online Gaming
1 CMPSEM027Online Gaming
2Massively Multiplayer Games Design and Issues and
Solutions
3Multiplayer Online Game?
- A Multiplayer Online Game (MOG) is a software
system in which multiple users interact with each
other in real-time, even though those users may
be physically located around the world. - Typically, each user accesses his/her own
computer workstation or console, using it to
provide a user interface to the game environment. - These environments usually aim to provide users
with a sense of realism by incorporating
realistic 3D graphics, spatial sound other
modalities to create an immersive experience.
4A MOG is distinguished by five common features
- A shared sense of space
- A shared sense of presence
- A shared sense of time
- A way to communicate
- A way to share
5Gameplay Issues
- Designing a game to have multiplayer options
cannot in good practice be an add-on after the
game has been developed. - It has to be considered early in the design
phase. - Because multiplayer can increase the of
polygons you have to be able to draw how much
of the screen you have to split up. - Vertical vs horizontal split-screen- depends
where your enemys are most likely to appear- in
nature horizontal is more important than
vertical. - Co-operative vs Melee
- Co-op
- Can co-op be played through the regular storyline
of the game? (like Halo) - Or only in special multiplayer arenas? (like
Quake) - What happens if one of you dies? E.g. Halo
Resurrect when no one is shooting your partner. - What happens if both of you die? Halo Restart
from the level?
6Gameplay Decisions
- Can I bring in customized characters? Quake
allows mods. - How do you find other players to play with on a
networked game? Match making service. - How do you find each other during a networked
game? Radars. - Is the game persistent? e.g. Networked Quake vs
Ultima Online / Everquest - How many players can you support simultaneously?
- Will the game include NPCs during multiplayer
sessions? Are NPCs your friend or enemy?
7E.g. Gauntlet
- 3rd person view- everyone on the same screen
- Play is co-operative
- What happens when players walk in different
directions? - Camera zooms out up to a limit.
8E.g. Quake / Jedi Outcast / Academy
- Entire screen dedicated to 1 player
- Co-op melee play possible over network.
- Multiple types of network games- free for all
capture the flag - Challenge network latency handling many many
players and NPCs handling mods for customizable
game characters.
9E.g. Halo
- Split screen co-op/melee and networked play
- Screen resolution limits polygon counts network
latency handling many players and NPCs
10E.g. Ultima / Everquest / Star Wars Galaxies
- No single user game mode.
- Entire screen dedicated to 1 player.
- All players are on the network.
- Large scale persistent RPG
- Open-ended play
- Richness and replayability of the game is
enhanced by users providing the content thru
social interactions. - Must handle 100s/1000s of players over periods
of years. - Large reliable databases in a constant running
simulation environment. - Database migration problems as of players
grows. - How to incorporate new game play capabilities
over time as players ask for them without
disrupting service.
11MOG are difficult to implement
- MOG are difficult to implement correctly or
effectively. MOG are complex because they are
multiple traditional types of software rolled
into a single application. - MOG are
- Distributed systems They must contend with all
of the challenges of managing network resources,
data loss, network failure, and concurrency. - Graphical applications They must maintain
smooth, real-time display frame rates and
carefully allocate the CPU among rendering and
other tasks. - Interactive applications They must process
real-time data input from users. Users should see
the virtual environment as if it exists locally,
even though its participants are distributed at
multiple remote hosts.
12Additional complexity
- MOG design is made more complex because these
systems must work with a number of existing
application services. - MOG typically must integrate with database
systems that store persistent information about
the game environment. These databases include,
for example, detailed information about the
environments terrain elevation, the location of
buildings and other static items in the
environment, and the initial MOG configuration. - MOG need to support user authentication and may
interact with commerce and other transaction
systems. - To support reproducible game play, MOG must be
able to log events in real-time to a persistent
storage this task is complicated by the fact
that the complete state of the MOG may not
actually be known at any single host in the
system.
13A unified system
- The components of a MOG system interact in
complex ways, so the designer must regard the
application as a unified system. - Invariably, trying to optimize one element of a
MOG can adversely impact the behavior of other
components. - In effect, MOG development is a difficult
balancing act of engineering tradeoffs.
14Architecture
15Single ThreadNetGames
16Processing Systems
17Fundamental Networking Issues
- Protocols (TCP/IP Transfer Control Protocol /
Internet Protocol) - TCP Completely reliable data arrives as a
continuous streams connection-oriented - Because data arrives as a stream there is no
guarantee of when each byte of data will arrive. - UDP Unreliable data arrives as discrete
packets/messages each packet is correct but
no guarantee of the order of the packet -
non-connection oriented - Bandwidth measured in bits per second.
- Latency
- This is your biggest enemy!
- Usually due to distance router and end-system
overflows packet loss. - Roundtrip times from New York TransUS 50ms
TransAtlantic 120ms TransPacific 200ms - Measured in milliseconds
- Latency in TCP is higher than UDP because TCP
needs to acknowledge that data stream is correct. - 200ms roundtrip latency is considered minimum
acceptable latency for tightly coupled
interactive applications.
18Fundamental Networking Issues
- Unicast, broadcast, multicast
- Broadcast sends message to multiple receivers one
at a time. - Multicast sends 1 message and allows router to
replicate and send message (based on UDP). - Problem is, multicast is not enabled on most
routers since it can flood the Internet. - Firewalls
- Usually networked applications operate over known
port numbers. - Firewalls prevent unintentional network traffic
from entering computer. - But it can prevent network traffic from entering
you game application. - Game should provide info about port used so that
firewall can be opened. - Unfortunately this creates a vulnerability for
hackers.
19Networking Issues that can Ruin aGame Experience
Routers and end-systems have network buffers
(queues) which fill up during congestion. Congesti
on is usually caused by an aggregate of network
traffic entering the routers which far exceeds
the rate at which the router is able to deliver
it..
Assume Bottleneck here
Receive buffer
Send buffer
Client
Client
Router
Also if sender sends faster than the network
link, send buffers will fill up packets will
get dropped at the sender. Same can happen for
receiver.
Router
Client
Bottleneck can cause queues to fill up
20Networking Issues that can Ruin aGame Experience
- When buffers are full, packets will get dropped.
- Effect on TCP
- Latency will increase because TCP will retransmit
in order to guarantee reliable delivery. - Latency will increase because TCP will reduce
transmission rate to attempt to reduce congestion - Effect on UDP
- UDP will simply lose data.
- Is there an easy way to tell or determine what
the best sending rate is? - Unfortunately NO- there is no Quality of Service
over the Internet best you can do is to assume
the core of the network will never slow down and
you have to dynamically adjust your sending rate
to accommodate the slowest player- down to a
minimum acceptable threshold. - Rate adjustment is commonly used in audio/video
streaming. - For all clients, as a rule, you should process
any incoming packets as fast as possible to avoid
congestion at the end points. - But if your client spends all its time processing
packets, it may take time away from making the
game go! So a balance must be found.
21Distributed Interaction
- Distributed interaction is one of the defining
qualities of a MOG system. - Users see each others real-time activity and
react to this information in real-time. - To be effective, the MOG system must present each
user with the illusion that the entire
environment is located on the local machine and
that his or her actions are having a direct and
immediate impact on the environment. - The system needs to mask any artifacts that might
arise because of the applications distributed
nature.
22Distributed Interaction
- Maintaining the illusion of a single system is
difficult because of the messaging required to
exchange information within the MOG. - For example, networks impose a noticeable delay
from the time that a message is transmitted to
the time that a message is actually received at
its destination. - Moreover, different messages may incur different
delays depending on the type of network and on
the locations of the source and destination
hosts. - Each host must therefore attempt to present a
consistent real-time view of the MOG and contend
with the fact that all of the incoming
information about remote users is already
out-of-date when it arrives.
23Network Game Management
- If your multiplayer game needs to retrieve large
data files (like 3D models), cache it locally in
the same way a web browser caches images. - Visual representation of networked entities
- avatar
- Body position orientation
- Head orientation
- Pre-recorded gestures
- Body parts list to load _at_ each client
- Send absolute state data not key or button
presses. - Use UDP to send data that is normally sent
repeatedly- e.g. a players position. - With UDP try to keep packets no larger than
1Kbytes otherwise there is no guarantee of
arrival. - Pack several variables together- dont send one
at a time. - UDP does not guarantee the order of packets so
include a packet in the message so that old
messages can be filtered out.
24What is dynamic shared state?
- The dynamic information that multiple hosts must
maintain about the MOG - Accurate dynamic shared state is fundamental to
creating realistic virtual environments. It is
what makes a game multi-user. - Management is one of the most difficult
challenges facing the MOG designer. The trade off
is between resources and realism.
25Consistency-Throughput Tradeoff
- It is impossible to allow dynamic shared state
to change frequently and guarantee that all hosts
simultaneously access identical versions of that
state. - We can have either a dynamic world or a
consistent world, but not both.
26Design Implications
- For a highly dynamic shared state, hosts must
transmit more frequent data updates. - To guarantee consistent views of the shared
state, hosts must employ reliable data delivery. - Available network bandwidth must be split between
these two constraints.
27Managing Shared States
28Massive Multiplayer
- Very large client server networks (thousands of
clients) - Uses advanced networking concepts such as
- Data Extrapolation
- Hierarchical Messaging
- Spatial Subdivision.
- WoW, Planetside,
29Data Extrapolation
- Uses timestamps and polynomials to interpolate
player positions in between position updates. - The prediction polynomial is recalculated after
each position update. - As lag increases, the difference between
predicted player positions and actual position
increases. This creates a "jump" in perceived
player position.
30Data Extrapolation
31Hierarchical Messaging
- Ranks types of messages in order of importance.
- Enables players with less bandwidth to play.
- Based on bandwidth tests, a player receives the
most important messages while less important
messages are dropped in order to stay within
bandwidth limitations.
32Hierarchical Messaging
33Spatial Subdivision
- Method of sending updates only to players who are
close to each other. - Stores players in a spatial index which enables
the server to determine which clients to update
with a particular player's new position.
34Connectivity models
- Shared Centralized clients connected to central
server simplest to implement maintain
consistency across all clients but load at
server can restrict of participants that can be
supported simultaneously. - Replicated Homogeneous clients with no
centralized control (multicast) most scalable
solution for large of clients, but multicast is
not deployed across the whole Internet. - Shared distributed with peer-to-peer updates
clients with full connectivity to each other
often a central mediator initiates the peer
connections. - Shared distributed using client-server
subgrouping subgroups for areas of interest
management most scalable for very large worlds
(like online persistent worlds- Ultima Online,
etc..)
35New Trends
- Problem
- Trend is toward Massively Multiplayer Games
- Traditional client-server architectures not
scalable - Server clusters expensive to deploy, maintain
- Current Solutions
- TeraZona - middleware
- Butterfly.net -
- Issues
- Tailored for MMORPGs
- Still very costly and centralized