ruffle-rs / ruffle

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

Cho'gath Eats the World gets black screen after 44% loading #10163

Open tsunamistate opened 1 year ago

tsunamistate commented 1 year ago

Describe the bug

"Cho'gath Eats the World" reaches 44% in loading, then gets the black screen. Menu music is heard playing.

SWF file: https://www.mediafire.com/file/cx66edh8cp6oyc4/CHEW_%2528Full_Game%2529.swf/file (Providing Mediafire link because SWF exceeds GitHub limit of 25 Mb)

Errors from desktop console:

ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::activation: AVM2 error: String("behavior is missing attribute loop")
ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "complete", class: flash.events::Event, ptr: 0x200c5286c50 }) to handler FunctionObject(FunctionObject { ptr: 0x200bb8347f0 }) : AvmError(String("behavior is missing attribute loop"))

Web demo (Firefox 111) also has the following warnings in addition to errors above:

Encountered stub: AVM2 XML.namespace() [ruffle_web-wasm_extensions.js:673:20](webpack://ruffle-demo/core/dist/ruffle_web-wasm_extensions.js)
WARN core\src\stub.rs:126 Encountered stub: AVM2 Namespace.prefix getter [ruffle_web-wasm_extensions.js:673:20](webpack://ruffle-demo/core/dist/ruffle_web-wasm_extensions.js)
WARN core\src\stub.rs:126 Encountered stub: AVM2 flash.system.Security.allowDomain() [ruffle_web-wasm_extensions.js:673:20](webpack://ruffle-demo/core/dist/ruffle_web-wasm_extensions.js)
WARN core\src\stub.rs:126 Encountered stub: AVM2 flash.media.Sound constructor with arguments [ruffle_web-wasm_extensions.js:673:20](webpack://ruffle-demo/core/dist/ruffle_web-wasm_extensions.js)
WARN  mpa: invalid main_data_begin, underflow by 127 bytes log.target = "symphonia_bundle_mp3::layer3";
log.module_path = "symphonia_bundle_mp3::layer3";
log.file = "C:\\Users\\Ghost\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\symphonia-bundle-mp3-0.5.2\\src\\layer3\\mod.rs";
log.line = 86;

Expected behavior

Game is playable after needed APIs are implemented

Affected platform

Desktop app

Operating system

Windows 11

Browser

Firefox 111.0

Additional information

This is a companion issue to Astro Teemo (https://github.com/ruffle-rs/ruffle/issues/2072), Astro Teemo is an unlockable game in Cho'gath Eats the World

tsunamistate commented 1 year ago

On 7c280fc1716a98b400da96e28195bdebaad669d9 ruffle_core::avm2::activation errors are gone, only 1 ruffle_core::avm2::events error appears Black screen after 44% loading still appears

tsunamistate commented 1 year ago

Thanks to https://github.com/ruffle-rs/ruffle/pull/10864 menu works and goes ingame, but no characters appear, playable or not.

2023-04-30_20-18-39

The game prints these messages on the screen: There is no BitmapData asset with an ID of "assets/flash/". Console spams the following error message, changing only the pointer value:

2023-04-30T17:18:07.622100Z ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x2605cbf7e68 }) to handler FunctionObject(FunctionObject { ptr: 0x26056939288 }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: name)
n0samu commented 1 year ago

Same problem as https://github.com/ruffle-rs/ruffle/issues/2072#issuecomment-1529084833 - I guess this is the current issue with Haxe-compiled games

tsunamistate commented 10 months ago

Somewhere around 333009b79fa31bafb16030b6c35ec79b671f8d61 game was fully playable, but after 08d6a7b6480cefb800a9da6363a17a9d5130a588 (https://github.com/ruffle-rs/ruffle/pull/13677) it regressed and started crashing, and from 3572367c8e99fd4361c349cd79e65a6d7c31213c (https://github.com/ruffle-rs/ruffle/pull/13818) until current commit as of moment of writing (f2b02acf444a5fa7a46e1e4f1b40c766e613706d) it is regressed with the following issues:

waspennator commented 5 months ago

Still a problem as of the latest nightly.

tsunamistate commented 2 months ago

As of d0a37b3b6150a0c5abf28962bd5f44558d3a8238 (2024-07-04) SFW just produces black screen with the following error:

ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "complete", class: flash.events::Event, ptr: 0x223918592a0 }) to handler FunctionObject(FunctionObject { ptr: 0x22394888820, name: Ok("ApplicationMain$/preloader_onComplete()") }) : TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at com.eclecticdesignstudio.spritesheet.importers::SpriteLoq$/parse()
        at AssetLoader$/loadDynamicSpriteSheet()
        at ResultScreen()
        at CHEW()
        at CHEW$/main()
        at Function/apply()
        at ApplicationMain$/begin()
        at ApplicationMain$/preloader_onComplete()
        at flash.events::EventDispatcher/flash::events::EventDispatcher::dispatchEvent()
        at NMEPreloader/onLoaded()
        at ApplicationMain$/onEnter()
waspennator commented 2 months ago

As of d0a37b3 (2024-07-04) SFW just produces black screen with the following error:

ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "complete", class: flash.events::Event, ptr: 0x223918592a0 }) to handler FunctionObject(FunctionObject { ptr: 0x22394888820, name: Ok("ApplicationMain$/preloader_onComplete()") }) : TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at com.eclecticdesignstudio.spritesheet.importers::SpriteLoq$/parse()
        at AssetLoader$/loadDynamicSpriteSheet()
        at ResultScreen()
        at CHEW()
        at CHEW$/main()
        at Function/apply()
        at ApplicationMain$/begin()
        at ApplicationMain$/preloader_onComplete()
        at flash.events::EventDispatcher/flash::events::EventDispatcher::dispatchEvent()
        at NMEPreloader/onLoaded()
        at ApplicationMain$/onEnter()

I can also confirm, could you narrow it down to the last version that worked before the black screen issue started?

tsunamistate commented 2 months ago

@waspennator bisected to dc03f541dbf58d1eef8fef11e586ed683d09c44a as first bad commit

Lord-McSweeney commented 1 month ago

Copied from @Aaron1011's comments on discord:

I investigated more - it turns out that this issue is just the swf header 'Frame count = 1' bug we don't advance to the second frame because the header only delclares 1 frame if I edit the header to declare 2 frames, it works