FreeStars 'Requires' Proposals
There is some debate in the FreeStars developers (most caused by me I admit ;-) over the correct format for technology and other requirements. Here is my proposal for a format.
I'll start by giving an existing component example:
<component>
<name>Interspace-10</name>
. . . <!-- other things here -->
<requires>
<tech type="propulsion">11</tech>
<lrt>No Ram Scoop Engines</lrt>
</reqiures>
</component>
So to use an Interspace-10 you require propulsion technology level 11 in propulsion (or better), AND the lesser racial trait, No Ram Scoop Engines.
The advantage from a structural point of view is that all requirements can easily be found. Also the fact that all those items are requirements is spelt out.
If there are multiple requirements that are an or requirement this can be done by using multiple requires:
<component>
<name>Speed Trap 20</name>
. . .
<requires>
<tech type="propulsion">2</tech>
<tech type="biotechnology">2</tech>
<prt>Inner Strength</prt>
</requires>
<requires>
<tech type="propulsion">2</tech>
<tech type="biotechnology">2</tech>
<prt>Space Demolition</prt>
</requires>
</component>
There is some duplication here.
On the other hand, consider a scenario where you wished everyone to be able to access the Ultra-Driver 11 mass driver, but the PP races can access it a lower level. Then the requirements could read:
<component>
<name>Speed Trap 20</name>
. . .
<requires>
<tech type="energy">17</tech>
<prt>Packet Physics</prt>
</requires>
<requires>
<tech type="energy">22</tech>
</requires>
</component>
Possible requirements
- <tech type="X">: The race requires technology X at the listed level.
- <lrt>: The race must have the list Lesser Racial Trait.
- <prt>: The races PRT must match the listed Primary Racial Trait.
- <MTGift>: The race must have been given the listed benefit name from the Mystery Trader.
- <turn>: It must be at least at least the listed turn before this item is available (Might be useful for certain scenarios).
Banned Traits
Some traits cannot get specific components. There are three possible solution.
Solution 1: The brute force approach: List an option with every OTHER racial trait. This is stupid.
Solution 2: A <requires> tag lists an inverted tag. This can be specifed either as a <nolrt> tag OR with a inversion flag and an attribute. Exmaples (for a gate):
<requires>
<tech type="energy">17</tech>
<tech type="construction">11</tech>
<noprt>Hyper-Expander</noprt>
</requires>
or
<requires>
<tech type="energy">17</tech>
<tech type="construction">11</tech>
<prt forbidden="forbidden">Hyper-Expander</prt>
</requires>
Solution 3: You have a separate <forbidden> tag. This is simpler to understand, but less flexible. Example to ban a gate for a hyper expander:
<requires>
<tech type="energy">17</tech>
<tech type="construction">11</tech>
</requires>
<forbidden>
<prt>Hyper-Expander</prt>
</forbidden>
I would suggest solution 2. This is more flexible as it allows things like a basic gate being allowed for Hyper Expander, but 10 tech levels higher then everyone else for instance:
<requires>
<tech type="energy">12</tech>
<tech type="construction">10</tech>
<noprt>Hyper-Expander</noprt>
</requires>
<requires>
<tech type="energy">22</tech>
<tech type="construction">20</tech>
</requires>