As it sits there are three types of units; factories, mobiles units, and buildings. To set prereqs right now you need a needlessly complex and thorough knowledge of calls in the cob file strucutre, something few people understand at the moment. It would almost make more sense to create a fourth dimension to units, and that would be to add laboratories, in order to make this more user freindly.
Like factories, the laboratories would need a menu. Instead of having units to build the laboratories should instead offer technologies. A simple build pic of the technology would represent the possible tech to research. Energy and/or metals could be consumed, along with buildtime, in order to complete research. Heck, even a research rate variable using existing buildtime and buildrate variables would keep it simple enough.
The advantage to this setup is that it doesn't require extensive rewrites of existing code, but rather only requires a new laboratory branch in the slow update loop. A single monolithic file, like the sidedata.tdf for unit creation, would be necessary to control the technology trees. So in effect, code used for factories could be recycled for laboratories. The proverbial techdata.tdf so to speak would contain data in a simple format:
Code: Select all
[%LaboratoryName%]
{
Techname1=%TechnologyName7%;
{
Buildtime=1000; //in tradition buildtime units format
Prerequisite1=%TechnologyName1%;
Prerequisite2=%TechnologyName2%;
Prerequisite3=%TechnologyName3%;
}
Techname2=%TechnologyName8%;
{
Buildtime=1000; //in tradition buildtime units format
Prerequisite1=%TechnologyName4%;
Prerequisite2=%TechnologyName5%;
Prerequisite3=%TechnologyName6%;
}
}
Code: Select all
[techtree]
If (%TechnologyName% = TRUE)
{
//Do this
}
The end game would be to eventually allow build menues to also use the technologies in order to set prerequisites for unit production. But because it could be done separate to this the two ideas do not need to happen simultaneously. If someone got ambitious to do the second step then they would already have the avenue open to them to eventually tie tech improvement in with both factory build menues and sidedata.tdf, giving everyone what they've been asking for on the whole 'research' idea.
Just my 2 cent compromise on the topic.