We have used this modcomp in Dune Wars. It is not doing quite what we expected, or perhaps, we are trying to do things it was not designed for.
1. We would like *some* improvements but not all, to be buildable on peak. For example, a windmill should be buildable on grass or peak, while a solar farm should be buildable on grass and *not* buildable on peak. We define windmill with TerrainMakesValid=TERRAIN_GRASS and bPeakMakesValid=1. We define solar farm with TerrainMakesValid=TERRAIN_GRASS and bPeakMakesValid=0. But, both are still buildable on some peaks. This is because the ...MakesValid conditions are OR'd. So if there is grass terrain at peak altitude, the game allows building the solar farm. We also need separate control over peaks and hills, so we cannot use the RequiresFlatlands flag; solar farms should be buildable on hill but not peak.
Is there a way to prevent improvements from being built on peak, regardless of the underlying terrain type?
2. We would like *most* units to move through peaks, but not all. For example, tanks should not be allowed to move through peaks. We have used TerrainImpassable on the unit, but it is ignored. I suspect this is because peak is an altitude, not a terrain type. For example, in vanilla xml, units have a TerrainAttacks field but also a HillsAttack field. This implies we need a separate check of terrain type and terrain altitude.
Is there a way to prevent some units from moving through peaks?
EDIT: I have looked into the sdk functions and I think there is no way to do either of these, without more addition. I will try:
CvPlot::canHaveImprovement will check a new improvement xml tag, bPeakMakesInvalid
CvUnit::canMoveInto will check a new unit xml tag, bPeakImpassable