ruffle-rs / ruffle

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

[Run 2] Errors in main menu preventing entering level select #9744

Open LukeSaward1 opened 1 year ago

LukeSaward1 commented 1 year ago

Describe the bug

Runner and Skater are unclickable, I get the following errors every frame on the main menu:

​ ERROR core/src/avm2/events.rs:419 Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x12b2b78 }) to handler FunctionObject(FunctionObject { ptr: 0x2cc8a38 }) : AvmError(Object(ErrorObject(ErrorObject { class: TypeError, ptr: 0x12b34c0 })))
​ ERROR core/src/avm2/activation.rs:940 AVM2 error: Object(ErrorObject(ErrorObject { class: TypeError, ptr: 0x29f5ef8 }))
​ ERROR core/src/avm2/activation.rs:942 TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: ::isComplete)

Expected behavior

The game should work correctly, allowing you to enter the level select menu.

Affected platform

Online demo

Operating system

Windows 11

Browser

Brave Version 1.48.171 Chromium: 110.0.5481.177 (Official Build) (64-bit)

Additional information

SWF link: https://archive.org/download/adobeflash-run2/Run%202.swf Alternative link: https://sites.google.com/site/baroneflash/run-2/run2.swf

Also tested using the extension with the same results.

Player Info

Allows script access: false Renderer: wgpu Adapter Backend: Gl Adapter Name: "ANGLE (Intel, Intel(R) Iris(R) Xe Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)" Adapter Device Type: IntegratedGpu Adapter Driver Name: "" Adapter Driver Info: "" Enabled features: PUSH_CONSTANTS | TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES Available features: TEXTURE_COMPRESSION_BC | CLEAR_TEXTURE | MULTIVIEW Current limits: Limits { max_texture_dimension_1d: 16384, max_texture_dimension_2d: 16384, max_texture_dimension_3d: 2048, max_texture_array_layers: 256, max_bind_groups: 4, max_bindings_per_bind_group: 640, max_dynamic_uniform_buffers_per_pipeline_layout: 8, max_dynamic_storage_buffers_per_pipeline_layout: 0, max_sampled_textures_per_shader_stage: 16, max_samplers_per_shader_stage: 16, max_storage_buffers_per_shader_stage: 0, max_storage_textures_per_shader_stage: 0, max_uniform_buffers_per_shader_stage: 11, max_uniform_buffer_binding_size: 16384, max_storage_buffer_binding_size: 0, max_vertex_buffers: 8, max_buffer_size: 268435456, max_vertex_attributes: 16, max_vertex_buffer_array_stride: 255, min_uniform_buffer_offset_alignment: 256, min_storage_buffer_offset_alignment: 256, max_inter_stage_shader_components: 60, max_compute_workgroup_storage_size: 0, max_compute_invocations_per_workgroup: 0, max_compute_workgroup_size_x: 0, max_compute_workgroup_size_y: 0, max_compute_workgroup_size_z: 0, max_compute_workgroups_per_dimension: 0, max_push_constant_size: 96 } Surface quality: high Surface samples: 4 Surface size: Extent3d { width: 1920, height: 866, depth_or_array_layers: 1 }

Page Info

Page URL: https://ruffle.rs/demo/

Browser Info

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Platform: Win32 Has touch support: false

Ruffle Info

Version: 0.1.0 Name: nightly 2023-02-26 Channel: nightly Built: 2023-02-26T00:19:55.247Z Commit: f9fc4b3179d0b9befd02d9b21ccc9c1e844f2fb8 Is extension: false

Metadata

width: 550 height: 400 frameRate: 40 numFrames: 5 swfVersion: 10 backgroundColor: #000003 isActionScript3: true uncompressedLength: 1451789

Lord-McSweeney commented 1 year ago

This is specifically with an obfuscated version of the game, available on Kongregate.

LukeSaward1 commented 1 year ago

Other versions, specifically the version on the Run 2 speedrun.com page, doesn't allow you to click any buttons in the main menu. [The kongregate version allows you to click Controls, Edit and Credits].

n0samu commented 1 year ago

The SWFs on speedrun.com seem to be working fine now. (If you have broken save data from an old version of Ruffle, you might need to delete it though.)

The obfuscated Kongregate version gets in-game now, but shortly after starting the level it freezes and spams this error:

ERROR run_frame:run_all_phases_avm2: ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x21e06d7c450 }) to handler FunctionObject(FunctionObject { ptr: 0x21e0775eff0 }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: ----__---_-)
        at run2.level::Level/--__--__()
        at run2.level::Level/-___-_______()
        at --___-::---___---__/--_--___--_()
        at --___-::---___---__/--___---__()
LukeSaward1 commented 1 year ago

The obfuscated Kongregate version gets in-game now, but shortly after starting the level it freezes and spams this error

Seems the official version from player03's website also doesn't work (level 3 and onward dont work), with this error:

ERROR core/src/avm2/events.rs:424 Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x233c510 }) to handler FunctionObject(FunctionObject { ptr: 0x2c69f00 }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: display)

Debug log is attached and the SWF is here: https://player03.com/run/2/Run%202.swf

run2_player03_ruffle_log.txt

n0samu commented 1 year ago

The error message you pasted sounds like it is from an unobfuscated version of the game, but the SWF link you provided is to an obfuscated SWF, and I'm seeing the same error I mentioned previously, at the same time.

LukeSaward1 commented 1 year ago

Upon opening the SWF in JPEXS, it appears every Run 2 SWF, including the ones on speedrun.com, are obfuscated (unless there's one I haven't yet come across). I also recall player03 saying he used Haxe for it.

n0samu commented 1 year ago

There's an old unobfuscated version on Newgrounds: https://www.newgrounds.com/portal/view/567991/format/flash?emulate=flash