alemart / opensurge

A retro game engine with a fun platformer for making your dreams come true!
http://opensurge2d.org
GNU General Public License v3.0
385 stars 33 forks source link

Custom Waterworks level hangs on bad startup object #2

Closed codylico closed 5 years ago

codylico commented 5 years ago

Situation

I have my own custom "Waterworks" level file that broke when the Waterworks setup script either moved or changed names (probably the latter).

Expected Behavior

The Open Surge Engine would display an error message (either by dialog box or otherwise), then close and/or continue.

Current Behavior

The Open Surge Engine displays an error message by dialog box, then seems to hang.

System details

Commit: 088db1cf5eda87bea056542c2a40d1c75c94d2f8 CMake configuration: (using ccmake)

BLEEDING_EDGE_VERSION:STRING=sandbox
BLEEDING_EDGE:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Release
LALLEGRO_DIALOG:FILEPATH=/usr/lib/x86_64-linux-gnu/liballegro_dialog.so
LSURGESCRIPT:FILEPATH=(build of latest SurgeScript from master).a
USE_A5:BOOL=ON
USE_OPENAL:BOOL=OFF
USE_STATIC:BOOL=ON
...

OS: Ubuntu 18.04.2 LTS OS-type: 64-bit

Minimal level that breaks:

// ------------------------------------------------------------
// Open Surge Engine 0.5.0-custom-dev level
// http://opensurge2d.org
// ------------------------------------------------------------

// header
name "Waterworks Zone"
version "0.5"
requires "0.5.0"
act 1
theme "themes/waterworks.brk"
bgtheme "themes/sunshine.bg"
spawn_point 128 4968
music "musics/waterworks.ogg"
startup "DefaultStartup" "WaterworksSetup"
players "Surge" "Neon"
waterlevel 5064

// dialogs

// bricks
brick 2 64 5032

I can add more information as needed.

alemart commented 5 years ago

Yes, the name of the startup object has changed. You may simply write:

startup "DefaultStartup" "Waterworks Setup"

in the .lev file to update the reference. If this doesn't work, submit your logfile.txt file located in ~/.cache/opensurge2d/opensurge.

codylico commented 5 years ago

Yes, the name of the startup object has changed.

That makes sense. I am concerned that, when the game noticed the wrong startup script on my level, the game hangs instead of closing down or exiting the level. (It shows the error message, then seems to stop responding to key input.)

alemart commented 5 years ago

Yes, I see what you mean. I have submitted new code that addresses this issue. First, we don't need to crash the program due to a missing startup script; we will simply warn the player and proceed. Second, when there's an actual crash, the engine should be closed, not frozen. See if the new code works for you.

codylico commented 5 years ago

It works. Thank you.