Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

Changing tilemap size and undoing it in layout view caused project to crash. #8241

Closed Pigpud closed 2 weeks ago

Pigpud commented 2 weeks ago

Problem description

Project crashed, showing an error message after changing tilemap size in the tilemap editor and undoing the change in the layout view.

Attach a .c3p

Steps to reproduce

  1. Download and unzip "Tilemap Error" folder
  2. Open project and click "The_Whole_Whey" layout

More details

After the project crashed I can no longer open the layout without the error message popping up.

Affected browsers/platforms: Windows Chrome

First affected release: r.407

System details

View details Error report information Type: unhandled exception File: https://editor.construct.net/r407/main.js, line 1084, col 505 Message: Uncaught RangeError: Invalid array length Stack: RangeError: Invalid array length at Array.push () at bp.EWb (https://editor.construct.net/r407/main.js:1084:505) at bp.trb (https://editor.construct.net/r407/main.js:1085:86) at cWb (https://editor.construct.net/r407/plugins/allEditorPlugins.js:48:65) at https://editor.construct.net/r407/plugins/allEditorPlugins.js:357:437 at $v.rp.d9c (https://editor.construct.net/r407/projectResources.js:950:76) at m2b.Instance.Jg (https://editor.construct.net/r407/plugins/allEditorPlugins.js:357:236) at d.Jg (https://editor.construct.net/r407/projectResources.js:894:373) at d.Jg (https://editor.construct.net/r407/projectResources.js:1461:315) at d.Jg (https://editor.construct.net/r407/projectResources.js:1415:3) Construct version: r407 URL: https://editor.construct.net/ Date: Sat Sep 21 2024 14:09:44 GMT-0500 (Central Daylight Time) Uptime: 1037 s Platform information Product: Construct 3 r407 (stable) Browser: Chrome 129.0.6668.58 Browser engine: Chromium Context: browser Operating system: Windows 11 Device type: desktop Device pixel ratio: 1.25 Logical CPU cores: 16 Approx. device memory: 8 GB User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Language setting: en-US WebGL information Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium) Numeric version: 2 Supports NPOT textures: yes Supports GPU profiling: no Supports highp precision: yes Vendor: Google Inc. (AMD) Renderer: ANGLE (AMD, AMD Radeon(TM) Graphics (0x00001638) Direct3D11 vs_5_0 ps_5_0, D3D11) Major performance caveat: no Maximum texture size: 16384 Point size range: 1 to 1024 Extensions: EXT_clip_control, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_conservative_depth, EXT_depth_clamp, EXT_disjoint_timer_query_webgl2, EXT_float_blend, EXT_polygon_offset_clamp, EXT_render_snorm, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_texture_norm16, KHR_parallel_shader_compile, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_sample_variables, OES_shader_multisample_interpolation, OES_texture_float_linear, OVR_multiview2, WEBGL_blend_func_extended, WEBGL_clip_cull_distance, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode, WEBGL_provoking_vertex, WEBGL_stencil_texturing
DiegoScirra commented 2 weeks ago

It's very hard to tell what is happening without a project that reproduces the error, but I have a feeling this is the same as #8240. The indexes of tilemaps are not being recalculated properly when the source image is resized.

In the other issue the indexes end up with an offset that makes the content of the tilemap look strange, but I imagine in some conditions the new indexes might end up being out of bounds, which would definitely cause problems down the line.

The other issue is fixed already and we will be making a patch to r407 since this was a regression from r397.2

DiegoScirra commented 2 weeks ago

r407.2 is out now with the possible fix for this.

Pigpud commented 2 weeks ago

It's still crashing... I just uploaded a simplified project with everything removed except the issue layout. Hope this helps.

DiegoScirra commented 2 weeks ago

It looks like the project was saved after the problem took place. The fix I was talking about is supposed to prevent that from happening in the first place, but wouldn't do anything about an already broken project.

Do you have a project that loads up properly, then doing a few steps triggers the crash?

Pigpud commented 2 weeks ago

I don't, but I did figure a way to remove the issue from the project. I updated to r407.2 and deleted the broken layout from the project, repasted it in from a backup and it seems working fine for now.

DiegoScirra commented 2 weeks ago

I going to have to close this then, as it would just be guess work trying to figure out what happened.