PHost - Hosting with PHostPHost 4.1h |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Docs v4.x
|
IndexOverviewThis document provides a guide on how to install, set up, and host with PHost. It is intended for hosts; players can usually easily do without it. This document assumes knowledge with common Planets terminology. If in doubt, look up our definitions of root directory, game directory, ship list and star chart in the glossary. Installing PHostTo install PHost, just unpack the distribution archive into a directory of your choice. That directory will be the root directory for that version of PHost. PHost 4 distributions contain subdirectories; these subdirectories contain the sample configuration files. If you are using pkunzip to extract the distribution, be sure to use the -d option to restore the directory structure. On all platforms, PHost comes as a readily-linked program executable (phost.exe, phost). The individual distributions contain additional information in a README file, if necessary. PHost does not include a ship list or starchart. Upgrading from an Older VersionUpgrading from 4.xCheck the upgrade instructions in the Changes document. Usually, you only have to check new configuration settings. Skim the change list to see if a change affects you. Upgrading from 3.xEnsure that all add-on programs used in the game can handle PHost 4.x. Programs compiled with PDK 4.4 or later can handle both formats. Several configuration options were introduced, some were dropped. Update the configuration file. To see what you have to change, run PHost in check-only mode with -oConfigLevel=1, like this:
Look up the parameters PHost complains about in the Configuration document, and change your configuration accordingly. For your convenience, we have included a list with all new options added between PHost 3.4c and 4.1 in config/upgrade.src. Upgrading from 2.xThe instructions for upgrading from version 3 hold here, too. However, many more parameters have changed between version 2 and 3. PHost 3 contains more detailed upgrade instructions for going from version 2 to 3, but I'm too lazy to copy them here :-) If the game was hosted on a non-DOS system, you have to convert it into DOS format. PHost 4.x uses the same file format on all systems, which is the same file format as used on DOS. Setting up new GamesConfiguring the GameFirst, create the game directory. PHost comes with some example configuration files in the config/ subdirectory; pick one, copy it into the game directory and rename it to pconfig.src. Likewise, pick the relevant file from the shiplist/ directory and place it in the game directory as shiplist.txt. Edit the pconfig.src file to suit your taste. All possible configuration options are described on the configuration page. The shiplist.txt file contains ship-list specific configuration options and the special ship abilities and generally remains unchanged. The Classic WayAlternatively, you can ignore shiplist.txt and put all PHost configuration options into pconfig.src, and the special ship abilities into hullfunc.txt -- like it used to be in PHost 3.x. We recommend you to use the above, "new" way, though, because it reduces the complexity of the per-game configuration compared to the huge monolithic chunk of configuration used in PHost 3.x. Ideally, shiplist.txt is a never-changing part of the ship list, much like hullspec.dat. Special Maps and Ship ListsIf you wish to use one map and one ship list over and over again, copy them into the root directory. If you wish to use a ship list or map in one particular game, copy the files into the game directory. When looking for these files, PHost first looks into the game directory and, if they are not there, in the root directory. Files affected by this are:
These files need not all be in the same directory. PHost will find them even when some of them are in the game directory and some are in the root directory. Generating the UniverseTo initialize a universe, you need a "Master" program. PHost can not create a universe itself.
You can also use a hosting editor to manipulate the universe after mastering it. The program used to Master the game needs not support PHost explicitly, any universe creation / editing program for HOST works with PHost as well. When everything is set up right, run PHost for the first time to generate the first set of result files. Add-onsCalling Add-ons from PHostPHost supports the Auxhost1 and Auxhost2 hooks of HOST, as well as even finer control using "PControl". If you wish to use a host-side add-on program, read Manipulating the Host Sequence. The add-on documentation will tell you where in the sequence the add-on goes. Special Friendly Codes and MissionsWhen you use an add-on which provides additional friendly codes or missions, you should make these known to PHost and the players using the files intended for it.
VPHostVPHost is a "near-substitute" of the HOST/PHost program, relying upon only a small fraction of HOST's or PHost's functionality. Almost all other functions are performed within VPHost itself. When you use VPHost, you should invoke PHost with the -V command line (see below). This flag is necessary because VPHost removes all TRN files (after making copies in *.ORG files) and then processes the commands within those files by itself. Unfortunately, this means that all of the command processor commands sent by players are never seen by PHost. The -V flag tells PHost to look for player*.org files instead of player*.trn files and to only process command processor commands from those files (ignoring all other commands, which will be performed by VPHost). Invoking PHostPHost is invoked as follows:
The options can contain any number of option letters as described below. You can merge multiple options if you wish, -riT is the same as -r -i -T. Options must precede directory names. The game-directory and root-directory parameters specify the game and root directory, respectively. Both default to the current directory if omitted. See A Word about File Names for tips for choosing your game directory name. Command Line Option Summary
Exit CodeThe exit status (errorlevel) is 0 if PHost successfully performed the function you requested. When you specified -c, exit status 0 means everything is okay. PHost returns exit status 1 when there is a permission problem with the game or root directory, or when you used -d or -t on a newly-mastered game. PHost returns exit status -1 when it encountered a different error (like running out of memory, lacking a file), or when an internal consistency check failed (that is, you encountered a bug). Note that -1 is usually mapped to 255 by your operating system. When PHost terminates because it received signal X, it exits with status -X. For example, the interrupt signal (Ctrl-C) has number 2 and causes PHost to exit with code -2 (mapped to 254 by the operating system). When you are checking turn files (-c), a nonzero status means that something was wrong with the turn file.
When you're checking several files at once (-c0), exit status is the bitwise OR of all matching values. For example, an exit code of 10 = 8+2 means that at least one turn was stale and one was damaged. TracingIn order to help hosts debug problems, PHost offers a tracing capability. This feature is still incomplete; many parts of PHost have not yet been instrumented. It will, however, already generate useful information. To use this feature, specify one or more -L options. At every time, PHost is in some context. For example, PlanetaryLosses:planet16 means PHost is currently in the PlanetaryLosses stage processing planet 16. You can tell PHost to log events occuring in particular contexts. An event could look like this:
In this case, the base on planet 16 was removed because the planet became unowned due to riots.
BackupsNormally, you should keep backups of your game directory. Ideally, you back up the game directory after each hosting, and all TRN files just before the next hosting. If something goes wrong, you can restore the game directory as a whole. Usually, it suffices to have backups for the last three turns. Nowadays, disk space is cheap, so you can also back up the whole game. When you did not heed the above advice, you can still recover from partial data loss. You need:
Let's assume your backup is from turn 17. Copy all TRN files for turn 17 into the game directory, and re-run PHost with the same random seed which your original turn-18 host.log says. For example, you could use phost -s 13285 gamedir. You now have a game directory which is in turn 18 which is identical to the original turn-18 game directory except for the timestamp. Copy all turn-18 TRN files into that directory, and re-run PHost with the original turn-19 random seed. You need the -F flag this time, otherwise PHost will complain about files being stale. Repeat these steps while drinking the coffee, until you are at the turn you wished to restore. Good luck. This only works when you use the very same PHost version to re-run each turn which you used to run it in the first place. This also only works when you do not use add-ons that themselves include random actions. You can also replace the coffee by another beverage of your choice. Do not use whiskey, though, that will cause you to mis-type numbers. Host File CheckWhen PHost is invoked, it performs a host file check. Inconsistencies are reported and fixed.
Currently, the game data files are only checked once, when PHost starts. PHost "trusts" all add-ons run through the Auxhost and PControl mechanisms. If one of these programs messes up game data files too bad, PHost may crash. Last updated 31 May 2015. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
support@phost.de for support, ideas, bug reports, questions. Contact Details | Mail