ruffle-rs / ruffle

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

Evoland (Windows version / Adobe AIR) #13436

Open Firlaev-Hans opened 1 year ago

Firlaev-Hans commented 1 year ago

Describe the bug

For more information on the game itself see #13426. This is about the Windows version which requires some Adobe AIR features. In Ruffle, currently the game boots up to the main menu but doesn't show any menu text, instead throws an error:

2023-10-05T15:06:53.761773Z ERROR ruffle_core::tag_utils: Error running definition tag: DefineBitsJpeg2, got Couldn't register bitmap: Invalid PNG
2023-10-05T15:07:07.298784Z ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x564ccffd5b90 }) to handler FunctionObject(FunctionObject { ptr: 0x564ccd348040 }) : TypeError: Error #1010: A term is undefined and has no properties. (accessing field: %]'h)

The second error is repeated infinitely. Also just like the with Linux version there's sound but no music.

In Lightspark without AIR support enabled actually gets a bit further, the main menu works but as soon as you try to start a game it throws an error because it uses Adobe AIR's nativeProcess to call GetAch.exe, which presumably has to do with Steam achievments. Lightspark actually supports AIR when given the --air command line argument, with that the game mostly works there. Lightspark only stubs nativeProcess and the game works without that exe.

Expected behavior

Ruffle should at least show the main menu correctly and with music, just like Lightspark even without AIR support. Ideally Ruffle would implement or stub nativeProcess and the game should work normally

Affected platform

Desktop app

Operating system

Fedora Linux 38 / KDE Plasma Wayland

Browser

No response

Additional information

No response

Lord-McSweeney commented 12 months ago

Here's some more verbose logging output:

2023-10-07T01:05:30.144567Z ERROR ruffle_core::tag_utils: Error running definition tag: DefineBitsJpeg2, got Couldn't register bitmap: Invalid PNG
2023-10-07T01:05:30.510729Z  WARN ruffle_core::display_object::movie_clip: Symbol class _res.[-*B cannot be assigned to invalid character id 54
2023-10-07T01:05:30.533739Z  WARN ruffle_core::stub: Encountered stub: AVM2 flash.system.Capabilities.language getter
2023-10-07T01:05:30.562867Z  WARN ruffle_core::stub: Encountered stub: AVM2 XML.namespace()
2023-10-07T01:05:30.562901Z  WARN ruffle_core::stub: Encountered stub: AVM2 Namespace.prefix getter
2023-10-07T01:05:30.692338Z  WARN ruffle_core::stub: Encountered stub: AVM2 flash.utils.Dictionary constructor with weak keys
2023-10-07T01:05:30.843200Z  WARN ruffle_core::stub: Encountered stub: AVM2 flash.display3D.Context3D.driverInfo getter
2023-10-07T01:05:30.881489Z  WARN ruffle_core::stub: Encountered stub: AVM2 flash.system.Capabilities.os getter
2023-10-07T01:05:38.144637Z  WARN ruffle_core::stub: Encountered stub: AVM2 flash.text.Font.enumerateFonts()
2023-10-07T01:05:46.417236Z ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x562da3e0b330 }) to handler FunctionObject(FunctionObject { ptr: 0x562da43d2240 }) : TypeError: Error #1010: A term is undefined and has no properties. (accessing field: %]'h)
    at YL::WN//9XQD()
    at xM;$/R1uz()
2023-10-07T01:05:46.432651Z ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x562da3a5cc00 }) to handler FunctionObject(FunctionObject { ptr: 0x562da43d2240 }) : TypeError: Error #1010: A term is undefined and has no properties. (accessing field: %]'h)
    at YL::WN//9XQD()
    at xM;$/R1uz()
2023-10-07T01:05:46.448909Z ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x562da3972b40 }) to handler FunctionObject(FunctionObject { ptr: 0x562da43d2240 }) : TypeError: Error #1010: A term is undefined and has no properties. (accessing field: %]'h)
    at YL::WN//9XQD()
    at xM;$/R1uz()

(last error repeated forever)

Lord-McSweeney commented 12 months ago

Note that _res.[-*B is actually _res.[-*B\x03. It seems to display fine in JPEXS- maybe Ruffle is getting confused between JPEGs and PNGs in DefineBitsJpeg2?I tried a bunch of different image viewers, and they can all display this PNG. The png crate seems to be returning this error: Corrupt deflate stream. InsufficientInput. I'm not sure why.

EDIT: I ran the PNG through https://www.nayuki.io/page/png-file-chunk-inspector, and it seems that the iCCP chunk contains corrupt deflate data. I guess png should silently ignore that data, but it totally aborts the decoding.

Patching away the invalid character id error by registering an empty bitmap when the PNG fails to decode doesn't fix the second error.

Unfortunately the code is obfuscated, so I couldn't figure out what was going on with that last repeated error.

Firlaev-Hans commented 11 months ago

You can start a new game now but there are still issues: ruffleBrokenText ruffleTextureFiltering

Font rendering looks somewhat broken and as soon as you unlock color graphics, textures are filtered / blurred when they should be pixelated, and have black borders around them in some cases. Lightspark had a similar issue initially.

Also as soon as you try to load a savegame or do anything that would grant you an achievement you get an error about nativeProcess not being supported and the game locks up. As mentioned before that is an AIR feature but merely stubbing it would suffice for this game.

Music is also absent like in the Linux version, presumably due to a lack of MessageChannel support. The DefineBitsJpeg2 error is also still printed to the log.

Lord-McSweeney commented 9 months ago

On my end the rendering issue with blurred textures was fixed by #14164 - @Firlaev-Hans can you confirm?

Firlaev-Hans commented 9 months ago

Yup, the blurry textures are gone now.

Lord-McSweeney commented 2 months ago

This should have been entirely fixed by #17117, @Firlaev-Hans can you check?

Firlaev-Hans commented 2 months ago

This should have been entirely fixed by #17117, @Firlaev-Hans can you check?

Font rendering is still broken but as far as I can tell all the save points etc. work now with AIR enabled. I'll try to do a full play through soon and report back whether or not there are any more issues.

(And music is still missing, but there is already a separate issue for that: #14493)

Firlaev-Hans commented 2 months ago

So the game is definitely fully playable with no game-breaking issues. Besides the lack of music and broken fonts, these are the only issues I encountered: