Thanks for the suggestion. The problem here is that the terraforming degrades when a catchbasin is *destroyed* or also if an improvement on the square is pillaged. So the entire map must be scanned. I will have to study it a little more.
Note quite what I meant; I didn't mean store the location of cities that *currently* have a catchb/reservoir; that wouldn't work because you need to downgrade for cities where the building no longer exists (eg because of change of civic), I meant make a store of the location of cities that have *ever* had a catb/reservoir.
So have some array that is empty at game start, and whenever a catchb/res is built, take the tile location of that city and add it to the array. And tiles are never removed from the array.
[store the tile location rather than the city because the city could get razed and leave terraformed tiles around it]
So all you ever have to do is scan the tiles of the BFC surrounding each member of the array each turn, and check if they are terraformed but do not have an improvement, and if so then downgrade them.
This should work, because it is impossible for a tile to ever have been terraformed if it was not in the BFC of a city that once had a catchb/res. You never need to degrade any tile that *wasn't* in the BFC of a tile listed in the array.
The spice is added later, in the GameStart function. So I don't think poor initial city location can be "blamed" on spice.
Are you sure? I thought that the mapscript chooses the location for the starting settler, not the location for their capital; couldn't the AI move 1 tile in any direction before settling on the first turn? Or do they always settle on their starting tile?
If they always settle on their starting tile then you are correct, but if they begin with their starting units and *then* try to choose an "optimal" city site on the first turn then they can be encouraged by spice to move towards the coast and settle there, rather than inland slightly with more potential for hills.