1 / 117

Issues and Implementations in Multiplayer Game Development

Issues and Implementations in Multiplayer Game Development.

mandel
Télécharger la présentation

Issues and Implementations in Multiplayer Game Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Issues and Implementations in Multiplayer Game Development Online game development is difficult and riddled with expensive risks. Whether you are adding multiplayer support to a single-player game or fielding a massively multiplayer persistent virtual world, the additional complexity of connecting your players over a network adds substantial development time and testing costs. Get it right, and online can bring innovative game play and a sense of community to your player base. Get it wrong, and going online brings you a Pandora’s box of missed deadlines, frustrated developers, and unhappy customers…

  2. Playing with Friends Exciting Competition Community Limited Media Non-linear time Community Challenges Game Play Persistence Fairness Style Our Focus Network Distortion Multi-Player Inputs Multi-Process Execution Unreliability / Non-Determinism System Complexity Introduction Why Online? Technology

  3. Tutorial Takeaway Messages • Building online games with single-player game techniques is painful • Early changes to your development process & system architecture to accommodate online play will greatly ease the pain • “Lessons Learned” from our background will provide your project with useful “Rules of Thumb” “A wise man learns from his own mistakes, a wiser man learns from someone else’s”

  4. Network Terminology

  5. Bandwidth A measure of the width or capacity of a communications channel. Greater bandwidth allows communication of more information in a given period of time. Important: Bandwidth refers only to the amount of data a channel can handle. As an analogy, a dump truck has a higher bandwidth than a sports car. This does not mean that the dump truck is faster, just more efficient at moving large amounts of material Source: Ubisoft Online Terminology Guide, used with permission

  6. Cheat An exception to a game’s normal rule set that is included by the game’s developers. Usually, cheats are enabled only in the single-player mode of the game (if it has one) or were included for use (and forgotten about) by the developers to aid with testing and/or the media.

  7. Client/Server This is any networking architecture in which one machine (the server) is responsible for making final determinations on what occurs in the game. This can range from game designs in which the client merely displays information to the user and returns user inputs to the server, to game designs in which all machines are running nearly complete versions of the game, and the server only serves to centralize communications and adjudicate any disagreements. Important: This is an architectural distinction. It is entirely possible that the server is a consumer operated machine. Source: Ubisoft Online Terminology Guide, used with permission

  8. Consumer-Hosted A game in which all of the machines involved are run by the consumer. Source: Ubisoft Online Terminology Guide, used with permission

  9. Dedicated Server A client-server game in which there is a machine which is serving as a server without having any local player. This may be hosted by a consumer, or by a game service. Source: Ubisoft Online Terminology Guide, used with permission

  10. Dumb-Client A client-server game design in which the client is largely a dumb input/output device. Source: Ubisoft Online Terminology Guide, used with permission

  11. Exploit An unexpected or unintended game result generated by the actions of the player that modifies the course or outcome the game in a way not intended by the game’s designers. Usually the result of players discovering a bug in the game.

  12. Hack A modification made to a game or its data by an end user. This can take the form of modifying either code or data, in memory while the game is running, and/or to the game’s files on disk. The game itself or a service that it uses (such as a driver), or the data it shares with other computers, or hardware can be modified.

  13. Hybrid Game Mix between Client-Server and Peer-to-Peer, where a server determines the outcome for some events, while each player’s computer determine the outcome of some events (usually local to that player).

  14. Firewall A security product that employs a combination of hardware and software to prevent unauthorized users or traffic from the Internet from gaining access to a private local area network. Many problems in online gaming arise because firewalls block communication between games. Source: Ubisoft Online Terminology Guide, used with permission

  15. Integrated Server A client-server game in which the machine which has a user playing the game is also serving as the server. On some PC applications, even though there may be a server running on the same machine as a player, they are separate applications. Source: Ubisoft Online Terminology Guide, used with permission

  16. IP Address This is the identifying number for any machine on the Internet or for any LAN using the IP protocol. The original, and most widely used form, is IPv4. Under IPv4, each address is made up of four octets. If expressed as text, it will take the form of "www.xxx.yyy.zzz" (sometimes called a dotted IP string). The broader Internet is slowly switching over to IPv6 to increase the number of available addresses. As the name implies, IPv6 addresses are made up of six octets. Source: Ubisoft Online Terminology Guide, used with permission

  17. IP Address Additionally, under IPv4, the following rules apply to network addresses: The local machine is always reachable by the "loopback" address of 127.0.0.1, and the following ranges of addresses are reserved for use on local LANs: 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255 Source: Ubisoft Online Terminology Guide, used with permission

  18. Lag A slowing of the execution of a game. Lag can be caused by two main factors: network issues or computer performance. Network lag cause an online game to miss information bits necessary for the execution of it. For instance, the last message indicating the position of another player can be lost or is late, but the game has to display something on the screen. Depending on how this situation has been taken into account by the developers, the display of the other player will freeze and the computer will wait for the next message to arrive before continuing the execution of the game. Source: Ubisoft Online Terminology Guide, used with permission

  19. Lag Performance lag is caused by the overload of the main CPU (too much information to process at a time) or the graphical CPU (too many polygons or lightning to process). Source: Ubisoft Online Terminology Guide, used with permission

  20. Latency A measure of how long it takes a single bit to propagate from one end of a link or channel to the other. Latency is measured strictly in terms of time. Source: Ubisoft Online Terminology Guide, used with permission

  21. MAC Address Media Access Control Address, a hardware address that has been embedded into the network interface card by the manufacturer to uniquely identify each node or point of connection of a network. Source: Ubisoft Online Terminology Guide, used with permission

  22. NAT (Network Address Translation) Enables a local area network to use one set of IP addresses for internal traffic and a second set of IP addresses for external traffic. Source: Ubisoft Online Terminology Guide, used with permission

  23. Octet An 8 bit value. Because a byte is the smallest addressable amount of memory on the machine (6 bit, 7 bit, 9 bit, and 16 bit machines have all been on networks, along with the now standard 8 bit bytes), network engineers like to use octet to specify that we really mean 8 bits. Source: Ubisoft Online Terminology Guide, used with permission

  24. Peer-to-Peer In this networking architecture, all games are running full versions of the game engine. Although one machine may be used to host the setup of the game, once the game is running, all machines are effectively equal. Disputes may be resolved algorithmically (i.e. “claims about your own damage are always valid”) which lends itself to cheating, or via a voting mechanism. Important: This is an architecture. It does not mean “any game where all the machines involved are consumer owned”. Source: Ubisoft Online Terminology Guide, used with permission

  25. Server-Validation A client-server game design in which the clients are running relatively complete versions of the simulation, and the server is validating claims, rather than determining all results. Source: Ubisoft Online Terminology Guide, used with permission

  26. Service Hosted A game in which one or more of the machines involved is provided by a game service (often the game’s publisher). Source: Ubisoft Online Terminology Guide, used with permission

  27. TCP Transmission Control Protocol. TCP is one of the main protocols in TCP/IP networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent. Source: Ubisoft Online Terminology Guide, used with permission

  28. UDP A connectionless protocol that, like TCP, runs on top of IP networks. Unlike TCP/IP, UDP/IP provides no error recovery services. UDP/IP packets are CRC checked, but if there is a CRC failure or part of a UDP/IP packet fails to arrive, the packet is lost entirely. Additionally, where TCP/IP is stream based, UDP/IP is datagram based, with all the data in a UDP/IP send arriving at once, if it arrives at all. It can be used for broadcasting messages over a local network to find games, and is used by many games as the primary game data channel. Source: Ubisoft Online Terminology Guide, used with permission

  29. What is a WAN? • Wide Area Network (WAN) is a “network of networks” • Allows different networks to talk to each other • Size and distance doesn’t matter

  30. LAN Environment • Local Area Network (LAN) shares common address space • Actually independent of media; usually Ethernet • Also independent of protocol; usually TCP/IP • Can “broadcast”

  31. WAN Environment • Multiple networks • Can have overlapping address spaces • Very media dependent • Uses edge device to hide the details • Different types based on connection details

  32. WAN Connection Types • Point-to-point – a single leased line between two sites • Circuit Switching – like a phone call, connection made on demand • Packet switched – Virtual circuits are created

  33. Point to Point • A leased line from the provider • Always on • Fixed bandwidth • Works like a pipe, whatever goes in at one end comes out the other • Can set up an extended LAN environment • More expensive

  34. Circuit Switching • Similar to a leased line in that there is a physical connection between the two sites • Gets set up and torn down so its only on when needed • Similar to making a phone call • ISDN is an example

  35. Packet Switched • Uses provider infrastructure • No real connection between sites, uses a virtual circuit • Routes data packets to final destination by whatever path is available • Two types of circuits – Switched Virtual Circuit (SVC) and Permanent Virtual Circuit (PVC) • Examples are ATM, Frame Relay, X.25, SMDS

  36. Virtual Circuits • PVC’s are always on – “permanently established” • SVC’s are brought up and down • Call Setup • Idle • In use • Tear down

  37. Quality of Service • Quality of Service (QOS) requires a queuing mechanism • Differs between media used • Prioritizes data according to packet information • Line purchased may or may not support - Make sure you buy the right thing!

  38. Edge Device • Any device that hides the complexity of what you are talking to from your LAN • Does the protocol disassembly and reassembly • Handles signaling • Handles media conversion • Router is an example

  39. ATM • Asynchronous Transfer Mode • Used by Telco’s to handle voice • Breaks everything up into small, fixed size packets • Very common, cheap • T1’s, T3’s, OC3’s etc. • Need to test for equipment compatibility!

  40. Typical ATM Usage • Local Exchange Carrier (LEC) provides physical line • Line is located in the carrier’s Point of Presence (POP) on your facility • You connect your router to your internal Ethernet LAN • LEC connects line to your carrier

  41. Typical ATM Usage cont. • Your carrier (Sprint, ATT, Global Crossing, etc.) has a small, fixed number of hops to get you onto main trunk • Main trunk will get your data to destination LEC site • LEC to POP to Router to Destination LAN • Magic is in how it knows where to go!

  42. Break until 11:15 11:15am-12:30pm Moving from Single Player to Multiplayer

  43. Player A (San Francisco) Network Distortion Player B (New York) ? Local machine always has an accurate representation of ball position Ball Position: State Updates ? ? NETWORKED GAMES ARE HARDER THAN SINGLE PLAYER GAMESUse Case: Steal Ball Being Dribbled By Another Player Remote machine always has an approximation of ball position

  44. Issue: Kicking a Shared Soccer Ball • Your opponent has the _exact_ position of the ball • Your computer has only an _approximate_ position of the ball • When you (the player or the coder) make a decision, it may be on incorrect data • Level of distortion impacts quality of gameplay • Inaccuracies of data lead to serious coding defects The more computers involved, the greater the problem

  45. Client B,C Distorted Views Shared View Network Latency / Unreliablity Shared Worldview: Each Node Has A Potentially Different Representation Of Every Value Client A (Local Memory) Clear Views Game Logic Player Views True Values Damage Levels Player Position AI State

  46. At any slice in time, fuzzy, loosely coupled views produce an inconsistent shared worldview Machine A, time t Machine B , time t Network Shared View @ (t) Is ALWAYS DIFFERENT B Network C Network A Machine C , time t

  47. The loss of precision • Compression saves bandwidth • What to compress – and how much? • Possibly compress then decompress before you use it in game to minimise divergence • Examples: • Car position – vibration • Car position – aggressive driving

  48. What is an atomic operation? • Each message becomes an atomic operation • Interframe and intraframe timing is not preserved across the network • Troublesome case: Multiple frame actions such as shell transitions • Troublesome case: Multi-step operations in which the interim cases are invalid at frame start

  49. Event Ordering And Atomicity Across Transactions Further Impact GamePlay And Coding Errors Near-Endless (and illogical) Ordering Are Possible Machine A Machine B A1,A2,B1,B2 A1, B1,B2,A2 B1,B2,A1,A2 A1,A2,B1,B2 A2,A1,B1,B2 B2,A2,B1,A1 … A1,A2 B1,B2 Machine C

  50. Indeterminate timing and sequencing of information • Player A sends a stream of packets describing game state • Timing: • Player A picks up invulnerability pickup (10s) • Player A gets shot 9.9s later • If the second packet is delayed before arriving at B…

More Related