minetest / minetest_game

Minetest Game - A lightweight and well-maintained base for modding [https://github.com/minetest/minetest/]
http://minetest.net/
Other
1.42k stars 572 forks source link

DISCUSSION: Better under water behavior #2516

Closed lhofhansl closed 4 years ago

lhofhansl commented 4 years ago

See some of the discussion on #2513 .

Some topic/options discussed there:

I like increasing the fogginess generally under water. We made similar changes for clouds (but those are client only). The depth dependent fog might be hard to do unless we can go by something simple like day-night ratio.

Calinou commented 4 years ago

Increasing the fog density underwater is probably the way to go. It could also be done in lava, in which fog would become even more dense.

lhofhansl commented 4 years ago

Do you think this should be fixed distance (like in clouds) or a distance factor? I.e. should it take the current view range into account or be always the same?

paramat commented 4 years ago

This is partly engine work, but is fine to discuss here. Note this has to be generalised for all liquids and is not about water only.

I think the issue of seeing through lots of liquid when looking from above the liquid is not a problem and can already be mostly solved by increasing the surface texture alpha, as we plan to do for water. It would also be difficult and complex to implement, not worth it in my opinion. Surface alpha is good enough a solution.

So that leaves visibility when the player is in a liquid, and i have an initial suggestion that is simple and has multiple uses: Add a field to node definition that specifies a maximum view range when the client camera is in that node, this view range limit is applied to the existing view range fog. This will work simlar to how view range is reduced when inside a cloud. This would have uses for airlike nodes too, for example a fog node. I'm thinking a fixed maximum view range instead of a factor, otherwise the player would be able to increase their view range to see any distance.

Particles: I think this is overkill and unbalanced detail when we don't even have weather particles in MTG yet. Particles are intensive so must be used with restraint, so their usage must be prioritised, weather is a far higher priority as that absolutely requires particles, water is fine without them.

Calinou commented 4 years ago

@lhofhansl This should be a fixed distance, capped by the viewing_range client setting. For instance, if the liquid fog distance is set to 50 but the user is using a viewing range of 40, it would effectively be 40.

We also might want to make them always draw, even if the user has fog disabled or uses the full view range mode to make cheating more difficult.

lhofhansl commented 4 years ago

Cool. I think this is not too hard to do. I'll file a engine PR and a PR here once I have something. That's actually cool, we could have swamp water, etc.

Hard to find the right distance, though. I usually play with view_range of 240. Default is 100, on Android it's 50. So what should the water default fog distance be?

I think there should be fog distance and perhaps fog color (although it'd have to work both day and night).

Extex101 commented 4 years ago

Maybe have it customizable per node

node_fog = {
    distance = 50,
    visible_outside_node = true,
    colour = {r=140, g=170, b=120}
}

But if the default fog is lower than the nodes fog the nodes fog will get cutoff

paramat commented 4 years ago

Defined per node is essential yes, see my post above. 'visible outside node' will be difficult, complex and not worth it in my opinion due to surface opacity being good enough. Definable fog colour would be good but possibly tricky, possibly not essential.

We also might want to make them always draw, even if the user has fog disabled or uses the full view range mode to make cheating more difficult.

I agree.

Wuzzy2 commented 4 years ago

I like the underwater fog idea, would be useful for other games as well. If added as a node setting, this should be completely optional, however, so games still have full creative freedom.

I agree with paramat to use a fixed value instead of a factor.

For the fog color, I'd just use the same as the post_processing_color. Anything else wouldn't make much sense IMO.

An0n3m0us commented 4 years ago

How about some underwater sound effects like muffling and a slight hum? I modified one of the water sounds in the default mod to create an underwater effect: https://my.pcloud.com/publink/show?code=XZRvQSkZjVQ7taVVnjSJEjpWg15YL79pLaDy

HybridDog commented 4 years ago

How about some underwater sound effects like muffling and a slight hum?

I would like to have a FIR or IIR filter applied to the sound output when the player's ears are underwater.

An0n3m0us commented 4 years ago

Yeah, a FIR or IIR filter would be better than modifiying the audio using an external application. I used a low pass filter on the original audio track, then I created a Brownian noise track and used a low pass filter on that track too. Then I merged the tracks into mono and deepened it a little by boosting the bass.

paramat commented 4 years ago

Closing due to #2710