flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.19k stars 899 forks source link

`MoveEffect` with noise does nothing on some platforms #3193

Open spydon opened 3 months ago

spydon commented 3 months ago

What happened?

On some platforms the "Shake effect" does not have any effect (or very little effect).

What do you expect?

That is should work deterministically on all platforms.

How can we reproduce this?

The "Shake effect" is added to the camera by doing this:

        camera.viewfinder.add(
          MoveEffect.by(
            Vector2(5, 5),
            NoiseEffectController(
              duration: 0.2,
              noise: PerlinNoise(frequency: 400),
            ),
          ),
        );      

You can also just run this example, where you can see that it doesn't work in Firefox, but it works in chrome: https://examples.flame-engine.org/#/Collision_Detection_Raycasting_Max_Distance

What steps should take to fix this?

No response

Do have an example of where the bug occurs?

No response

Relevant log output

No response

Execute in a terminal and put output into the code block below

Output of: flutter doctor -v

Affected platforms

Web

Other information

It's a bit unclear which platforms are being affected, some have been reported here: https://stackoverflow.com/questions/78551176/flutter-flame-camera-shake-effect-not-working

Are you interested in working on a PR for this?

spydon commented 3 months ago

@luanpotter did you have a chance to take a look at this?

luanpotter commented 3 months ago

No, I didn't. Is it because of fast_noise? If so I can try to investigate later this week.

spydon commented 3 months ago

No, I didn't. Is it because of fast_noise? If so I can try to investigate later this week.

I have absolutely no idea why, but it might be fast_noise. I'll assign you to the issue. :)