The International Simutrans Forum

 

Author Topic: [BUG]: Rivers are cut short due to coastal erosion logic  (Read 222 times)

0 Members and 1 Guest are viewing this topic.

Offline freddyhayward au

  • *
  • Posts: 95
  • Languages: EN
[BUG]: Rivers are cut short due to coastal erosion logic
« 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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19078
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG]: Rivers are cut short due to coastal erosion logic
« Reply #1 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?

Offline freddyhayward au

  • *
  • Posts: 95
  • Languages: EN
Re: [BUG]: Rivers are cut short due to coastal erosion logic
« Reply #2 on: December 25, 2019, 04:25:03 AM »
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19078
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG]: Rivers are cut short due to coastal erosion logic
« Reply #3 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!