The International Simutrans Forum

Simutrans Extended => Patches/pull requests for consideration => Simutrans-Extended development => Incorporated patches/merged pull requests => Topic started by: freddyhayward on December 19, 2019, 08:53:08 PM

Title: [BUG]: Rivers are cut short due to coastal erosion logic
Post by: freddyhayward on December 19, 2019, 08:53:08 PM
My patch can be found here: https://github.com/jamespetts/simutrans-extended/pull/122
River generation is effectively broken as it starts from the coast upwards, and tries to lower the terrain causing two issues:
1. undesirable coastal erosion
2. failed attempts to lower terrain 2 tiles above sea-level which aborts the river generation.
My patch circumvents these issues simply by disabling the coastal erosion check during river generation by adding an extra parameter to the terraforming functions. Results can be viewed below.
Title: Re: [BUG]: Rivers are cut short due to coastal erosion logic
Post by: jamespetts on December 24, 2019, 01:46:52 PM
Thank you for this. I am not familiar with the river generation logic, as this remains unchanged from Standard (and I wonder whether this might be considered as a patch for Standard as a result).

There are two separate issues here: the coastal erosion and the failures to generate rivers at certain points owing to the inability to lower tiles. I do not think the coastal erosion is undesirable: it effectively creates tidal parts of rivers from narrow strips of sea tiles, which is entirely realistic and desirable. (Ideally, the terrain generator would go even further than this and create wider estuaries and even river deltas, but that is a whole other thing to explore in the future). However, the failure to generate rivers at all in some cases owing to the check failures does need addressing. I wonder whether there is a way to fix this latter issue without removing the propensity to create tidal estuaries?
Title: Re: [BUG]: Rivers are cut short due to coastal erosion logic
Post by: freddyhayward on December 25, 2019, 04:25:03 AM
Quote from: jamespetts on December 24, 2019, 01:46:52 PM
I wonder whether there is a way to fix this latter issue without removing the propensity to create tidal estuaries?
There is, and thankfully much simpler than the original patch. I have created a new pull request that does this simply by passing the keep_water parameter. While there are clearly still issues with river generation, this should at least allow for functioning rivers in the meantime.
Title: Re: [BUG]: Rivers are cut short due to coastal erosion logic
Post by: jamespetts on December 25, 2019, 02:13:50 PM
Excellent, thank you very much. This seems to work well, so I have incorporated it. Merry Christmas!