News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Illogical flows of rivers

Started by makie, June 26, 2020, 07:27:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

makie

Illogical flows of rivers.
A new thread for rivers according to    https://forum.simutrans.com/index.php/topic,20086.msg188824/topicseen.html#msg188824

The river changes on a watershed between two valleys, like on a bridge, from one plateau to another. Then it seeps away in a small lake on the plateau, while the valleys are completely dry. All other lakes are also strangely on plateaus.

[de]Der Fluss wechselt auf eine Wasserscheide zwischen zwei Tälern, wie auf einer Brücke, von einer Hochebene zur anderen. Dann versickert er in einem kleinen See auf der Hochebene, während die Täler komplett trocken sind. Auch alle anderen Seen liegen seltsam auf Hochflächen.

Quote from: Freahk on June 25, 2020, 07:01:56 AMIt would be awesome if these started on hills, then searching a way without upward slopes until they meet another river, map borders or a large larke/the ocean.
Quote from: prissi on June 25, 2020, 07:29:25 AMThe rivers more or less work like that ...
Quote from: freddyhayward on June 25, 2020, 08:38:49 AM
The problem on extended was that lakes acted as a black hole for rivers, so most rivers (except for a few coastal streams) never actually reached the ocean until lakes became disabled by default. Even a giant river system could end at a 1-tile lake. Does this still happen on standard? I remember reading this thread about using additional passes to create lake outflows: https://forum.simutrans.com/index.php/topic,13114.msg130518.html#msg130518

Quote from: makie on June 25, 2020, 11:28:01 AM
[google]In real life, water flows down a hill until it reaches a barrier. There it builds up and forms a lake. The level of the lake rises until the water exceeds the hurdle, then it flows further down the river to the sea. Lakes are formed by rivers and are created in hollows or depressions that are filled with water. If the dam is breached at the end of the lake, the lake runs empty. Lakes are created when water runs into a deepening.

[de]In echt fließt Wasser einen Hügel hinab bis es eine Barriere erreicht.  Dort staut es sich und bildet einen See. Der Pegel des Sees steigt bis das Wasser die Hürde übersteigt, dann fließt es als Fluss weiter talwärts bis zum Meer. Seen werden also von Flüssen gebildet und entstehen in Mulden oder Senken die mit Wasser aufgefüllt werden. Wird der Damm am Ende des Sees durchbrochen, dann läuft der See leer. Seen entstehen also dadurch, dass Wasser in eine Vertiefung läuft.

Quote from: makie on June 25, 2020, 01:24:53 PM
If terrain lead the river to the card edge, then the river exit the map there.
Water follows always the steep way down. If the valley leave the map, the river do also.


Dwachs

#2
It seems that the pathfinding for rivers penalizes going downhill. Huh. Cannot do any tests, as I am in a video conference right now :D

Edit: these weights do not have any impact, as source and target of rivers are predetermined.
Parsley, sage, rosemary, and maggikraut.

TurfIt


Vladki

Quote from: TurfIt on June 26, 2020, 12:01:26 PMMore old ideas: Patch: The Rainfall River Generator
That's the one I was looking for.

Andyh

I notice from another thread that someone is creating an in-game scripting function.  Perhaps it would be possible to write a script that generates a single river based on a specified starting tile.  Functionality would be something like this:

* User selects a tile... typically this would be at or close to the top of a mountain.
* User runs script
* Single river is generated that runs downhill from the point of origination. 
* Rules of the script would be something like:
     * At any given tile the river will choose the downhill route
     * If only flat routes are available river chooses a direction at random
     * If a choice of downhill routes is available, river chooses the steepest (i.e. prefers full-slope to half-slope) or at random if there is a choice of equally attractive routes
* Script ends when any of these conditions are fulfilled:
     * River reaches the edge of the map
     * River reaches the sea or a lake
     * River reaches another river
     * River cannot find a viable route (i.e. no downhill or flat routes are available)
* The size of the river would increase with length (e.g. first 10 tiles small stream, next 10 tiles medium stream... etc.)

This method would not solve the 'black hole lake' issue referred to above, but if a river runs into such a black hole it could easily be re-started on an adjacent tile (perhaps with a bit of judicious terraforming first)

This method probably isn't perfect, but would give the user a good deal of control and it would be possible to very quickly add a large number of rivers to any map.  And the number of rivers could easily be tailored to the type of region being modelled: e.g. fewer rivers in arid areas, more rivers in wetter areas.

isidoro

Two more ideas to complete the algorithm:

       
  • One can consider farther tiles if in a plateau (4x4), (5x5), etc.
  • Kind of speed of water:  if on a plateau, a uniform random direction isn't chosen but forward direction (downstream) is preferred.  It can be absolute, or it can be weighed.
Example of case 2): If last tile of the river was on the right, then, in a plateau, going left is preferred over turning up or down.

prissi

#7
As some measure to alleviate the rivers in Simutrans, now all rivers always end at the sea (in r9390). Also they will become navigatable after merging or after exiting a lake. (Best seen in pak128.Britain)