I don't remember the details, but I seem to recall that it has generally worked out that doing too much terraforming causes problems. This is particularly the case with converting land to water, although water to land (and perhaps flattening peaks) might cause a little trouble sometimes. The reason for this is that there is a thing called an area which the game engine uses for a few things. The division of the map into areas is calculated when the map is generated.
If you break an area into parts such that plots in the same area can not be reached by just moving a unit from plot A to plot B due to water having divided the area (or land having divided a water area) it might cause problems with the AI's ability to do some things. I'm not sure, but it may also cause unexpected behavior with those few buildings that give an effect in every city on the same continent. Or something - I don't really remember the details, just that it can cause problems. They may all be minor problems rather than anything that would cause a crash or otherwise break the game, but I'm not sure.
Makes sense. I'm coding the fake-coast-making-improvement so that the AI will (hopefully) never use it. I'm not too concerned as long as I limit
my use of it to the occasional one-off canal-extension
There is also an aesthetic problem. Anybody who's used the Planetbuster knows that the newly-created coast tiles look wrinkly and ugly; sometimes there are even tiny straight black lines. *shrug*
hey guys, this idea is great - can one of you upload it here - the complete code?
Sure. In my mod I've made it possible to transform tundra to plains, desert to plains, plains to grass, and flatlands (grass, plains, desert, or tundra) into coast. My experimentation suggested that units which function like helicopters cannot perform worker actions, even if the relevant AI attributes are set in UnitInfos. (This would have been the only sensible way I could think of to convert coast to land; in my mod, helis can enter coast tiles, though not ocean.)
This is the relevant XML for the fake-improvements themselves:
...and here's the XML that enables the build button for worker units for each of the above fake-improvements (including a couple of non-Firaxis tech prereqs):
...and this is the Python that exploits those fake-improvements in EventManager.py:
Code:
def onImprovementBuilt(self, argsList):
'Improvement Built'
iImprovement, iX, iY = argsList
if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_DESERT_X_PLAINS')):
pPlot = CyMap().plot(iX,iY)
pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_PLAINS" ), True, True)
pPlot.setImprovementType(-1)
elif(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_FLAT_X_COAST')):
pPlot = CyMap().plot(iX,iY)
pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_COAST" ), True, True)
pPlot.setImprovementType(-1)
elif(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_PLAINS_X_GRASS')):
pPlot = CyMap().plot(iX,iY)
pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_GRASS" ), True, True)
pPlot.setImprovementType(-1)
elif(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_TUNDRA_X_PLAINS')):
pPlot = CyMap().plot(iX,iY)
pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_PLAINS" ), True, True)
pPlot.setImprovementType(-1)
if (not self.__LOG_IMPROVEMENT):
return
Of course, the worker units would also have to be given access to the build orders in UnitInfos.xml ...plus there's the XML TXT tags, one of which is significant for the flatland->coast order:
Code:
<TEXT>
<Tag>TXT_KEY_HELP_BUILD_FLAT_X_COAST</Tag>
<English>[COLOR_WARNING_TEXT]Will consume the unit[COLOR_REVERT]</English>
</TEXT>
...though if I were in a silly mood I might phrase that as "Will drown the unit"
Additionally, I can't see why it wouldn't be possible to transform peaks into something more useful, so long as the unit doing the transforming has been given the ability to cross impassable terrain in UnitInfos. I elected not to allow this (nor land ice transforming) for reasons of balance.
I had hoped to add a "Flatten Hill" transform command, but this method seems to require a single terrain type on each end of the transaction, and there doesn't seem to be any such thing as TERRAIN_NOHILL. I don't quite understand how the game handles hills, since they are their own terrain type and yet always coexistent with another.