1 / 19

Game Networking

Game Networking. CSE 191A: Seminar on Video Game Programming Lecture 9: Networking UCSD, Spring, 2003 Instructor: Steve Rotenberg Guest Lecturer: Mark Rotenberg. Maslow’s Hierarchy of Needs. Online Communities. Simple Online Games. Offline Games. Network Topology. Client-Server Topology.

tudor
Télécharger la présentation

Game Networking

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. Game Networking CSE 191A: Seminar on Video Game Programming Lecture 9: Networking UCSD, Spring, 2003 Instructor: Steve Rotenberg Guest Lecturer: Mark Rotenberg

  2. Maslow’s Hierarchy of Needs Online Communities Simple Online Games Offline Games

  3. Network Topology Client-Server Topology Peer-to-Peer Topology

  4. Networking Evils • Security • Cheating • Latency (up to 100-300ms round-trip) • Bandwidth (64-128 kbps each direction) • Packet Loss (2% with 10% bursts) • Jitter

  5. Lock-Step Simulations • Really easy to implement • Fully synchronize everything • Initial states • Inputs • Time steps • Simulation must be deterministic • Some turn-based games use this at a slower sampling rate (Age of Empires) • Not suitable for fast Internet games

  6. Simulation with Lag Compensation • Server-side movement • Peer/Client-side movement with Host/Server verification • Varying frame rates and latencies • Position history with server-side time warping (Half-Life) • Interpolation - sliding and skipping • Extrapolation – problematic with physics • Syncing orientation, position, inputs

  7. Networking Protocols • TCP (Transport Control Protocol) • Reliable, connection based protocol • Ideal for matchmaking and lobbies but not real-time game play • UDP (Unix Datagram Protocol) • Unreliable, unordered datagram oriented • Good for time-sensitive data but not

  8. Networking Protocols, cont’d • Roll-your-own Protocol • Probably based on UDP • Prioritize and retransmit as necessary • Coalesce or reconstitute packets as necessary • Compression • Encryption • Piggyback Acknowledgements • Heartbeats / Pings / Keep Alive / Network Probes

  9. Game-Specific Protocols • Positions, Inputs, Orientations • Spawning and Removing • Game Events • Match Configurations • State Transitions • Complaints, Connection Status • Heartbeats (pings) • Voice / Chat

  10. Game Data • Most common transmission modes • Reliable • Piggyback ACKs where possible • Unreliable • Should be numbered, may arrive out of order • Other modes • Most recent only • Fastest / Reliable fastest • May transmit multiple times without waiting for ACKs

  11. Network Security • Encryption and Digesting • RSA • Diffie-Hellman • MD5 • DES, triple-DES, AES • IPSec • References • http://www.rsasecurity.com/rsalabs/faq/ • “Applied Cryptography,” Schneier

  12. Network Address Translation Peer 1 • Peer 1 sees: • Peer 2 at 219.3.16.49 : 1000 • Peer 3 at 219.3.16.49 : 49155 • Peer 2 sees: • Peer 1 at 198.214.72.29 : 1000 • Peer 3 at 10.0.0.3 : 1000 • Peer 3 sees: • Peer 1 at 198.214.72.29 : 1000 • Peer 2 at 10.0.0.2 : 1000 198.214.72.29 : 1000 Internet 219.3.16.49 : 1000 219.3.16.49 : 49155 NAT 10.0.0.3 : 1000 10.0.0.2 : 1000 Peer 2 Peer 3

  13. General Programming Suggestions • Always assume networking • Separate cause from effect • Event-based networking code • Multiple levels of state machines • Message passing from network layer to game code • Monitor everything • WAN simulation hardware/software • Lots of asserts and debug messages • Lots of unit tests • Lots of product testing

  14. Matchmaking and Community • Matchmaking • Competitions, Ladders, Leader Boards • Friends, Invitations • Feedback – both good and bad • Content Sharing

  15. PS2 Strategy 5 networking stacks to choose from!? No built-in support for voice, security, authentication Various middleware vendors Publishers or users provide servers Xbox Strategy Very well designed networking stack and APIs Connect only through Microsoft’s servers Every packet, machine, user, hard drive, DVD, user can be authenticated Gamertags work across multiple titles Consistent billing interface Strict User Interface Guidelines Online Strategies – Sony vs. Microsoft

  16. Deployment Issues • Patching • Maintenance • Who pays for bandwidth? • Billing • Scalability • Monitoring Usage and Statistics • Handling Cheaters • Detecting Piracy • Who “owns” users? • “Policing” the Community

  17. Massively Multiplayer Online Games • Huge Development Costs • Virtual Economies • Community • Server Scalability • Keeping content new and interesting

  18. Future Considerations • IPv6 • Handhelds and Cell phones • Cross-Title Integration • Server-side “Mods” • Peer-to-Peer MMOGs? • Sony “Cell” Processor

  19. Questions? Contact me at mark [at] rockstarsandiego.com.

More Related