21
1 Network Gaming Network Gaming

1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Embed Size (px)

Citation preview

Page 1: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

1

Network GamingNetwork Gaming

Page 2: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

History of Network GamingHistory of Network Gaming

MUDMUD– MMulti-ulti-uuser ser DDungeonsungeons

Modem GamesModem Games Match MakingsMatch Makings

– Real-time strategyReal-time strategy– FPSFPS

MMORPGMMORPG– MMOGMMOG– MMassive assive MMultiplayer ultiplayer OOnline nline RRole-ole-pplaying laying GGamesames

2

Page 3: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

MUDMUD A large scale game with fantasy-typeA large scale game with fantasy-type Create your own characterCreate your own character

– Strength/Intelligence/Endurance/WisdomStrength/Intelligence/Endurance/Wisdom Most of the MUDs are text-basedMost of the MUDs are text-based

– MUD commandsMUD commands Players play them simultaneouslyPlayers play them simultaneously Persistent worldsPersistent worlds

– The amount of time investedThe amount of time invested– Never endingNever ending

CompetitionCompetition– Skill & AttributesSkill & Attributes– Experience pointsExperience points

OwnershipOwnership– Acquire better itemsAcquire better items

SocietySociety 3

Page 4: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Modem GamesModem Games

BBS GamesBBS Games– Turn basedTurn based– StrategyStrategy

Modem-to-modem GamesModem-to-modem Games

4

Player 1 Player 2

Modem Modem

Phone

Page 5: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Match MakingsMatch Makings Puzzle/Table Games on the NetPuzzle/Table Games on the Net

– 休閒遊戲休閒遊戲 RTSRTS

– Real-time strategy gamesReal-time strategy games– IPXIPX– TCP/IPTCP/IP

FPSFPS– First-personal-view shooting gamesFirst-personal-view shooting games

AIAI Game LobbyGame Lobby

– Match makingMatch making– RankingRanking– ChattingChatting– A special caseA special case

» Xbox LiveXbox Live 5

Page 6: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

MMORPGsMMORPGs

Graphical MUDGraphical MUD– With much more functionalityWith much more functionality

PersistentPersistent Real-time Online (Real-time Online ( 即時在線即時在線 )) Pay-for-playPay-for-play New Game StyleNew Game Style

– RPGRPG– AdventureAdventure– ActionAction– SocietySociety– MessagingMessaging– AvatarAvatar

6

Page 7: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Network Gaming ArchitectureNetwork Gaming Architecture

Peer-to-peerPeer-to-peer Client serverClient server

7

Page 8: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Peer-to-peerPeer-to-peer Client Broadcasts Messages to Each OtherClient Broadcasts Messages to Each Other Simple PatternSimple Pattern Easy to CodeEasy to Code But Need More Bandwidth for Each ClientBut Need More Bandwidth for Each Client Limited PlayersLimited Players Fault ToleranceFault Tolerance High Security RiskHigh Security Risk

8

Client 1

Client 2

Client 3

Client 4Host

Page 9: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Client ServerClient Server

One Server Serves Every ClientsOne Server Serves Every Clients More Complex in CodingMore Complex in Coding Many PlayersMany Players The Server Needs More BandwidthThe Server Needs More Bandwidth

– This means “This means “ExpensiveExpensive”” Improved securityImproved security No fault toleranceNo fault tolerance Dedicated ServerDedicated Server

9

Server

Client 2

Client 3

Client 1

Page 10: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Internet ConsiderationInternet Consideration Limit Network BandwidthLimit Network Bandwidth Unstable Network EnvironmentUnstable Network Environment Update Frame RateUpdate Frame Rate

– For match making : 5-8 fpsFor match making : 5-8 fps» Position updatesPosition updates» Inventory updatesInventory updates» Kill or killedKill or killed» ……

– For MMOG : 1-2 fpsFor MMOG : 1-2 fps» Position updatesPosition updates» Inventory updatesInventory updates» Kill or killedKill or killed» Friend list updatesFriend list updates» ChattingChatting» MessagingMessaging» ……

10

Page 11: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Poor Networking ProblemsPoor Networking Problems

Limited bandwidthLimited bandwidth– Data packet size is importantData packet size is important– SolutionsSolutions

» Data compressionData compression» Lower update frame rateLower update frame rate

Low update frame rateLow update frame rate– Synchronization is the keySynchronization is the key– SolutionsSolutions

» ExtrapolationExtrapolation» PredictionPrediction» ChasingChasing

Network LODNetwork LOD Network VisibilityNetwork Visibility

11

