t should be all in one file, to simplify making and distributing translations.
Yes I agree completly
But Idealy they would be grouped as child elements under a single <Fluff_Groups> root element on on one document.
We should do the xml plan first, then it will be much simpler to come up with the code involved (or atleast I hope it will be). You list a lot of good Pre-Requisite types their and I will try to come up with some formating for them. Most of the values should be atributes to keep the doc readable. Here is a shot at it.
First off Technology Pre-Requsites are going to be needed for almost everything in the game. Fortunatly Tecnology is an Empire wide, non-corporeal thing an empire either DOSE or DOSE"NT have any particular tecnology so a simple Name Atribute for the particular Tech is obvious. A Scope atribute will be used for the determining who needs to possess it. I dont think their are any plans for tecnology to ever be lost but it dose seem their should be ways to count how long something has happened for, a Duration atribute can cover that. So we have...
<Prereq_Tech Name="TECH_NAME" Scope="Self" Duration="Now" />
Scope will typicaly hold "Self" meaning that its your empire tht must have the Tech, you can also specify "Any" meaning that any Empire could have the Tech (put this all under a <NOT> braket to negate these). You can specify a raw number say "#3" to mean that 3 empire need the Tech or "All" to require all to have it. A number followed by a % sign asks for a % of all empires. Lastly it would be usefull to have some flexible wildcard values that can be combined with other statments. For example if I want the requirement to be that an empire must have 2 particular techs BUT it must be a single empire having both not 2 different empires having 1 each. I could use a wildcard "@X" to create wildcard empire X, each statmentment under a Pre-Requisite will recognize this wildcard as refering to a single empire. So my above example could be done with.
<Prereq_Tech Tech="A" Scope="@X" Duration="Now" />
<Prereq_Tech Tech="B" Scope="@X" Duration="Now" />
Multiple Wildcard can be used so long on they use a different letter. Now for Duration, this is used to determine time span since aquisition of tecnology. If a value of "Now" is used then the scope Empire just needs to have the tech right now and no more questions are asked. A numerical value means that Scope must have been in possesion of the tech for that many turns. A value of "Ever" means that even having it for a moment is sufficient (this only has any use if it is possible to loss a tecnology, which could be kind of cool and Geoff has speculated along these lines, if its not possible to loss tech then this is functinaly equivilent to "Now"). Lets say I wanted to make a Tech that becomes alalible for research to all Empires once its original owner has for 20 years. That could be done with.
<Tech Name="The_very_hard_to_keep_secret_Tech" Cost="25" Turns="12" Type="Theory" >
<Prereq_Tech Tech="The_very_hard_to_keep_secret_Tech" Scope="Any" Durration="20" />
<Prereq_Tech Tech="Original_means_of_obtaining" Scope="Self" Durration="Now" />
Duration can work in a similar way with several other things such as Building and Specials. This can work much like the Galaxy turn and Timing mechanism Geoff sugjested. I think it would be better though to use the Date of acuisition that dose not need to update each turn (avoiding much processing). Rather age is determined when needed by Subtraction. Every object in the game might need to have an Age so we should add this member directly to the Universe_Object for it to proliferate down to everything in the game. I am shure we could find dozens of uses for it particularly in respect to Event generation.
Building and Special Requirements should be practicaly identical. Name, Scope and Duration values would be used, but more options are avalible under Scope. You can specify "Site" under scope to refere to the potential building site itself. So to require building A to be present for Building B to be built you use.
<Pre_Build Building="A" Scope="Site" Duration="Now" />
To specify that requirments to be in the same system use "System", for adjacent systems use "Hops#2" to specify 2 starlane Hops. Self, Any, All and Empire wildcards work just as they do for Tech Requirments and reference whole empires.
Meter values are also simple to do with a Min and Max
<Pre_Meter Meter="Construction" Min="10" Max="Unbound" Duration="Now" />
Events could also be used for Pre_Requisites, Events might not always include a location though so "Galactic" would be the scope to refer to these.
<Pre_Event Event="Super_Nova" Scope="Galactic" Duration="Ever" />
Notice the "Ever" Duration it should prove quite usefull for creating senarios, "silent" events can be created to control many parts of the game behind the scene.