[PHost Logo]©

The Portable Host



This page describes the installation and operation of wormholes in PHOST. Wormholes are imaginary connections between two points in the VGA Planets universe. Ships that arrive at one end of a wormhole instantly disappear and reappear at the other end. Wormholes may be given attributes that indicate how stable and safe the wormhole is, as well as destination waypoints that cause the wormhole to move over time.

The implementation of wormholes in PHOST is largely based upon the existing WORM program (written by Hans-Jochen Kirchhoff) in use for the original HOST. The WORM program is therefore not necessary when hosting with PHOST.

Back to the index

Playing with Wormholes


A player must first discover the location of a wormhole before attempting to use it (unless the player is very lucky and lands on one of the wormhole's entry points). Wormholes are discovered by ships that scan for them, much in the same way that ships scan for mines. ==> A ship whose friendly code is WRS is considered to be scanning for wormholes. The probability that a wormhole is actually discovered is related to the distance between the ship and the wormhole's entry as well as the wormhole size (mass). The exact formula is given on the "Detailed Operation" page. Note that the friendly code WRS is considered special and will never match other friendly codes.

When multiple wormholes are within scan range, then only the closest wormhole detected is reported. Since detection is a function of wormhole mass as well as distance from ship to wormhole, the wormhole reported is not necessarily the closest wormhole to the ship (the reported wormhole may have a mass much higher than a closer wormhole giving it a higher detection probability).

An exception to the above rule is the Bohemian Class Survey Ship. This ship is specially outfitted with state-of-the-art wormhole scanning equipment and is able to report all wormholes detected on a single turn.

Wormhole scan reports identify the position of the wormhole as well as its mass and stability (as a qualitative description). ==> The original WORM add-on program also reported the distance from the scanning ship to the wormhole, along with the heading, but PHOST always reports the distance as 999 LY and the heading as 99 degrees. The reason these numbers aren't provided is because PHOST summarizes wormhole scan information each turn. Only one scan message is generated for each wormhole, regardless of how many ships actually scanned the wormhole. Thus, since multiple ships may have scanned the wormhole, providing a distance measure and heading is not meaningful.


Once a wormhole's entry point is discovered (a bidirectional wormhole has two entry points, a unidirectional wormhole has only one), a ship can travel through the wormhole by arriving at or near the wormhole's entry and setting its friendly code to WRT. Note that the friendly code WRT is considered special and will never match another friendly code (even if WrmVoluntaryTravel is disabled).

Wormhole travel occurs immediately after movement. After normal movement is complete, ships that occupy a point in space near a wormhole entry and have their friendly code set to WRT (if WrmVoluntaryTravel is enabled) immediately move to the other end of the wormhole. After wormhole travel, a ship's friendly code is set to WRS (if WrmVoluntaryTravel is enabled) to guard against accidental travel back through the wormhole. A ship can only travel through a single wormhole in a given turn.

Here are some notes on wormhole travel:

Voluntary Travel
If the WrmVoluntaryTravel configuration option is disabled, then a ship's friendly code need not be WRT; the ship need only be within the wormhole's entry radius for it to be drawn into the wormhole, regardless of its friendly code. Thus, ships can be towed through wormholes against their will if WrmVoluntaryTravel is disabled.

Towing through Wormholes
Ships cannot tow when travelling through wormholes so a ship that is towed to a wormhole (and travels through it) must navigate a wormhole under its own power. This means that a towed ship will consume fuel in the wormhole.

Wormhole Entry Radius
The radius around a wormhole entry within which ships are drawn into the wormhole is related to the wormhole's size (mass). The exact relation is given on the "Detailed Operation" page. The entry radius of a wormhole is also determined by the WrmEntryPowerX100 configuration parameter. The relationship between these parameters and the wormhole's entry radius is given on the "Detailed Operation" page.

Wormhole Exit Point
Since wormhole travel is inherently unpredictable, it is no surprise that ships that travel through wormholes do not end up exactly at the exit co-ordinates of the wormhole. In practice, ships are positioned at random positions a few light years from the wormhole's exit.

The use of cloaking devices while travelling through wormholes is controlled by the WrmTravelCloaked configuration option. If this option is enabled, then cloaked ships remain cloaked while travelling through wormholes. If this option is disabled, then cloaked ships appear uncloaked at the wormhole exit point.

Travel through wormholes is unaffected by minefields that overlap the wormhole.

Fuel Consumption

Travel through a wormhole consumes additional fuel. The fuel consumption is calculated as the equivalent of travelling the length of the wormhole divided by the WrmTravelDistDivisor configuration option at a warp speed determined by the WrmTravelWarpSpeed configuration option. For example, if WrmTravelWarpSpeed is 9 and WrmTravelDistDivisor is 100, then a ship travelling through a wormhole that is 500 LY from start point to end point will consume fuel as if the ship were travelling 5 LY (500 divided by 100) at warp 9.

==> A ship that runs out of fuel while travelling through a wormhole will suffer great damage to the hull and may even be destroyed. If the ship does survive the passage, then it will not appear at the wormhole exit point but will instead be flung to a random point in the universe.


Travel through wormholes is inherently unsafe, but some wormholes are more safe than others. The safety of a wormhole is related to the wormhole's size (mass) and instability. More precisely, it is the ratio of a ship's mass (hull mass and cargo!) to the wormhole's mass that is considered in determining the safety of a ship's voyage. The relation between the above parameters and the probability of a successful passage is given on the "Detailed Operation" page.

The stability of a wormhole is qualitatively reported in wormhole scan messages as being "stable", or "mostly stable", etc. These descriptions refer to the baseline probability that a ship with equal or less mass than the wormhole will suffer some mishap while travelling through the wormhole. Specifically, the stability descriptions of wormholes are reported as follows:

Baseline Probability
of Failure
Stability Description

0% - 5%

very stable

5% - 15%


15% - 30%

mostly stable

30% - 50%


50% - 80%

very unstable

80% - 100%

completely unstable

Should a ship fail to travel safely through the wormhole then the ship's hull will suffer damage. The amount of damage is related to ratio of the ship's mass and wormhole mass as well as wormhole instability. A ship may even be destroyed if the damage is too great.

Back to the index

Creating Wormholes

Wormholes are enabled in PHOST by setting the AllowWormholes configuration option. If wormholes are enabled, then at the start of turn processing, PHOST will look for a file named WORMHOLE.TXT in the game directory. This is assumed to be a plain text file and must have the following structure:

The interpretation of the 6 to 10 numbers for each wormhole is as follows:

  1. (X,Y) Start Position (required)

  2. (X,Y) End Position (required)

  3. Wormhole Mass (required)

  4. Wormhole Instability (required)

  5. (WX,WY) Start Position Waypoint (optional)

  6. (WX,WY) End Position Waypoint (optional)

A sample WORMHOLE.TXT file is included in the PHOST distribution.

Once the WORMHOLE.TXT file is read in, the attributes of each wormhole are updated (see below) and the file is overwritten with the new information. All lines which do not describe wormholes (i.e., comments and blank lines) are preserved. The original WORMHOLE.TXT file is written to a file named WORMHOLE.BAK in the game directory.

PHOST supports a maximum of 100 wormholes.

Wormholes are assigned ID numbers for easier tracking. The ID numbers simply correspond to the order of definition of wormholes in the WORMHOLE.TXT file. Thus, the first wormhole is given ID's of 0 (for the entry point) and 1 (for the exit point). ==> If the wormhole is unidirectional, the entry point is assigned an even-valued wormhole ID but the next wormhole ID (which will be odd-valued) is skipped so that wormhole entry points always have even-valued ID's and exit points are always given odd-valued ID's. Unidirectional wormholes, then, are only assigned even-valued wormhole ID's.

==> In order to not confuse player utilities, it is required that wormhole definitions not be removed from the WORMHOLE.TXT file (this would shift all wormhole ID's following the removed wormhole down by 2). New wormholes should only be added to the end of the file. To remove a wormhole, simply set the entry point co-ordinates and the exit point co-ordinates to the same value (i.e., the entry point is in the same place as the exit point). Do not comment out the wormhole. Finally, do not change wormholes from being unidirectional to bidirectional, or vice versa.

Note that if a wormhole's entry and exit points become coincident (due to natural displacement) then the wormhole is considered to be "collapsed" and becomes inactive.

In summary, a wormhole is considered inactive if at any time its entry point and exit point are in the same location, whether this happens by manual editing of the WORMHOLE.TXT file, by natural movement of the entry and exit points, or by the wormhole's mass having shrunk to 0 (at which time PHOST will set the entry and exit points to (0,0)).

Back to the index

Wormhole Configuration Options

The behavior of wormholes is controlled by several configuration options. Some of these options are discussed below in the section on using wormholes. The options that pertain to the administration of wormholes are described here.


This configuration option specifies the magnitude of displacement for both wormhole start and end points (the entry points). If a wormhole's entry points do not match the entry point destinations then each entry point moves toward its destination by WrmDisplacement light years each turn.


This configuration option specifies a random component to add to the start point and end point displacements. The value of this parameter represents the maximum magnitude of random displacements to add to the fixed displacement WrmDisplacement of each wormhole. Specifically, the new wormhole co-ordinates can be calculated as:

The sign of the WrmDisplacement component depends upon the direction of movement.

The WrmRandDisplacement parameter applies to both start and end points of the wormhole. This parameter may be set to 0 to allow for predictable motion (or no motion at all in case the wormhole's entry points are the same as the entry point destinations).


This parameter indicates a constant amount of stability to apply to all wormholes. The number specified is divided by 10 (keeping the fractional part) and then subtracted from the instability measure of each wormhole. This number may be negative to indicate a loss of stability. A wormhole's instability will never be allowed to fall outside the range [0,100].


This parameter specifies the maximum magnitude of a random value to add to the instability of every wormhole on each turn. The random value may be positive or negative. Thus, every wormhole's new instability figure is calculated as:


This parameter indicates a constant amount of mass to add to all wormholes on each turn. This number may be negative to indicate a decrease in mass. Once a wormhole's mass reaches 0 then the wormhole disappears.


This parameter specifies the maximum magnitude of a random value to add to the mass of every wormhole on each turn. The random value may be positive or negative. Thus, every wormhole's new mass is calculated as:

Should the wormhole's mass fall to 0 or below, then the wormhole disappears.

Back to the index

Wormholes as UFO's

WinPlan players may be allowed to see wormholes plotted on the starchart as UFO's (configurable by the host). The wormhole database is in the WORMHOLE.TXT file, however, not in the UFO.HST file so the mechanism by which wormholes appear as UFO's requires some explanation.

PHOST supports a maximum of 100 bidirectional wormholes. Each bidirectional wormhole is mapped to 2 UFO's, one for the entry point and one for the exit point. This means that PHOST needs 200 UFO's to display all possible wormholes. Thus, PHOST reserves a range of 200 UFO numbers. This range can be configured with the WormholeUFOsStartAt config option. For example, if WormholeUFOsStartAt is set to 150, then PHOST will use UFO ID numbers 150 through 349 to report wormholes as UFO's.

PHOST does not write wormholes to the UFO.HST file. Rather, when writing out UFO information to RST files (only for registered WinPlan players), PHOST will ignore  any (non-wormhole) UFO's in the 200-UFO range reserved for wormholes. ==> It is important to realize that any other UFO's in this reserved range will not be seen! The WormholeUFOsStartAt option should be chosen so that no conflicts are possible with other programs that use UFO's.

Wormholes reported this way have type 1 and color 2 (green).

There used to be a limit of 100 UFOs in the RST file, hence almost everyone set the WormholeUFOsStartAt config option to 51, allowing for 50 UFOs and 50 wormholes (either 25 bidirectional ones, or 50 unidirectional ones). Since version 3.3e, PHOST supports up to 1000 UFOs (like HOST 3.22), hence the setting "51" allocates UFO slots 51 to 250 for PHOST.

Back to the index

This document is maintained by The Portable Host Project[Remote] (support@phost.de).

Last updated 7 December, 2001