Requirements (SEV)

From SEWiki
Jump to: navigation, search

Requirements determine whether a particular game object can be utilized by an empire. Most often, requirements set which technologies at which levels are required. This is especially true of technologies, facilities, and components. Even cultural achievements have requirements. An object may have as many requirements as is necessary to determine whether it can be used, and when there are multiple requirements, they can be evaluated in several different ways.

Structure of a Requirement Block

Field Name Description
Number Of Requirements Integer Total Number of All Requirements
Requirements Evaluation Availability see below Allows Availability is used to determine if the item is available to the empire. Essentially, if it evaluates to true, that item appears in the relevant list screens. For a tech area, it is used to determine if the tech can be researched. For a component, facility, vehicle, etc., it determines whether it shows up in the list at all. It cannot be used to prevent placing an item, since these requirements are never evaluated at the object level (e.g. components availability requirements never check ship data, or the data of components already on the ship).
Requirements Evaluation Allows Placement see below Allows Placement requirements are used to determine if a component can be legally mounted on a ship, or if a facility can be legally added to the construction queue on a planet. These formulas have access to the parent object's data, including other components/facilities already present. This requirement type has no relevance in data files where there is no "parent" object.
Requirements Evaluation Allows Usage see below The function of Allows Usage requirements is not known in full. In the stock data files, the only place this type of requirement is used is weapon mounts. Mounts use a Placement requirement to check the weapon type of the component, but a Usage requirement is used to check the vehicle hull size. How these differ in that context is a mystery that bears further investigation.
Requirements <n> Description Any Text This is what is displayed in the description when the object is examined in the game, where <n> is the number of the requirement being described.
Requirements <n> Formula Formula Expression When using multiple requirements, this determines how they are evaluated together to determine if the requirements are met, where <n> is the number of the requirement the formula applies to.

Sample Requirement Block

Number Of Requirements                    := 2
Requirements Evaluation Availability      := AND
Requirements Evaluation Allows Placement  := TRUE
Requirements Evaluation Allows Usage      := TRUE
Requirement 1 Description                 := Empire must have at least tech level 5 in Huge Hull Construction. 
Requirement 1 Formula                     := Get_Empire_Tech_Level("Huge hull Construction") >= 5
Requirement 2 Description                 := Empire must have at least tech level 5 in Large Base Construction. 
Requirement 2 Formula                     := Get_Empire_Tech_Level("Large Base Construction") >= 5

Uses of Requirements

Requirements determine the availability of an object through the use of functions. Most often a requirement checks for the empire's level in a particular technology or racial trait. However, while this is the most common use, a Requirement may additionally (or only) check a variety of things, such as the existence of another object or even whether an empire has no homeworlds left. If you want to make an object available at all times, simple set the Number of Requirements to 0 and get rid of the other fields below it (they are only required if you have requirements).

Requirements Evaluation

Each requirement type is evaluated as a boolean function combining requirement terms. For the requirement evaluation type to be satisfied, the result of this function must be true. Each requirement evaluation type can define which requirements are used in the function in one of the following ways.

Value Description
AND All requirements will be used in the evaluation function. The terms will be ANDed together.
e.g. With 3 requirements, the formula becomes:
Evaluation = Req1() AND Req2() AND Req3()
OR All requirements will be used in the evaluation function. The terms will be ORed together.
e.g. With 3 requirements, the formula becomes:
Evaluation = Req1() OR Req2() OR Req3()
TRUE The requirement always evaluates to true. No terms will be used.
LIST Comma separated list of requirement terms to use in the formula. The terms will be ANDed together.
e.g. With a value of "1,2,3", the formula becomes:
Evaluation = Req1() AND Req2() AND Req3()

Requirements for Facilities and Components

In Facilities and Components, the first Requirement (Requirement 1) stated may also perform the function of setting the Level Progression of that object. The most common progressions are linear progression, such that each time you gain a level in a tech, you gain a level for the linked facility or component. Additionally, though the default game does not utilize this, it may also be used to create many alternative level progressions. Some examples of alternative level progressions are provided below.

Sample Requirement Formulae

Alternative Level Progression Formulae

Linear Progression Formula (at every level)

The following formula increases the level of the object every time a level is gained in the specified Tech Area. This occurs from the Start Level (an integer) and continues until the Maximum Level is reached.

Formula

Formula  := Get_Empire_Tech_Level(Tech Area) >= (Start Level + ([%Level%] - 1))

Sample

This sample gives the object a level at every level after the empire reaches level 5 in Centralized Computer Systems.

Requirement 1 Formula       := Get_Empire_Tech_Level("Centralized Computer Systems") >= (5 + ([%Level%] - 1))

Linear Progression Formula (at every n levels)

The following formula increases the level of the object every time the number of levels specified by the interval are gained in the specified Tech Area. This continues until the Maximum Level is reached.

Formula

Formula  := Get_Empire_Tech_Level(Tech Area) >= ([%Level%] * interval)

Sample

This sample give the object a level every other time the empire gains a level in Centralized Computer Systems.

Requirement 1 Formula       := Get_Empire_Tech_Level("Centralized Computer Systems") >= ([%Level%] * 2)