Wormholes are only supported if AllowWormholes is enabled in pconfig.src (default). In this case, PHost will look for a text file wormhole.txt which contains wormhole definitions.

A wormhole definition consists of 6 to 10 numbers in one line, separated by whitespace:

X1 Y1 X2 Y2 Mass Instability Wp_X1 Wp_Y1 Wp_X2 Wp_Y2

You can write comments in this file starting a line with ';' (semicolon) or '#' (hash sign). Blank lines are ignored.

X1 Y1(mandatory) Current position of first wormhole endpoint (unidirectional wormhole: entry point). Both coordinates must be integers in range [0,10000]
X2 Y2(mandatory) Current position of second wormhole endpoint (unidirectional wormhole: exit point) Both coordinates must be integers in range [0,10000]
Mass(mandatory) Wormhole mass. The wormhole's mass determines the wormhole size and influences the wormhole's ability to be detected by ships. If this is a positive value [1,32767], the wormhole is bidirectional and ships can travel in both directions. If this is a negative value [-32767,-1], the wormhole is unidirectional and ships can only travel from the first endpoint to the second one, not the other direction. The real mass is the magnitude of this value. This value must be an integer, and it must not be 0.
Instability(mandatory) This number specifies the instability of the wormhole as a baseline percentage chance that travel through the wormhole will go awry. This number need not be an integer but must be in the range [0.0, 100.0]. The actual probability that a ship's passage through a wormhole will end in disaster is related to the ship's mass, the wormhole's mass, and the wormhole's instability.
The stability translates into a rating as follows:
Wormhole_stability_rating =
   "very stable"     ...if Wormhole_instability ≤ 5
   "stable"          ...if Wormhole_instability ≤ 15
   "mostly stable"   ...if Wormhole_instability ≤ 30
   "unstable"        ...if Wormhole_instability ≤ 50
   "very unstable"   ...if Wormhole_instability ≤ 80
   "completely unstable"
                     ...otherwise
Wp_X1 Wp_Y1(optional) These coordinates specify the a destination for the first endpoint of a wormhole. Each turn, a wormhole's first endpoint will travel WrmDisplacement ly towards its destination. If these values are not specified, the endpoint will not move (except for WrmRandDisplacement). These values must be integers in range [0,10000].
Wp_X2 Wp_Y2(optional) Likewise, these coordinates specify the a destination for the second endpoint of a wormhole.

PHost will read and update wormhole.txt. A backup copy of the old file will be written as wormhole.bak.

If a wormhole's two endpoints become coincident (by natural displacement, for example), the wormhole is considered "collapsed" and becomes inactive. It still appears in wormhole.txt to avoid renumbering wormholes and confusing player-side tracking utilities. If you want to add wormholes in mid-game, add them to the end of wormhole.txt for the same reason. Likewise, if you want to delete a wormhole, mark it inactive by setting start and endpoint to identical values.