yeah even I don't trust me for naming conventions.
What I'm thinking seems easiest, from a modder's perspective, is allowing production commands to produce randomly from a list of possible units, with the cost held at the producer. something like:
<command>
<type value="produce"/>
<name value="produce_archery_units" />
<image path="images/produce_archers.bmp" />
<unit-requirements />
<upgrade-requirements />
<produce-skill value="produce_skill"/>
<resource-override="true">
<resource name="gold" amount="100" />
<resource name="stone" amount="150" />
<resource name="wood" amount="50" />
<resource-override>
<unit-list="true">
<produced-unit name="fire_dragon_archer"/>
<produced-unit name="archer"/>
<produced-unit name="crossbowman"/>
</unit-list>
</command>
Not a bad idea but it can be simplyfied.
this is a very standard Produce code only with a exstra "produce unit"
<command>
<type value="produce"/>
<name value="produce_marine" />
<image path="../uef_marine/images/uef_marine.bmp" />
<unit-requirements />
<upgrade-requirements />
<produce-skill value="produce_skill"/>
<produced-unit name="uef_marine"/>
<produced-unit name="uef_marine_2"/>
</command>
this seems to produce the most clean result to me. it is a single line additon that makes the produce skill able to make different units.
Then you just have to have a exstra unit in your random rotation.
it also still respects the unit costs. i don't know how this is actually implemented, it should either reserve a amount of money for the most expensive unit and then return the rest of the money when a unit is selected or be able to make the mineral cost go into minus(-).
The inherent problem with this is that a player can just cancel the random and then keep cancel the random production untill he gets the unit he want's however for units that have serveral different textures/animations/models this can be usefull, this essentially makes it possible to have different units of the same race, fx Humans of different heights, And or Beasts/orcs of different kind.
Just be carefull developers, we don't want the produce command to be expensive its pretty much the backbone of the game.
But i so like the idea of this it gives me so many ideas to make a beautifull game.