Place contigous rivers

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Place contigous rivers

Post by fonso »

The patch changes the "place river" function in the dock gui to recursively fill all adjacent land of lower or equal elevation with water. Don't do this at home. It is great to fill a specially carved out valley without clicking a million times, though.

Of course this is a most horrific single-purpose hack. It was done to get a river into the "river valley" heightmap.
Attachments
rivers.diff
(1.84 KiB) Downloaded 68 times
The guy on the picture is not me, it's Alonso.
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: Place contigous rivers

Post by Eddi »

maybe you can generalize this:
  1. placing a "river" calculates the nearest water tile, and places river tiles in a straight [or according to pathfinder] line to connect to that place.
  2. placing a "lake" fills all connected same-height area with river tiles
... people will demand an "undo" function a lot, though :p
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Place contigous rivers

Post by fonso »

I don't think you need that stuff if you're not trying to build a 4000 tile long meandering river.
The guy on the picture is not me, it's Alonso.
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: Place contigous rivers

Post by Eddi »

why would it matter whether it's 40 or 4000 tiles?
User avatar
Simons Mith
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 14 Jan 2010 23:45

Re: Place contigous rivers

Post by Simons Mith »

Can I suggest a river tool less likely to need an undo feature?

Drag a rectangle. The river goes from the first corner of the rectangle to the second, wiggling
randomly as it goes. But it won't leave the rectangle, and it won't go uphill. Possibly if it hits
_any_ slope it stops, as that would allow the designer to decide how it should flow when it meets
a slope.

You could even do diagonal rivers with a ctrl-drag.

If you want a straight river, a rectangle one unit wide will suffice.

If you provided a river width setting, the existing river tool could absorb this new functionality
reasonably easily. The main change would be that dragging an area would produce a river instead
of a lake to a river, and if you wanted a lake you'd have to adjust the width, or drag several times.


I think implementing things this way could add the feature in a way that wouldn't need an undo
facility quite so badly.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Place contigous rivers

Post by fonso »

With 40 tiles you can just draw a 40x10 box with the river tool and then bulldoze the 5 tiles that don't fit.

An auto-wiggling river tool would be nice but wouldn't have solved my problem - that is filling the whole valley with water.
The guy on the picture is not me, it's Alonso.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 21 guests