schwengeler@urz.unibas.ch (10/17/90)
Hello, I'd like to know why the game "acm", posted in "comp.sources.x" must use the functions "gethostname", "get_user" and the like and why it needs to do network functions with the internet. Does a Xwindow game need all this things, or is it just a bad attempt to grap usernames/passwords from everywhere in the world? Could an X guru give me an answer? Thanks in advance. Hans.
etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (10/18/90)
The X api operates using the network services calls. Any X program will make these calls. -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bmc.tmc.edu (713) 798-3776
mayoff@cs.utexas.edu (Robert Mayoff) (10/18/90)
In article <2274@gazette.bcm.tmc.edu> etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) writes: >The X api operates using the network services calls. Any X program >will make these calls. I have not looked at the acm code (the only 8-plane X servers I can use are HP-3000's, which I can't stand), but I doubt that you have answered the question fully. There are two obvious ways, to my knowledge, to write a multi-player X game. One way (this is the way xtank works, for example) is to have one program run on one machine, and connect to the X servers of all the players. This way has the advantage that it is easier to write, since one program keeps track of all the variables, timing is easier, etc. However, one program does basically *all* the work, except actually drawing the images. The other obvious way is to have each player run a program which connects to some central server (or all the other players' programs) and to his own X server. This way, each program does its own work; the load is distributed. My guess is that this is the method used by acm, since its nature implies that it does a *lot* of calculation. If this is indeed the case, it must use network function calls to connect to the other players' (or the server's) programs. Perhaps the acm author(s) will clarify? -- /_ rob <mayoff@cs.utexas.edu> /_ Fun things to do with UNIX (#2 in a series): / exec trace -p $$
riley@mips.COM (Riley Rainey) (10/18/90)
In article <1990Oct17.095033.1034@urz.unibas.ch> schwengeler@urz.unibas.ch writes: >Hello, > >I'd like to know why the game "acm", posted in "comp.sources.x" must >use the functions "gethostname", "get_user" and the like and why >it needs to do network functions with the internet. >Does a Xwindow game need all this things, or is it just a bad >attempt to grap usernames/passwords from everywhere in the world? >Could an X guru give me an answer? acm is divided into two component programs. A single server process, acms, runs on a machine somewhere on your network; acm is a multi-player simulation and this process drives all of the player X servers. The second program, acm, is a simple program that gathers some basic information and places a call to the acms server, requesting that a new session be started on behalf of this user. The information includes the user's userid, command line arguments, and a "network oriented" X display name (by network oriented, I mean an X display name that other systems on the network could use in an XOpenDisplay() call -- "okole:0.0", for example, as opposed to simply ":0.0" as many users' DISPLAY environment variables are set to). acm uses getpwuid() and gethostname() to gather that information. The username was intended for game scoring that has yet to be implemented. The hostname information is used to build this "network oriented" X display name that I described when the user has the DISPLAY variable set to a non-network name (again, such as ":0.0"). I can assure you that I didn't write acm to breach anyones' system security. It's nice to hear that a few peoples productivity has been impacted, though :-). Seriously, security is an issue close to nearly everyone's heart today, and I would welcome a close examination of the acm sources to verify its benevolence. -- Riley Rainey Internet: riley@mips.com MIPS Computer Systems UUCP: {ames,prls,decwrl,pyramid}!mips!riley Dallas, Texas Phone: (214) 770-7989
riley@mips.COM (Riley Rainey) (10/19/90)
In article <967@langtry.cs.utexas.edu> mayoff@cs.utexas.edu (Robert Mayoff) writes: >There are two obvious ways, to my knowledge, to write a >multi-player X game. > >Perhaps the acm author(s) will clarify? > acm runs with a single server. MIPS has some excellent application profiling tools (pixie), that yield much more precise runtime information than the standard Unix profiling facilities. My work indicated that in a one player configuration with the acm server (acms) on a different machine than the X server, the acms process needed about 10 percent of the CPU and the X server was "outta gas". acms updates flight information every eighth of a second and transmits a new visual frame to each player every half second. This led me to conclude, based on the current resources required, that an intermediate process that, say, did the 3-D stuff, was going to be excess baggage. I use a MIPS RC3260 as the acms server and a MIPS Magnum as the X station. Both are rated at about 18 SPECmarks. Different hardware configurations may yield different conclusions. -- Riley Rainey Internet: riley@mips.com MIPS Computer Systems UUCP: {ames,prls,decwrl,pyramid}!mips!riley Dallas, Texas Phone: (214) 770-7989