Captain-Chaos / WorldPainter

WorldPainter is an interactive graphical map generator for the indie game Minecraft.
http://www.worldpainter.net/
GNU General Public License v3.0
354 stars 58 forks source link

Complete river layer #65

Open frogocomics opened 6 years ago

frogocomics commented 6 years ago

As a terraformer, the river layer would be extremely useful for realistic looking rivers. Is it possible that the river layer be completed and usable soon?

Captain-Chaos commented 6 years ago

I agree it would be! The trouble is that once you dive in there are a lot of questions about how it should work. I want it to create good looking rivers as automatically as possible. That entails for example the water level not following every bump in the terrain. But if it shouldn't do that, how should it determine what the water level should be? Ideally, the water should only ever go down from the source, never up, but that would be extremely hard to do. Regardless of the answer it's likely to be complex and difficult to implement. Etc., etc.

However you've triggered me to put some time into this.

Captain-Chaos commented 6 years ago

It would help to hear your thoughts about how it would work. Say I paint a line of River across a landscape of gently undulating hills. What exactly would you expect it to result in?

frogocomics commented 6 years ago

I want it to bull through terrain (follow the shape of the terrain). It would be up to the terraformer to determine best placement. A river should have variable depth, which can be painted. I would be nice to have a maximum depth (ie 7 blocks), and then you can paint it so 100% is the max depth.

Ivainir commented 6 years ago

Now, our best case scenario would be quite a complex thing to achieve, but would remove one of Worldpainter's key weaknesses. I'll try to give you a list of features that we'd consider a 'must' to be worth it, and a list of "wants" that would make it really valuable to us but that arent essential if they prove too difficult.

Also, to answer your question on the hills, I would expect the river to cut into the hills and have its water level either remain level or gently slope downwards. The 'gently sloping downwards' part would have to be controllable by the creator in some way. I was thinking either determine a height difference between the starting point of a drawn line and its ending point, or use layer intensity to scale it. But more on that below.

River device "Must" features (if any of these are implausible or prohibitively difficult, let me know and I'll think of a viable alternative): -Determining the depth, rough shape and steepness of how the river cuts into the terrain. Think of something like you have for ground cover layers, but meant specifically for rivers.

-Determining the materials of the slope and bottom, and perhaps also of the river itself. Think of the way cave layers work, but without the ceiling, and again re-designed specifically for rivers.

-Have the ability to affect how the shape of the surrounding terrain affects the slope of the water. This should at least be scaled between "not at all" and "follow the shape of the terrain almost exactly". The latter would be used for making small mountain stream.

-A way to determine the slope of the water level in the river, so that if cutting from a mountain across a bunch of hills and platforms towards sea level, the water won't be going uphill at any point. As you mentioned, this would be very difficult, but there are a few options (as I mentioned). 1>Allow the player to set an absolute OR relative height difference between the start point and the end point of a line drawn with the layer, then have them click, hold and release when drawing the layer. 2>Use layer intensity. The difficulty would be that layer intensity is on a scale of 100, while MC's height is scaled to 255. It should be possible, but it may be difficult to compensate for the difference. Some sort of lerp between the lower part and higher point of the 2.5 block difference would be possible but it might look weird if it's done in fits and bursts.

All in all, I'd greatly recommend 1 if at all possible.

"Want" features: -importing a heightmap to affect the height of the water (there exists a script for this for WP already, but it would be great to see the two integrated. This script might also be of help for the main creation of the river device). https://www.reddit.com/r/Worldpainter/comments/6tvg1p/water_level_from_height_map/

-The ability to add terrain variation and/or object layers to the bottom of the river specifically, the way it is possible with cave layers

Thats all for now. Others may have more to add, but I daresay this is already hopelessly complex enough. If any part of this is impossible, implausible or simply too much bloody work for any reasonable human being, let me know and I'll see if I can find an alternative. I AM slowly trying to teach myself Java, but I only just got past the "Hello World" part, so I'm a long way from being any sort of use in helping develop this project.

Captain-Chaos commented 6 years ago

Is that all? ;-)

Captain-Chaos commented 6 years ago

Another option I have been thinking of is a tool instead of a layer, which carves out the river and fills it with water permanently in the editor. Or perhaps a combination of the two.

River support has been slowly bubbling away on a back burner for many years, and it is time to get it in some kind of usable shape.

frogocomics commented 6 years ago

A layer would be most desirable, as WorldMachine and other programs can generate river maps.