|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: I T
Length: 5619 (0x15f3) Types: TextFile Names: »InstallRules.ms«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Mpss/InstallRules.ms«
.tl '''' .TH How to install or alter MPSS Version 1.4. .SH SETIING UP THE FILES .LP If mpss lives in one directory, a subdirectory called "mpsslib" must be created. "mpsslib" must have permissions 0777 (rwx for all!). Before compiling the program make sure that all file names in the file "files.h" have been altered accordingly. Make sure that this file contains the FULL pathnames of any files accessed. inside mpsslib we put 3 files, with permissions as follows and owner of all three being daemon. (ALL THIS MUST BE FOR THE GAME TO WORK!!) All files in mpsslib must have permission 4755 or 4777 as shown below. The file mpssclean must have 4755 permissions too. (i.e. they set uid as soon as they are invoked.) "mpsslib" should look like this : .DS L total 144 -rwsrwxrwx 1 daemon 0 May 11 15:06 mpssmail (file exec. on a new game) -rwsr-xr-x 1 daemon 44032 May 12 11:07 slave (invoked by ../mpss) -rwsr-xr-x 1 daemon 98304 May 12 11:11 startrek (the master game&process!) the directory above mpsslib should look like this : -rwsr-xr-x 1 daemon mpssclean (to clean up a mess if there is one) -rwxr-xr-x 1 daemon mpss (proggie to invoke the full game) -rwxr-xr-x 1 daemon mpssrules (nroff -ms format) drwxrwxrwx 1 daemon mpsslib (subdirectory for all files.) Make sure you read the rest of this script before trying, especially the bit on "speed tuning" below. .DE .SH How to change mpss. .LP To add another type of terminal. .LP All the terminal control strings are defined in cursor.c . So, if you wish to add another terminal, put in another case for it in all 3 relevant procedures in that file. Then edit slave.c and allow the variable tty_type to get that value. (look in procedure gettermdata() ). Make sure not to mess about with case 0, which is to exit the proggie in case of doubt. After that invoke mpss not using the -t option and choose the terminal you have implemented. .SH Speed tuning : How to fine tune mpss's speed if it runs TOO fast in single player mode. .PP On some really efficient machines, when you play mpss in single player mode (with aliens) it will zap like a rocket! (i.e. execute too fast.) To reduce its speed, edit the file .DS main.c .DE .PP which contains the main game iteration loop. on line 158 there is a delay -for- loop. Make the loop take longer if you want the game to run slower. At the moment line 158 looks like this : .DS if (noofplayers==1) for (loop=1; loop < 10; loop++); .DE To make the game slower change the 10 to about 50000. (fifty thousand.) To make it very slow try 100000. Some machines will not need tuning at all. If, however you feel that your ship flies way to fast at warp one, wait until after 5.00 PM and fine tune the program by trial and error. Note - Vaxes will almost certainly run the program much much faster. Also : It is unwise to allow the delay to happen in multi user mode, as the program has to do alot more processing then anyways. So keep the part of the statement saying ' if (noofplayers==1) ' in! Many folks will hopefully find, that the speed is quite acceptable when leaving the program as it is, so try that first before you do any tuning! .SH Structure of the game.. .LP First note that the entire game is controlled by one main master process. Heres a sample run of what goes on. (The file main.c contains the main game iteration loop.) .LP A guy invokes mpss. This tiny proggie only sets the players umask to 000 and opens the /dev/ttyxx file of the player and makes it rw access for all, so the master proggie can write/read from that terminal. Mpss then execls /mpsslib/slave which is owned by daemon so it can send signals to the master-star-trek proggie that is also owned by daemon. Now, slave starts running. If the mpsslib/masterpid (MASTERPIDFILE) isnt there, this means that the master process isnt running yet. Slave makes a LOCK file and if the master isnt there, invokes it. If it is there (i.e. masterpid is present) it carries on. After waiting until the masterpidfile appears, slave makes a PLAYERFILE, mpss/player, reads the master process id out of masterpid, and signals the masterprocess that a playerfile is there. The master process gets the signal, reads the playerfile enters the player into the list of players and starts to play him. The master removes the playerfile then, and then slave removes the LOCK file. No other slave will make a player file if the lock file is present. The playerfile contains the shipnumber,cursor motion and clear screen strings, as well as the players terminal name. After a player starts playing, if he dies, a playerscorefile is made, and the waiting slave process is signalled. It reads the playerscorefile, then the score file (which contains the scoreboard) adds him in, writes back the scoreboard and removes the playerscorefile.r Other files in the game are "shipnumber" wich only contains a number between 0-28 keeping track of which ship is to be allocated next. omakefile makes everything with the -O option, gmakefile makes everything with the -g option. .PP Finally, theres another file, the process file which lives in /tmp/processnos. If a game and/or slave process is started, its process id is logged in that file. The file is used by the 'mpssclean' program to clean up any loose processes that hang about the system from previously, abnormally left games. Try not to mess with this file, mpssclean updates and maintains it by itself just fine. LIVE LONG & PROSPER Any problems? ask Peer Schmitz, Department of Computer Science University of Keele, Keele, Staffs, ST5-5BG Janet: peer@uk.ac.kl.cs