Page 12: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Data PacketData Packet

Data CompressionData Compression Encode / DecodeEncode / Decode CPU time vs data sizeCPU time vs data size SocketSocket TCP/IP & UDPTCP/IP & UDP

12

Page 13: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Network Data CompressionNetwork Data Compression

Must be Lossless Compression ?Must be Lossless Compression ? Zip ?Zip ? Bit, Byte, Short or Long ?Bit, Byte, Short or Long ? Fixed-point or Floating-pointFixed-point or Floating-point Run-length CompressionRun-length Compression Use Index/ID Instead of DataUse Index/ID Instead of Data 1 Boolean = 4 bytes1 Boolean = 4 bytes

13

Page 14: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Position ExtrapolationPosition Extrapolation

Use Position(i-1) & Position(i) to Get the Next Use Position(i-1) & Position(i) to Get the Next Possible Position (i+1)Possible Position (i+1)

No Velocity Data is NeededNo Velocity Data is Needed

14

i-1

i+1

i

real path

i+1

i+2

Page 15: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Position PredictionPosition Prediction

Use Current Facing Direction to Predict Next Use Current Facing Direction to Predict Next PositionPosition

Update : (position, facing direction)Update : (position, facing direction)

15

i-1

i+1

i

real path

i+1

i+2

Page 16: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Position ChasingPosition Chasing

Always being Late One Step to the MasterAlways being Late One Step to the Master Not Good for Moving Fast ObjectsNot Good for Moving Fast Objects

16

i-1

i

real path

i+1

Page 17: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Network VisibilityNetwork Visibility

Server Will Not Update the Position of the Server Will Not Update the Position of the Clients that are Out of a Specific Range of Clients that are Out of a Specific Range of One ClientOne Client

Only When the Outside Clients Move into the Only When the Outside Clients Move into the Range of the ClientRange of the Client

That Means the Client Can Not “See” the That Means the Client Can Not “See” the Clients Outside its Range on the NetClients Outside its Range on the Net

17

Page 18: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Network Level-of-detailsNetwork Level-of-details Besides the Network Visibility, Apply the Network Besides the Network Visibility, Apply the Network

LOD to the Client Between ClientsLOD to the Client Between Clients For Each Client, the Server Should Adaptively Adjust For Each Client, the Server Should Adaptively Adjust

the Update Frame Rate for the Other Clients to the the Update Frame Rate for the Other Clients to the Target Client According to Their Physical DistanceTarget Client According to Their Physical Distance

185fps

3fps

1fps

invisible

Me

Page 19: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

TCP/IP or UDPTCP/IP or UDP

Some Game Data Can Be LostSome Game Data Can Be Lost– Position for the object in each framePosition for the object in each frame– UDP is fast but not reliableUDP is fast but not reliable

Some must be NotSome must be Not– Kill or not kill, killed or nor killedKill or not kill, killed or nor killed– TCP/IPTCP/IP

Hybrid Data Transmission WaysHybrid Data Transmission Ways– Data-can-not-lost going through TCPData-can-not-lost going through TCP– Data-can-lost going through UDPData-can-lost going through UDP– Or implement your reliable UDP solutionOr implement your reliable UDP solution

19

Page 20: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Network SecurityNetwork Security

Anti-hackingAnti-hacking– System administration issuesSystem administration issues– Very important in MMORPGVery important in MMORPG

Cheat preventionCheat prevention– Technical example:Technical example:

» A “fake” client instead of the game client to send A “fake” client instead of the game client to send cheating data packets.cheating data packets.

– Game-playing example:Game-playing example:» Using the game bugs to get the improper fortuneUsing the game bugs to get the improper fortune

Be-killed -> Dead -> Get free money -> Be-killed ->…Be-killed -> Dead -> Get free money -> Be-killed ->…

20

Page 21: 1 Network Gaming. History of Network Gaming MUD MUD –Multi-user Dungeons Modem Games Modem Games Match Makings Match Makings –Real-time strategy –FPS

Develop Tools & SolutionsDevelop Tools & Solutions Match-makingsMatch-makings

– DirectPlay in DirectX SDKDirectPlay in DirectX SDK– Socket programmingSocket programming– MiddlewareMiddleware

» ie., Quazal NetZie., Quazal NetZ

Internet Causal GamesInternet Causal Games– Web programmingWeb programming– SQL programmingSQL programming

MMORPGMMORPG– Socket programmingSocket programming– MiddlewareMiddleware

» Terezona from ZonaTerezona from Zona» Eterna from QuazalEterna from Quazal» Butterfly.netButterfly.net

21