Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastMath breaks elytra on OptiFine 1.12.2 F5 #3395

Open
surfaceflinger opened this issue Feb 20, 2020 · 4 comments
Open

FastMath breaks elytra on OptiFine 1.12.2 F5 #3395

surfaceflinger opened this issue Feb 20, 2020 · 4 comments

Comments

@surfaceflinger
Copy link

surfaceflinger commented Feb 20, 2020

Looking straight up while flying elytra will kick player for "Invalid move player packet received" or glitch arms + legs of player making them disappear.

How to reproduce: 1. Enable Fastmath in performance settings 2. Look up while flying elytra
May be only happening on macOS because only one player reported this on discord before.

vid: https://www.youtube.com/watch?v=JruqdJO1-vs

@Nessiesson
Copy link

Nessiesson commented Feb 22, 2020

Can confirm it happens on Windows 10 as well. From what I've been able to determine, the bug was introduced in OptiFine_1.12.2_HD_U_F4. Another way to reproduce the bug is to stand next to a block at head height like this and fly straight up. Your X and Z coordinates are somehow set to NaN.

@AMDBartek
Copy link

AMDBartek commented Jun 28, 2020

I can confirm that this happens on 1.12.2 when I am using the “Fast Maths” option on my client.

Edit: happens on Windows, Mac OS and Linux.

Edit 2: also happens while playing on my Minecraft server. (Small edit: this bug seems to effect both singleplayer and multiplayer)

@TheoCGaming
Copy link

TheoCGaming commented Jun 28, 2020

Hmm. I'll test it in singleplayer and let you know if it bugs like shown.

Edit: Using F5 as it is the only version of OF1.12 I have on hand.

EDIT 2: Confirmed for F5 and confirmed in Singleplayer. Will attempt to get F3 screenshots and send them.

EDIT 3: While testing, my game froze, waiting for recovery | Subedit: Closing game due to game saving chunks indefinitely.

Edit 4: Captured screenshot, game froze again. Needed to printscreen
Image:
Bug

@xxDark
Copy link

xxDark commented Oct 12, 2020

                        if (f < 0.0F)
                        {
                            double d9 = d7 * (double)(-MathHelper.sin(f)) * 0.04D;
                            assert !Double.isNaN(vec3d.x * d9 / d5);
                            assert !Double.isNaN(vec3d.z * d9 / d5);
                            this.motionY += d9 * 3.2D;
                            this.motionX -= vec3d.x * d9 / d5;
                            this.motionZ -= vec3d.z * d9 / d5;
                        }

These assertions fail because vec3d.x, d5 are 0.0D.
0.0 * N / 0.0 == NaN
See EntityLivingBase#travel

There is a bug somewhere in this code:

    protected final Vec3d getVectorForRotation(float yaw, float pitch)
    {
        float f = MathHelper.cos(-pitch * 0.017453292F - (float)Math.PI);
        float f1 = MathHelper.sin(-pitch * 0.017453292F - (float)Math.PI);
        float f2 = -MathHelper.cos(-yaw * 0.017453292F);
        float f3 = MathHelper.sin(-yaw * 0.017453292F);
    }

@sp614x May you look into this? Kinda want some fix on that.
We suspect that this issue is caused by rounding. Fast math causes sin/cos calls to return inaccurate values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants