Copied from same thread on GAE board
While I certainly prefer the engine callback, it would be best to have some mechanism so that a scenario could tell the engine what difficulty levels it supports, not all authors will be wanting to support all levels.
Example of my proposal method in proper XML:
<difficulty-selectable value="true"/>
<difficulty value="0"/>
<difficulty value="3"/>
<difficulty value="5"/>
</difficulty-selectable>
(Note from the first post, difficult -> difficulty)This would mean we'd have the 0, 3, and 5 difficulties available (aka: "Very easy", "Hard", and "Insane" in the default english translation). As well, the difficulty-selectable tag would replace the difficulty tag, and if both occur, it will take priority. As well, for displaying the "chooseable" difficulty levels, it would probably display it as GAE currently does, with a table showing information about the scenario, but the difficulty value would have arrows around its value. The default value of the difficulty field would be whichever "difficulty" tag appears first, so if the tag is:
<difficulty-selectable value="true"/>
<difficulty value="3"/>
<difficulty value="0"/>
<difficulty value="5"/>
</difficulty-selectable>
Then the default difficulty will be 3 (Hard), that way if a scenario has support for a far easier than intended difficulty level, a player who doesn't realize they can choose won't end up playing in a way easier than intended; though more-over it's just to give modders an extra element of choice.
This graphical method of using arrows around the value (similar to how maps work) could later be expanded to allow choices for different factions or tilesets (though different factions would be far more complex and would also need some method of checking what faction the player chose; in order to create the correct units, etc).