© |
Order of Battle
The Portable Host
Version 3.2.3.5g
|
INDEX
Introduction
This page describes the order-of-battle (OOB) as implemented in PHOST.
The OOB is based upon the documented OOB in HOST 3.2 along with some invention
where the original documentation is not complete.
After the movement phase is complete, sets of ships that all occupy
the same point in space can engage in combat. For a ship to engage in combat,
it must not be cloaked (unless AllowCloakedShipsAttack
is enabled and it has a primary enemy set) and it must have fuel (unless
the AllowPlanetAttacks
configuration option is enabled). If a planet occupies the same position
in space, it too will participate in combat.
Combat proceeds in two phases. The first phase is known as the Intercept
Attack (XA) phase, and the second phase is known as the Aggressor/Opponent
phase.
Back to the index
The Intercept Attack (XA) Phase
The Intercept Attack phase is enabled by the AllowInterceptAttack
config option. If this
option is not enabled, then this phase is skipped completely.
In the Intercept Attack (XA) phase, ships on an intercept mission fight
the ships that they are intercepting. In order for a ship to be considered
for an XA, it must meet the following criteria:
-
The ship's mission must be set to Intercept
-
The ship must have cloaking capability (
NOTE: only cloaking capability is required, the ship need not, in
fact, cannot be cloaked for an XA)
-
The ship must have fuel
-
The ship must have a primary enemy setting
-
The intercept target must exist and must be of the same race as the intercepting
ship's primary enemy. The intercept target must, of course, also be at
the same position as the intercepting ship.
If these criteria are met then the intercept target is checked for
meeting the following criteria:
-
The ship must be fueled
-
The ship must not be cloaked
-
The ship owner is not an ally to whom the XA ship owner has granted the
combat level of alliance
-
The friendly codes of the two ships do not match (remember that in PHOST,
special friendly codes never match)
If all these criteria are met, then the two ships fight.
If there are two or more ships performing an XA mission at the same location,
they will fight in the order indicated by their friendly code
battle order
(see below). In PHOST 3.4a and below, and in HOST, the ship with
the highest ID number fights first, and combat then proceeds in decreasing
order of ship ID numbers.
Back to the index
The Aggressor/Opponent Phase
Once the XA phase is complete, the Aggressor/Opponent phase begins. In
this phase, combat proceeds by repeatedly following the steps below until
no more battles can be performed. The order in which ships fight in this
phase is determined by an ordering process that
is described below.
-
Find an aggressor
If no aggressor can be found, combat is over.
-
Find an opponent for this aggressor
A possible opponent cannot fight the aggressor if, for example, the
friendly codes match, or the two combatants are allies
with combat level enabled. If no opponent can be found, find another
aggressor (the aggressor search is continued from where it was stopped
in step 1).
-
Perform the battle between aggressor and opponent
-
Return to step 2 if aggressor survives
The aggressor continues fighting opponents until all possible opponents
for this aggressor have been exhausted or the aggressor is destroyed (or
can no longer be an aggressor, if perhaps it is captured or has run out
of ammo).
-
Repeat from step 1
To find an aggressor, the next (or the first) ship/planet in the battle
order list is considered. For ships, if the ship is fuelless, or has
no Kill mission and no primary enemy, then the ship is ignored and the
next entry in the battle order list is considered. For planets, the planet
must have an ATT or NUK code (and AllowPlanetAttacks
must be enabled) for it to be an aggressor.
Finding an opponent for an aggressor simply involves going through the
battle order list from the beginning and choosing the first ship/planet
that may fight the aggressor (i.e., it does not match friendly codes, the
two ships are not allies, etc.) An aggressor will fight all possible opponents
in the ship list until the aggressor is destroyed, is captured, or runs
out of ammo.
Back to the index
Battle Ordering
Once a list of all participating ships (and possibly a planet) is compiled
for a particular location in space, the list is sorted according to the
following criteria (in decreasing order of importance):
-
The ship or planet's friendly code numeric interpretation. Ships/planets
with lower numeric friendly code values will fight first.
-
The ship or planet's ID number (if two or more ships/planets have the same
friendly code numeric interpretation)
-
The ship precedes the planet (if both ship and planet have the same FC
numeric interpretation and the same ID number)
This sorted list containing ships and possibly a planet is known as the
battle order list. It represents all possible combatants at the
same point in space, sorted in increasing battle order (as determined by
friendly code and ship/planet ID).
The friendly code (FC) ordering is based upon a numeric interpretation
of the FC. The rules for numeric interpretation are:
-
FC's containing only digits (0 through 9) are interpreted simply as the
number itself.
-
FC's that begin with the character '-' (minus sign) and are followed by
2 digits (0 through 9) are interpreted as the negative of the number represented
by the 2 digits.
-
FC's that do not fall into one of the above two categories have a numeric
interpretation of 1000.
For example:
FC |
Numeric
Interpretation |
001 |
1 (rule 1) |
010 |
10 (rule 1) |
01a |
1000 (rule 3) |
10b |
1000 (rule 3) |
a10 |
1000 (rule 3) |
oof |
1000 (rule 3) |
5ia |
1000 (rule 3) |
5o9 |
1000 (rule 3) |
-13 |
-13 (rule 2) |
-09 |
-9 (rule 2) |
-a5 |
1000 (rule 3) |
-3* |
1000 (rule 3) |
If a friendly code has an equivalent numeric value of 1000 (non-numeric
characters in the code), then the actual code used for combat ordering
is determined by the following rules:
-
For a planet, if the planet's friendly code is NUK or ATT
and the AllowPlanetAttacks
config option is enabled, then the planet is assigned a numeric code of
0.
-
Otherwise, if the planet has at least 1 defense post, it gets a numeric
code of 1001. If the planet has no defense posts, it is assigned a numeric
code of 1003.
-
For ships, if the ship has any weapons and is aggressive by using Mission Kill
or a Primary Enemy, it is assigned a numeric code of 1000. Armed ships that
are not aggressive are assigned a numeric code of 1002. Unarmed ships (freighters)
will get 1004.
This is a change in version 3.2.3.5e. Previously, all armed ships got
code 1000, independent from their aggressiveness, freighters got 1002.
In summary then, here are the various numeric values used in combat ordering:
Numeric Range |
Possible Sources |
-99 to -1
|
Ships and planets with a numeric friendly code of -99 through -1 |
000
|
Planets with NUK/ATT code and AllowPlanetAttacks
enabled
Ships and planets with a numeric friendly code of 0 |
001 to 999
|
Ships and planets with a numeric friendly code of 1 to 999 |
1000
|
Ships with non-numeric friendly codes, mission kill or primary enemy, and with at least 1 weapon |
1001
|
Planets with non-numeric friendly codes and at least 1 defense post |
1002
|
Ships with non-numeric friendly codes, not aggressive, and with at least 1 weapon |
1003
|
Planets with non-numeric friendly codes and no defense posts |
1004
|
Ships with non-numeric friendly codes and with no weapons |
Back to the index
Notes on Combat
There are some points of interest to note with respect to combat:
-
If a planet is destroyed (captured) in battle then its friendly code is
set to a random numeric value, and it is assigned a battle order of 1003
(regardless of its new numeric friendly code). This prevents the planet
from becoming an aggressor for the remainder of combat. This randomization
of friendly code also happens if the planet has no ammo after a battle
(for example, if it has 0 defense posts).
-
If a ship finishes a battle with no offensive capability (i.e., no beams,
no torps, and no fighters) then its mission (if it is Kill) and primary
enemy settings are cleared and the ship can no longer be an aggressor.
Its battle order, however, does not change.
-
Similarly, if a ship is captured in battle then its kill mission and primary
enemy settings are cleared, again preventing the ship from continuing its
role as an aggressor. The battle order of the ship does not change.
-
Cloaked ships with their primary enemy set to a certain race will only
fight ships if they belong to that race.
Two cloaked ships will never fight each other, regardless of the primary
enemy settings.
-
A cloaked ship will never fight
a planet.
-
Two ships of the same race will never fight, regardless of the primary
enemy setting.
-
Special friendly codes never
match. Special friendly codes include all registered and unregistered friendly
codes (even if registered functions are disabled in the host configuration)
as well as the special planetary friendly codes ATT and NUK.
These planetary friendly codes are considered special even if they are
used by ships.
Back to the index
This document is maintained by The Portable Host Project
(support@phost.de).
Last updated 9 January, 2010