KOBUGE-Games / minilens

Cute puzzle platformer starring a cleaning robot on post-apocalyptic Earth
http://kobuge-games.github.io/minilens
GNU General Public License v3.0
135 stars 38 forks source link

Menu tweens on page change are broken, options page crashes (Godot regression) #103

Open akien-mga opened 6 years ago

akien-mga commented 6 years ago

Seems like no one noticed/cared so far, but there's a regression in Godot 2.1.4 and later affecting Minilens.

The tween animations on the main menu are broken, as you need to click the buttons twice to actually change page (first click just offsets by ~100 px).

And going to the options page trigger a stack overflow in the tweening code.

The bug happens with Godot 2.1.4-stable (and current 2.1/HEAD) but not 2.1.3-stable. Bisecting...

akien-mga commented 6 years ago

I found the culprit with git bisecŧ: https://github.com/godotengine/godot/commit/0cc1ba947f4420db343d4a2c622df02d83121599 (godotengine/godot#9521)

git bisect start
# good: [d8ae244d51ed157d96346c510baeb637239e3200] Revert "Respect style boxes for Button states other than "normal""
git bisect good d8ae244d51ed157d96346c510baeb637239e3200
# bad: [b61462268e9a8a2c86c1abd5bc65cd96659fa979] Revert "Display the Y angle properly when rotating from gizmo, partially helps #1479"
git bisect bad b61462268e9a8a2c86c1abd5bc65cd96659fa979
# good: [11dc3f8589247dfadae270c35ece737715175697] i18n: Update template and sync translations
git bisect good 11dc3f8589247dfadae270c35ece737715175697
# bad: [e87b6d4c63b0c46b160dd04f3495024fbfc61caa] Merge pull request #9978 from ISylvox/update-gradle-android-for-2.1
git bisect bad e87b6d4c63b0c46b160dd04f3495024fbfc61caa
# bad: [48007d8ec60e501522e66c58615e4a1d9de706cc] Merge pull request #9796 from marcelofg55/2.1
git bisect bad 48007d8ec60e501522e66c58615e4a1d9de706cc
# good: [0dcbc375a3d8d883ee456f55921744d45f9e3a13] Merge pull request #9551 from timoschwarzer/2.1-scons-human-friendly-output
git bisect good 0dcbc375a3d8d883ee456f55921744d45f9e3a13
# good: [41b8a28c5f2767f0890b2cdaec29dbf30aa5ebea] Added additional functions to RichTextLabel: * Added set_text function to RichTextLabel * Added percent_visible attributes and functions to RichTextLabel This should make switching from Label to RichTextLabel easier.
git bisect good 41b8a28c5f2767f0890b2cdaec29dbf30aa5ebea
# bad: [408f91024c1babc5b60a8fa283a51c44637e00b6] Merge pull request #9655 from GodotExplorer/pr-fix-9653
git bisect bad 408f91024c1babc5b60a8fa283a51c44637e00b6
# bad: [61ff58403d51bc2c0bcf2462050fc463b8572a0a] Ignore fuzzy translations
git bisect bad 61ff58403d51bc2c0bcf2462050fc463b8572a0a
# bad: [7603d77d1da00ba584305c8ba9bc8d36e55f7038] AStar: add bool has_point(id)
git bisect bad 7603d77d1da00ba584305c8ba9bc8d36e55f7038
# bad: [0cc1ba947f4420db343d4a2c622df02d83121599] removed floor so that global pos works with scale
git bisect bad 0cc1ba947f4420db343d4a2c622df02d83121599
# first bad commit: [0cc1ba947f4420db343d4a2c622df02d83121599] removed floor so that global pos works with scale

I don't know if it should be fixed in Godot now that it has been around for almost a year in 2.1.4-stable - reverting to the 2.1.3 state would mean breaking compat for 2.1.4 games using this new feature. So it might be better to just fix it in Minilens.

bojidar-bg commented 6 years ago

Debugging this, seems like giving fractional coordinates to set_pos changes the size ever so slightly, which in turn causes a resize to trigger.

Flooring/snapping when calling set_pos seems to fix the issue, though it seems a bit hacky. Going to look around for other solutions as well.

LwRed commented 3 years ago

Hello, For those who don't care with Tweens, put this in menu.gd script. This will permit the game to run without crashing.

if time > 0:
    """tween.remove_all()
    if animate:
        tween.interpolate_property(self, "rect/pos", current_coordinates, -target_coordinates, time, Tween.TRANS_EXPO, Tween.EASE_OUT, 0)
        tween.start()
    else:
        set("rect/pos", -target_coordinates)"""
    set("rect/pos", -target_coordinates)
bojidar-bg commented 3 years ago

Note that there is/was/will be another version of Minilens at https://github.com/KOBUGE-Games/minilens2, which was built with Godot 3.