[MC-4533] Water graphical glitch when connecting diagonally Created: 13/Dec/12 Updated: 02/Nov/22 Resolved: 26/Jan/22 |
|
| Status: | Resolved |
| Project: | Minecraft: Java Edition |
| Component/s: | None |
| Affects Version/s: | Minecraft 1.4.5, Snapshot 12w49a, Snapshot 12w50a, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w01b, Snapshot 13w09b, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.2, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 1.7.4, Minecraft 14w02c, Minecraft 14w03b, Minecraft 14w04a, Minecraft 14w04b, Minecraft 14w05a, Minecraft 14w05b, Minecraft 14w11b, Minecraft 14w18b, Minecraft 14w19a, Minecraft 15w39c, 1.16.5, 21w10a, 21w11a, 21w13a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17, 1.17.1, 21w37a, 21w42a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 5, 1.18.1 |
| Fix Version/s: | 22w05a |
| Type: | Bug | ||
| Reporter: | Connor Steppie | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 28 |
| Labels: | fluid-geometry | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHK: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Confirmation Status: | Confirmed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Category: |
Rendering
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mojang Priority: | Low | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
When water is placed diagonally from other water blocks like it does in the screenshots below, it causes a graphical glitch. You must connect the second source at the farthest point of the first. Let the first stretch all the way out. Code analysisCode analysis by bugi74 can be found in this comment. |
| Comments |
| Comment by MMK21 [ 10/Dec/21 ] |
|
Affects 1.18.1 |
| Comment by Nguyễn Nhật Nam [ 07/Dec/21 ] |
|
I got a similar issue to this bug with a quarter-waterlogged big dripleaf. Version: 1.18.1-pre1 The glitch persists after server restart and client restart.
|
| Comment by [Mod] ampolive [ 09/Nov/21 ] |
|
Can confirm in 21w44a. |
| Comment by Nonof Youbuis [ 26/Oct/21 ] |
|
can confirm in 1.17.1 and added another example: Oh and it doesn't look at all like never fixing these old issues didn't create any new problems later on.... (<- be aware of the sarcasm! And I'm not sure if the amount of negations is right in there) |
| Comment by [Mod] ampolive [ 20/Oct/21 ] |
|
Can confirm in 21w42a. |
| Comment by [Mod] ampolive [ 16/Sep/21 ] |
|
Can confirm in 21w37a. |
| Comment by [Mod] ampolive [ 29/Jul/21 ] |
|
Also affects lava. |
| Comment by MMK21 [ 12/Jun/21 ] |
|
Affects 1.17 |
| Comment by user-aa418 (Inactive) [ 15/May/21 ] |
|
Can confirm in 21w19a. |
| Comment by Numeritos [ 18/Mar/21 ] |
|
Affects 21w11a ( |
| Comment by Connor Steppie [ 03/Mar/21 ] |
|
As the original reporter has not been active since 2015 and I own several similar tickets, can I request ownership of this? |
| Comment by D [ 12/May/18 ] |
|
No I don't think this is a normal way water should be working. |
| Comment by Marcono1234 [ 20/Dec/16 ] |
|
Is this only intended for water being diagonally or also an air block, as shown in some of the screenshots and described in |
| Comment by Markku [ 29/Oct/15 ] |
|
A bit "rant"ish, a small bit of info for marcono in there: Well, from our ordinary users point of view, considering the amount of information given from devs (i.e. none), there was no point to close this issue/report in the first place, at least not as WAI. Possibly as "Won't fix", depending on the background (which we do not know of). But as far as I know, there hasn't been any mentions (other than the dev's resolution) that such weird behavior was really the way it was meant and designed to work. It just does not make sense (at least not to me, without proper explanation). So, welcome to the normal users world; they end up commenting in closed issues as long as things stay like this Marcono1234: It took a bit of time to fix, but it wasn't really that difficult; the most of the time usually goes into just finding where the relevant functionality is in the code, since all I had was just the decompiled and partially deobfuscated code to crawl through. I don't remember exactly how long it took, but judging from my old comments, likely about two hours total. I did these source code fixes initially, but after years went and tens of bugs which I had even provided somewhat ready fixes for stayed untouched, I gave up. (And since it is now big business, there is no motivation to help with free work, either, like I would for a small indie studio. With a tiny fraction of the money that has been moved around, they could hire enough temporary devs to fix all the bugs in less than few months. At least the ones that won't require major rewrites to the whole framework But as redstonehelper says, once it is closed, it typically stays so, unless someone gets to ping the devs through other channels; at least I tend to unregister any notifications from issues already closed (in a satisfactory way) (both as a user here, and a dev myself elsewhere), otherwise it causes too much "noise". Mod's can only reopen cases that are plain simply obvious; if it had already been confirmed as a bug, claimed fixed, and the symptoms are back. But for this issue, devs have claimed it is not a bug, so mods would get a slap on their fingers if they reopened it just like that. So, now only 12 watchers and mods will notice anything on this issue. And even I am probably going to stop watching some day, half my emails are coming from this JIRA (and I'm not even following that many issues), and less than 1% is the good kind (basically "fixed"). |
| Comment by [Mod] redstonehelper [ 28/Oct/15 ] |
|
There is no point in keeping closed reports up to date. |
| Comment by Marcono1234 [ 28/Oct/15 ] |
|
WAI is WAI but probably it took bugi74 anyways some or a lot of work to create this fix and I did not say you have to reopen the report |
| Comment by [Mod] redstonehelper [ 28/Oct/15 ] |
|
Nope, WAI is WAI. |
| Comment by Marcono1234 [ 28/Oct/15 ] |
| Comment by Nick Hayes [ 30/Sep/15 ] |
|
Confirmed for 15w39c. |
| Comment by Markku [ 29/Jul/14 ] |
|
"Working as intended"? Really? Those silly corners were really designed to be so? I seriously don't think so... Was my proposed fix somehow lacking or having side-effects (or did any dev actually read through the comments to notice the fix in the first place)? Or is this another case that should actually gotten resolved as "Won't fix" (for whatever mysterious reason)? |
| Comment by Itouch2 [ 13/May/14 ] |
|
Confirmed for 14w19a. |
| Comment by CharlesC [ 03/Feb/14 ] |
|
Still there in 14w05b. I find it less noticeable but I might be mistaken. I can attach new screenshot if needed. |
| Comment by [Mod] Ezekiel (ezfe) [ 03/Feb/14 ] |
|
Is this still a concern in the latest Minecraft version 14w05b? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. |
| Comment by Markku [ 30/Sep/13 ] |
|
Affects 1.6.4. |
| Comment by Simons Mith [ 28/Sep/13 ] |
|
Still seeing this in 1.6.2-3ish, maybe 1.6.4, I can't remember quite when I updated to 1.6.4. And there's actually a minor exploit you can sometimes do with it; if there's a hidden cave diagonally connected to the one you're in, you might be able to find the 'thin corner'. |
| Comment by Anon Imos [ 21/May/13 ] |
|
Yeah I noticed that when you place a block diagonal to a water source block the edge of the water seems to rise up slightly. |
| Comment by CharlesC [ 27/Feb/13 ] |
|
Edited with "another_example" names |
| Comment by Markku [ 27/Feb/13 ] |
|
Could you edit that comment to list the names of the screenshot files. Otherwise it is somewhat difficult to tell which screenshot is which. (EDIT: just realized, applies to my screenshot, too |
| Comment by CharlesC [ 27/Feb/13 ] |
|
Hi another example with multiple screenshots, happens in 13w09b too |
| Comment by Markku [ 03/Feb/13 ] |
|
Sample screenshot with the fixed code. 'fixed-water-corners.png' |
| Comment by Markku [ 03/Feb/13 ] |
|
Current code RenderBlocks public boolean renderBlockFluids(Block block, int x, int y, int z) { ... double var24 = (double) this.getFluidHeight(x, y, z, var22); double var26 = (double) this.getFluidHeight(x, y, z + 1, var22); double var28 = (double) this.getFluidHeight(x + 1, y, z + 1, var22); double var30 = (double) this.getFluidHeight(x + 1, y, z, var22); ... } private float getFluidHeight(int x, int y, int z, Material fluidType) Better code RenderBlocks public boolean renderBlockFluids(Block block, int x, int y, int z) { ... double var24 = (double) this.getFluidHeight(x, z, x, y, z, var22); double var26 = (double) this.getFluidHeight(x, z, x, y, z + 1, var22); double var28 = (double) this.getFluidHeight(x, z, x + 1, y, z + 1, var22); double var30 = (double) this.getFluidHeight(x, z, x + 1, y, z, var22); ... } private float getFluidHeight(int blockx, int bloxkz, int x, int y, int z, Material fluidType) { int var5 = 0; float var6 = 0.0F; for (int direction = 0; direction < 4; ++direction) { int checkX = x - (direction & 1); int checkZ = z - (direction >> 1 & 1); if (this.blockAccess.getBlockMaterial(checkX, y + 1, checkZ) == fluidType) { // These are checks that there is actually a suitable path for the fluid from that block to this block so that its level can affect. if (checkX == blockx && checkZ == blockz) // Directly above return 1.0F; if (checkX != blockx && checkZ != blockz) { // Diagonal in every way // Does not affect directly at all. } else { // Diagonal in one main direction // If there is same fluid above this block, then 1.0 if (this.blockAccess.getBlockMaterial(blockx, y + 1, blockz) == fluidType) return 1.0F; // If there is same fluid under that block, then 1.0 if (this.blockAccess.getBlockMaterial(checkX, y, checkZ) == fluidType) return 1.0F; } } Material checkedMaterial = this.blockAccess.getBlockMaterial(checkX, y, checkZ); if (checkedMaterial == fluidType) { // The diagonal neighbor block must have a path of same fluid to this block, or skip its effect: if (checkX != blockx && checkZ != blockz && (this.blockAccess.getBlockMaterial(checkX, y, blockz) != fluidType && this.blockAccess.getBlockMaterial(blockx, y, checkZ) != fluidType)) { continue; } else { int checkedMeta = this.blockAccess.getBlockMetadata(checkX, y, checkZ); if (checkedMeta >= 8 || checkedMeta == 0) { var6 += BlockFluid.getFluidHeightPercent(checkedMeta) * 10.0F; var5 += 10; } var6 += BlockFluid.getFluidHeightPercent(checkedMeta); ++var5; } } else if (!checkedMaterial.isSolid()) { // Non-solid makes the level lower // If it is in diagonal neighbor, then there must be non-solid path, or skip its effect: if (checkX != blockx && checkZ != blockz && (this.blockAccess.getBlockMaterial(checkX, y, blockz).isSolid() && this.blockAccess.getBlockMaterial(blockx, y, checkZ).isSolid())) continue; ++var6; ++var5; } } return 1.0F - var6 / (float) var5; } I will attach a screenshot showing the results (for the changed rendering; there are other cases of rendering, which I managed to mess up temporarily while working on the fix, but since they haven't changed with the version above, I won't include screenshots of those.) |
| Comment by Markku [ 03/Feb/13 ] |
|
The code calculates the corner water levels based on the existence and levels of water in 8 blocks around each corner/edge. However, it is quite naive and does not make any checks whether the neighbor blocks provide a path for the water to actually affect the block being rendered. There are a number of cases (block patterns) to check, but it seems doable. This has been "bugging" me, too, so... Working on a fix, lets see what I can come up with. |
| Comment by Anon Ymus [ 03/Feb/13 ] |
|
In addition, removing a block diagonally makes the water dip in that corner. |
| Comment by Markku [ 03/Feb/13 ] |
|
Not really intended, but one more case of "it works well enough and doesn't completely break things, so leave it as is for now". It has been around a long time, and iirc, has even been (ab)used for benefits, but that does not make it less of a bug. |
| Comment by FireHunterX [ 03/Feb/13 ] |
|
I think that this may ne intended, but I am not entirely sure. |