Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesA Real Opponent


December 1995 / Special Report / 3-D Action / A Real Opponent

Marathon, a Doom-style game for the Mac, allows up to eight networked users to play with (or against) each other. Why eight? It's nearly arbitrary: The dialog box has room for eight selections. Games such as Marathon 2 may support more.

Bungie wanted its game to run on any Apple network, including AppleTalk. The problem is that on AppleTalk networks, every packet your application sends requires that the microprocessor handle two interrupts -- one for the transmission and another for the acknowledgment. With a game running at 30 frames per second, you need to send out 30 messages per second, resulting in 60 interrupts. And that's just to service the outgoing messages. Incoming messages from the other network players bring additional interrupts. Bec ause network services still run in the 68000 emulator on Power Macs, this shortcoming affects even them.

Bungie's answer was to use a 32-bit vector to represent the player's keystroke every 1/30 of a second. The game broadcasts the vector over the network to the other computers in the game. Those computers in turn are broadcasting their own 32-bit keystroke vectors, also 30 times a second. Thus, each computer maintains the correct state of all the players in the game. According to Jason Jones, lead developer on the Marathon project, most network games employ a similar strategy to minimize network traffic.

The physics-model concept in Marathon led to an interesting problem. Because each computer independently computes the players' states, they can quickly get out of synchronization if the different computers have different physics models. That makes the game essentially unplayable, since in one computer the players might be shooting at each other, while in another they aren't even in the same room. Marathon 2 will correct this little glitch by distributing a common physics model when starting a network game.


Up to the Special Report section contentsGo to previous article: 3-D ActionGo to next article: Multimedia MasterpiecesSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network