New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VH1 heroine hangs when you go through the East Gate #1132

Closed
johnflux opened this Issue Mar 25, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@johnflux

johnflux commented Mar 25, 2017

Name of the game:

VH1: VH_170318_translated.7z

Download: https://mega.nz/#F!dssjSJ4R!EAwCogg9ZEkJvowDIg319A
Password: nanako

Player platform:

Linux, Kubuntu 16.10

Attach files (as a .zip archive or link them)

easyrpg_log.txt

save.zip

Describe the issue in detail and how to reproduce it:

Load the saved game, then travel left a few squares. What should happen is that you pass through the gate.

What happens instead is that it soft locks up.

@fdelapena fdelapena added the Hang label Mar 25, 2017

@johnflux

This comment has been minimized.

Show comment
Hide comment
@johnflux

johnflux Mar 25, 2017

gdb only says:

#3  0x000055555564b558 in SdlUi::ProcessActiveEvent (this=0x5555559ec4e0, evnt=...) at src/sdl_ui.cpp:713
#0  0x00007ffff5d9471d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff72b7b45 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#2  0x00007ffff72324df in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#3  0x000055555564b558 in SdlUi::ProcessActiveEvent (this=0x5555559ec4e0, evnt=...) at src/sdl_ui.cpp:713
#4  0x000055555564c2ab in SdlUi::ProcessEvents (this=0x5555559ec4e0) at src/sdl_ui.cpp:568
#5  0x0000555555574c9c in Player::Update (update_scene=update_scene@entry=true) at src/player.cpp:325
#6  0x00005555555820a2 in Scene::MainFunction (this=0x55555c4ea4b0) at src/scene.cpp:100
#7  0x0000555555573200 in Player::MainLoop () at src/player.cpp:264
#8  0x0000555555575675 in Player::Run () at src/player.cpp:259
#9  0x000055555556c79e in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:28

johnflux commented Mar 25, 2017

gdb only says:

#3  0x000055555564b558 in SdlUi::ProcessActiveEvent (this=0x5555559ec4e0, evnt=...) at src/sdl_ui.cpp:713
#0  0x00007ffff5d9471d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff72b7b45 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#2  0x00007ffff72324df in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#3  0x000055555564b558 in SdlUi::ProcessActiveEvent (this=0x5555559ec4e0, evnt=...) at src/sdl_ui.cpp:713
#4  0x000055555564c2ab in SdlUi::ProcessEvents (this=0x5555559ec4e0) at src/sdl_ui.cpp:568
#5  0x0000555555574c9c in Player::Update (update_scene=update_scene@entry=true) at src/player.cpp:325
#6  0x00005555555820a2 in Scene::MainFunction (this=0x55555c4ea4b0) at src/scene.cpp:100
#7  0x0000555555573200 in Player::MainLoop () at src/player.cpp:264
#8  0x0000555555575675 in Player::Run () at src/player.cpp:259
#9  0x000055555556c79e in main (argc=<optimized out>, argv=<optimized out>) at src/main.cpp:28

@johnflux

This comment has been minimized.

Show comment
Hide comment
@johnflux

johnflux Mar 26, 2017

This is against the latest git version, as of 2017/3/26 (version ed0e643 )

johnflux commented Mar 26, 2017

This is against the latest git version, as of 2017/3/26 (version ed0e643 )

@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns

carstene1ns Mar 26, 2017

Member

Hi, thanks for the bug report. Unfortunately the gdb trace is useless here.
Instead #786 would be useful, unfortunately is not implemented yet.
Problem with more verbose logging is that there would be too many useless messages flooding the terminal/logfile, but we are working on that.

Well, with the savegame, rpg maker 2000 and the debugger we will likely be able to identy what causes the softlock.

Member

carstene1ns commented Mar 26, 2017

Hi, thanks for the bug report. Unfortunately the gdb trace is useless here.
Instead #786 would be useful, unfortunately is not implemented yet.
Problem with more verbose logging is that there would be too many useless messages flooding the terminal/logfile, but we are working on that.

Well, with the savegame, rpg maker 2000 and the debugger we will likely be able to identy what causes the softlock.

@scurest

This comment has been minimized.

Show comment
Hide comment
@scurest

scurest Mar 26, 2017

Contributor

Relevant events are ID: 160 (at (49,49), in the fountain) and ID: 102 (at (73,55), graphic is 移, page 7).

