MoO3 Patcher
Spreadsheet Modding

The AutoBuild patch is the most complex patch that has been made. As the name implies, it completely replaces the in-game code that is used to design a ship by either the AI, or when the player selects the 'Auto-Build' button.

With just the patch installed, the ships built will be only marginally better than the defaults. However, the real advantage of the Autobuild patch comes from the Autobuild.txt spreadsheet. This spreadsheet (unlike the default MoO3 spreadsheets) needs to go in your main MoO3 directory, the same place that the Moo3dll.dll file is located.

If you have no interest in designing the autobuilt ships yourself, then you need read no further. All of the information past this point describes how the Autobuild.txt file is created.

The file itself is split up into three different sections. The first section, called the 'Alias' section, allows you to define rules to choose ship components. Each table deals with a different component type, of which there are a total of 8. Most of the tables have 3 columns. The first column is the 'Alias' column. The text you choose for the alias will be used later in the ship design section to identify which component, and which formula you wish to use. Each alias must be unique. The second column assigns the sign for the formula that you will use. And the third column contains the formula itself.

The formula is used to rank each component. For example, if you chose a formula of 'UniSpace * SystCost', then the UniSpace and SystCost values of each component would be checked. How it is checked is where the 'Sign' value comes in. The sign can either be > or <, that is, greater than or less than. If it were >, or greater than for the formula 'UniSpace * SystCost', then the component with the largest UniSpace times SystCost would be selected. If it was <, or less than, then the smallest would be selected.

For some component types, there are modifier components that affect the base. For example, for ship weapons, there are ship weapon modifiers and weapon mounts, both of which can change the value(s) of the original weapon. The formula system takes every combination into consideration. For example, if you've researched the Laser, Autofire Laser, Continuous Laser, Standard Mount and Spinal Mount, the following combinations would be used:
Standard Laser
Standard Continuous Laser
Standard Autofire Laser
Standard Continuous Autofire Laser
Spinal Laser
Spinal Continuous Laser
Spinal Autofire Laser
Spinal Continuous Autofire Laser

If we used the earlier formula of 'UniSpace * SystCost', the value for each combination would be calculated, and the largest or smallest (depending on the sign) would then be chosen.

Previously I mentioned that most of the Alias tables were the same. Two of them are slightly different. The 'Missiles' table contains an extra column called 'Reloads'. As one might expect, this sets the number of missile reloads that weapon will have. The second table that is different is the ShipItem table. Unlike all the other tables, it doesn't have a 'Formula' column, it has a 'Tag' column. The 'Tag' column is used to determine which 'Tag_Values' tag will be looked at to select that item. For example, by default the ECCM looks for the 'OffTgtRg' tag. So every ShipItem (or ShpMItem) type that you have researched will be scanned for that tag. The 'Sign' column then determines whether you want the largest or smallest value for that tag.

The next section of the Autobuild.txt file is devoted to the ship designs themselves. There is a table for each type of ship (LR, SR, etc). Each ship is already assumed to have selected the hull size, hull type, and had all of the ShReqSys (Ship Required Systems) placed on board.

There are 4 columns for each ship design. The first is the 'Alias' column. This is where the aliases from the previous section are put to use. Using an alias here tells the Autobuild routine to look up the sign and formula for that particular component.

The next column is for 'Percentages'. This can have two different functions, depending on the type of component. Specifically, for ship engines, it tells the ship how fast it should go. The percentage is multiplied against the top speed of the engine, to determine what speed (and how much space) it should use. For every other type of component, the percentage is used to determine how much of the currently available space (or space remaining) should be used by that component. For every component where space is not a factor, the '-' tag should be used to denote that it is 'unused'.

The third and fourth columns are for 'Min' and 'Max' values respectively. The Min and Max values can be used instead of, or in conjuction with the percentages column. They are prioritized in this order:

An example will help clarify how this functions. Let's assume we want to put a component on a ship that takes up 20 space, and we have a total of 30 remaining space on the ship. The Percentage is set to 50, Min is set to 1, and Max is set to 2. When it gets time to add the component to the ship, it looks at the percentage (50%) of remaining space, which is 15. Normally, because that is less than the 20 space the component takes up, it would not add the component to the ship. But the Min is set to 1, so despite the fact it takes up more than 50% of the space, the component will be added.

Now, let's consider another example. Same component, but now we have 200 space remaining. The Percentage, Min and Max values are all the same. This time, when it looks at the percentage of remaining space it can use, the value is 100 units. That means it could fit 5 of the component onboard the ship. However, it then looks at the Max value. Because the Max is set to 2, it will only put that many on the ship instead of 5.

The order that items are placed aboard the ship is very important. The order of:
Warp Drive
System Engine
should not be changed (unless you don't wish shields on the ship design). After those four items, the order is no longer important, although it may become so depending on how you wish your ships designed.

Note: The ship designs are identical regardless of which hull type (Starship, Systemship or Orbital) is being designed. However, the routine will recognize the hull type, and modify accordingly. Warp Drives will not be added to Systemships or Orbitals, for example, regardless of what the design says.

The final section of the Autobuild.txt file is deals with ship names. There are four tables in this section. The first table contains the strings that assign the name itself. Any plain text is used as is, any tag that starts with % is set based on the particular tag. The current tags are:
%t - Hull Type (StarShip/Systemship/Orbital)
%h - Hull Size
%m - Ship Mission (LR/SR/etc)
%s - Ship System Speed
%w - Ship Warp Speed
%n - Ship Design Number
%# - Turn Number

The second table contains the 'codes' for the hull types, the third table contains the 'codes' for the hull sizes, and the fourth table contains the 'codes' for the ship missions.

Some examples:

The ship we have designed is a Battlecruiser Starship. It's a SR ship, with a system speed of 2100, and a warp speed of 105. It was the 25th ship designed, and we created it on turn number 70.

%t%h-%m%# - StrBcr-SR70
%m %w - %t%h - SR 105 - StrBcr
Royal Ship %m:%n - Royal Ship SR:25

In each case, the 'Str', 'Bcr', and 'SR' values came from the other three tables in this section. By changing those, you can also affect how the name will turn out.

As you can see, you can adjust the names as much as you'd like. However, it's important to note that not only will your ships have these names - so will all the AI ships. You don't often see the AI ships, so it won't matter in most cases, but it's something to bear in mind.

email: bhruic@gmail.com
Copyright © Mental Static Software 2005