ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.68k stars 814 forks source link

VVVVVV Demo: Distorted cubish graphical bug #9074

Closed waspennator closed 1 year ago

waspennator commented 1 year ago

Describe the bug

https://www.newgrounds.com/portal/view/524398?emulate=flash When running this through ruffle on newgrounds and on desktop, the game doesn't seem to render correctly. I can see some of the sprites as blocks getting more solid for a bit before sometimes seeing a bit of what sprite was supposed to be there, then it goes black and slowly gets more solid again on repeat. It is possible to get in game, but ruffle just seems to freeze up entirely once the intro cutscene is over.

The game also seems to spam over 256 reports of this error in the console before not logging anymore.

"performance warning: READ-usage buffer was read back without waiting on a fence. This caused a graphics pipeline stall."

VVVVVV Ruffle 1

VVVVVV Ruffle 2

Expected behavior

The graphics should actually render and not be randomly solidifying cubes. The game also shouldn't freeze as soon as you get control over your character. VVVVVV Flash 1

VVVVVV Flash 2

Affected platform

Browser's extension

Operating system

Windows 11

Browser

Edge 108

Additional information

No response

Lord-McSweeney commented 1 year ago

This also needs BitmapData.lock. Maybe that's causing the issue?

n0samu commented 1 year ago

On NG, on the game's loading screen I get the same performance warnings followed by this error: A script in this movie has taken too long to execute and has been terminated. The screen goes black and nothing more happens after that (as expected in this situation).

On desktop, the game is "playable" besides the graphical issues mentioned (which seem to be caused by BitmapData.lock being unimplemented, as Lord-McSweeney pointed out). I do get freezes after the cutscenes, but if I wait for long enough the game continues. Besides that, there are two additional major issues:

  1. For some reason, the game acts like the player is holding down the right arrow key all the time, so the player character never stands still. Holding the left arrow to move left does work, and so does flipping gravity.
  2. Some enemies do not hurt the player because BitmapData.hitTest is unimplemented: ERROR run_frame:run_all_phases_avm2: ruffle_core::avm2::activation: ReferenceError: Error #1069: Property hitTest not found on flash.display.BitmapData and there is no default value.
n0samu commented 1 year ago

Regarding point (1), the problem only seems to occur if I press the right arrow key while the game is frozen after a cutscene. I wonder if this is a game bug that is being exposed by Ruffle's slowness.

n0samu commented 1 year ago

With #10158, all of the problems are fixed except for the freezing after each cutscene (and the related issue with the right arrow key).

waspennator commented 1 year ago

Can confirm, game should become playable if the freezing issue after each cutscene was fixed, was able to successfully play through a level by waiting out the freezes and keeping my hands off the keys when it happens so I don't get stuck moving right.

VVVVVV Ruffle 4

waspennator commented 1 year ago

The lag spikes at the end of the cutscenes seem to be gone now as of the latest nightly on web and desktop, closing as the game seems to be fully playable now.