Basically E160 is a parallel event that checks if the player is in a certain location and writes a number representing the location to a variable, then turns itself off by turning off a switch. E102 is an auto-start event enabled by the variable that waits 0.1 s, does some stuff (essentially nothing for passing through the dirt path) and then turns itself off and E160 back on.

In RPG_RT, it looks like

frame 1 = event 160 runs, sets the variable, >>player moves on this frame<<
frame 2 = event 102 runs, waits 0.1s (6 frames)
frame 8 = event 102 finishes running
frame 9 = event 160 runs again

but in Player the events run on the same frame

frame 1 = event 160 runs, sets the variable, then event 102 runs, waits 0.1s
frame 7 = event 102 finishes
frame 8 = repeat frame 1

So the player never gets a chance to move? Somehow event 102 needs to start the next frame and not the same frame.

(Btw, if you delete the condition IsAnyEventStarting() from here you can keep playing.)

Contributor

scurest commented Mar 26, 2017

Relevant events are ID: 160 (at (49,49), in the fountain) and ID: 102 (at (73,55), graphic is 移, page 7).

Basically E160 is a parallel event that checks if the player is in a certain location and writes a number representing the location to a variable, then turns itself off by turning off a switch. E102 is an auto-start event enabled by the variable that waits 0.1 s, does some stuff (essentially nothing for passing through the dirt path) and then turns itself off and E160 back on.

In RPG_RT, it looks like

frame 1 = event 160 runs, sets the variable, >>player moves on this frame<<
frame 2 = event 102 runs, waits 0.1s (6 frames)
frame 8 = event 102 finishes running
frame 9 = event 160 runs again

but in Player the events run on the same frame

frame 1 = event 160 runs, sets the variable, then event 102 runs, waits 0.1s
frame 7 = event 102 finishes
frame 8 = repeat frame 1

So the player never gets a chance to move? Somehow event 102 needs to start the next frame and not the same frame.

(Btw, if you delete the condition IsAnyEventStarting() from here you can keep playing.)

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Mar 26, 2017

Member

Based on @scurest observation I made a small test in the event tracer (parallel process that toggles a switch to enable autorun and does a wait), here is the output:

Frame 1 can be ignored, that's just switch-toggling to enable the PP.

For Parallel process with ID1 and Autorun ID2:

#    ID    Page  Line
# Frame: 1
E	1	1	0
# Frame: 2
E	1	2	0
# ev1
E	1	2	1
E	1	2	2
E	2	1	0
# ev2
E	2	1	1

For parallel process with ID3 and autorun with ID2:

# Frame: 1
E	3	1	0
# Frame: 2
E	3	2	0
# ev1
E	3	2	1
E	3	2	2
# Frame: 3
E	2	1	0
# ev2
E	2	1	1

Result: The ID matters, only higher IDs will run this frame.

Member

Ghabry commented Mar 26, 2017

Based on @scurest observation I made a small test in the event tracer (parallel process that toggles a switch to enable autorun and does a wait), here is the output:

Frame 1 can be ignored, that's just switch-toggling to enable the PP.

For Parallel process with ID1 and Autorun ID2:

#    ID    Page  Line
# Frame: 1
E	1	1	0
# Frame: 2
E	1	2	0
# ev1
E	1	2	1
E	1	2	2
E	2	1	0
# ev2
E	2	1	1

For parallel process with ID3 and autorun with ID2:

# Frame: 1
E	3	1	0
# Frame: 2
E	3	2	0
# ev1
E	3	2	1
E	3	2	2
# Frame: 3
E	2	1	0
# ev2
E	2	1	1

Result: The ID matters, only higher IDs will run this frame.

@Ghabry Ghabry changed the title from VH1 crash when you go through the East Gate to VH1 heroine hangs when you go through the East Gate Mar 28, 2017

@carstene1ns carstene1ns added this to the 0.6.0 milestone Apr 17, 2017

@Ghabry Ghabry modified the milestones: 0.5.3, 0.6.0 Jul 30, 2017

Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Jul 30, 2017

Run autostart events that become runnable this frame only when the ev…
…ent ID of the autostart event is higher than the ID of the event which triggered a refresh.

For events with lower IDs the start is delayed by one frame which replicated the RPG_RT behaviour.

This fixes a hang when going through the east gate in Violated Heroine.

Fix EasyRPG#1132

carstene1ns added a commit that referenced this issue Aug 8, 2017

Merge pull request #1233 from Ghabry/issue-1132
Fix walking through the east gate (#1132) in VH1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment