This article describes the various mechanisms for having stations defended by ships.

Initial Creation of Ships

The <Ships> element in a station type specifies the set of ships that should be spawned when the station is created. For example:

<StationType unid="..."
   ...
   />
   ...
   <Ships>
      <Ship count="1d6" class="&scBorer;"   orders="guard"/>
      <Ship count="1"   class="&scBorerII;" orders="patrol:10"/>
   </Ships>
</StationType>

The <Ships> element is treated as a ship table and all ship table directives are valid. For example, you can use <Table> or <LevelTable> directives to generate random sets of ships.

Reinforcements

There are several, often conflicting, ways of specifying reinforcements for a station. We describe the various methods here.

Challenge Rating

The easiest way to implement reinforcements is to specify a challenge rating for the ships table. The challenge rating is a keyword that specifies how powerful the total set of station defenders should be. When the station is created, we create enough ships (from the <Ships> table) to satisfy the challenge rating.

If the current station defenders fall below that level, more defenders are called by rolling on either the <Ships> or <Reinforcements> tables.

For example:

<Ships challenge="standard">
...
</Ships>

The following challenge values are supported:

CHALLENGE      NOTES
---------------------------------------------------------
easy           Equivalent to 1.5 ships of system level.
standard       2.5 ships of system level.
hard           4 ships of system level.
deadly         6 ships of system level.

The advantage of this method, beyond its simplicity, is that it deals with defenders of varying powers. For example, if one defender type is a capital ship this method will treated as a very powerful ship and not try to continue calling for reinforcements.

Standing Count

One disadvantage of the challenge rating method is that it is hard to predict exactly how many ships will become defenders. For stations with limited docking ports, sometimes it is better to specify defenders in terms of numbers. This is done with the standingCount parameter:

<Ships standingCount="5">
...
</Ships>

In the example above, the engine makes sure that there are at least 5 ships guarding the station at all times. If not, it creates ships from the ship table until it reaches the given value.

We do this at creation time, so in some cases we'll run the ship table multiple times until we get the desired number of ships.

Approximately every 20 seconds (real time) we check to see if we still have the appropriate number of ships. If not, we generate ships from the table until we do. [Note that we always use the <Ships> table. In this mode we never use the <Reinforcements> table, if any.]

Note that the standing count is not a maximum. If there are 4 ships guarding and we want 5 but the table generates 3 new ships, we will end up with 7 ships total. Make sure you set up the table appropriately to handle this case. For example, you might want to only generate a single (random) ship.

For purposes of figuring out the standing count, only principal ships are counted. For example, if a station is guarded by a destroyer that itself has 4 escorts, the standing count is 1 (only the destroy counts) not 5.

Random Standing Count

The standing count can be a dice range to have the number of guards be random. For example:

<Ships standingCount="2d6">

In this case, we generate a random number once when the station is created and keep it consistent throughout. For example, we might roll the number 5 when we create the station. Ever after we will use 5 as the standing count.

Minimum Ships

A different method for specifying reinforcements is to use minShips=. For example:

<Ships minShips="2">

This method differs from standingCount= in the following ways:

  • minShips is a constant (non-random) value.
  • standingCount is used at create time to create the appropriate number of ships. We will roll the <Ships> table to create up to that number of ships. In contrast, minShips is only used afterwards. At create time we roll the <Ships> table only once.

This method is useful if you want the starting ships to be well-defined but you want reinforcements to show up.

Source of Reinforcements

By default, reinforcements are brought in from the nearest stargate. If we're constantly requesting reinforcements, then it could be that they are getting killed before they reach the station. In that case, the engine starts to back off on reinforcement requests.

You can also use the buildReinforcements parameter to have the ships come from the station itself. For example:

<Ships standingCount="2d6" buildReinforcements="true">

Reinforcements Table

Sometimes we want the reinforcements to be different from the initial defenders. In that case, we use the <Reinforcements> table:

<Ships>
...
</Ships>

<Reinforcements minShips="5">
...
</Reinforcements>
the_shrike 30 Nov 2016:

Is this patch-friendly? If I upgrade from a reinforcements table to a randomised standingcount, will a diceroll be generated on existing savegames?

(Also, which API does this start from?)

george moromisato 2 Dec 2016:

@the_shrike: I haven't tried it, but I believe it will work correctly. If you upgrade to a randomized standingcount, it should work correctly. We don't actually roll the dice on station creation (that's just an abstraction). The actual implementation uses the station's destiny value (which is generated randomly at creation) to seed the standingcount value.

Since the destiny value has been there since the beginning, it should end up with a valid, randomize standing count value.

As for API, the standing count stuff is from, I think, API 30 or earlier, but the buildReinforcements parameter is from API 32.

assumedpseudonym 25 Jan 2017:

 Is there a way to specify that some reinforcements can be built by the station, but others cannot?

george moromisato 25 Jan 2017:

@assumedpseudonym: Not currently. Your best bet is to have a <Construction> element. See Luminous assemblers.

johnbwatson 10 Jun 2017:

Would it be possible to cap the number of reinforcements of a certain type that a station can spawn? It's a bit disheartening for a station to spawn an infinite supply of capital ships, unless it's a shipyard.

relanat 6 Jun 2019:

Thanks for this. It is very helpful.