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

Return of Touhou Mother: Random lock-up during battles (needs midi-tick) #744

Closed
scarletp opened this Issue Jan 30, 2016 · 8 comments

Comments

Projects
None yet
5 participants
@scarletp

scarletp commented Jan 30, 2016

The battle randomly locked-up whenever your character executing their regular "attack" command.

The other commands ("item", "PSI", "defend") are fine.

Curiously, the background animation and music still run just fine despite the lock-up.

@fdelapena fdelapena added the Hang label Jan 30, 2016

@Ghabry Ghabry added this to the 0.4.1 milestone Feb 19, 2016

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 19, 2016

It's possible that #770 fixes this. Needs retest then.

@fdelapena

This comment has been minimized.

Contributor

fdelapena commented Feb 19, 2016

Tested, still happens. This game uses a custom battle system, so it seems to be an interpreter bug.

@fdelapena

This comment has been minimized.

Contributor

fdelapena commented Feb 19, 2016

I tried to save with --test-play a custom save near the first battle but it crashes when loading.
It seems like chara is null and tries to access to a non-existing member.
Here is the crashing savegame.
Once fixed this one, it would be easier to reach the battle.

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f2dbb in Game_Map::ShowBattleAnimation (animation_id=135, target_id=0, global=false) at src/game_map.cpp:874
874 src/game_map.cpp: chara.SetFlashTimeLeft(0); // Any flash always ends
(gdb) bt f
#0  0x00000000004f2dbb in Game_Map::ShowBattleAnimation (animation_id=135, target_id=0, global=false) at src/game_map.cpp:874
        anim = @0x2dc6450: {ID = 135, name = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
              _M_p = 0x2e278d8 "Balloon !"}}, animation_name = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
              _M_p = 0x2e27a88 "Battle_Animation_Balloon"}}, unknown_03 = -1, timings = {<std::_Vector_base<RPG::AnimationTiming, std::allocator<RPG::AnimationTiming> >> = {
              _M_impl = {<std::allocator<RPG::AnimationTiming>> = {<__gnu_cxx::new_allocator<RPG::AnimationTiming>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
                _M_end_of_storage = 0x0}}, <No data fields>}, scope = 0, position = 2, frames = {<std::_Vector_base<RPG::AnimationFrame, std::allocator<RPG::AnimationFrame> >> = {
              _M_impl = {<std::allocator<RPG::AnimationFrame>> = {<__gnu_cxx::new_allocator<RPG::AnimationFrame>> = {<No data fields>}, <No data fields>}, _M_start = 0x2e27ab0, _M_finish = 0x2e27d30, 
                _M_end_of_storage = 0x2e27d30}}, <No data fields>}}
        chara = @0x0: <error reading variable>
#1  0x0000000000569cb6 in Game_Interpreter_Map::CommandShowBattleAnimation (this=0x2f0f430, com=...) at src/game_interpreter_map.cpp:1717
        animation_id = 135
        evt_id = 0
        global = false
#2  0x0000000000564f85 in Game_Interpreter_Map::ExecuteCommand (this=0x2f0f430) at src/game_interpreter_map.cpp:328
        com = @0x421b8b0: {code = 11210, indent = 0, string = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
              _M_p = 0x1047218 <std::string::_Rep::_S_empty_rep_storage+24> ""}}, parameters = {<std::_Vector_base<int, std::allocator<int> >> = {
              _M_impl = {<std::allocator<int>> = {<__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>}, _M_start = 0x2b10510, _M_finish = 0x2b10520, 
                _M_end_of_storage = 0x2b10520}}, <No data fields>}}
#3  0x00000000004eb66c in Game_Interpreter::Update (this=0x2f0f430) at src/game_interpreter.cpp:218
No locals.
#4  0x00000000004f25c9 in Game_Map::Update (only_parallel=false) at src/game_map.cpp:727
No locals.
#5  0x00000000004367c1 in Scene_Map::Update (this=0x2f78b70) at src/scene_map.cpp:137
No locals.
#6  0x0000000000418bcc in Player::Update (update_scene=true) at src/player.cpp:262
        framerate_interval = 16,666666666666668
        cur_time = 5105
#7  0x0000000000432010 in Scene::MainFunction (this=0x2f78b70) at src/scene.cpp:98
        init = true
        __PRETTY_FUNCTION__ = "virtual void Scene::MainFunction()"
#8  0x00000000004188af in Player::MainLoop () at src/player.cpp:188
No locals.
#9  0x000000000041880f in Player::Run () at src/player.cpp:183
No locals.
#10 0x000000000040c1b5 in main (argc=2, argv=0x7fffffffdf78) at src/main.cpp:32
No locals.
@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 20, 2016

Fixed the savegame crash Ghabry@f00c3c4

(The savegame was saved incorrectly but this crash can also happen when switching maps)

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 20, 2016

Here is a save after the faulty battle anim:

Save01.zip

@Zegeri

This comment has been minimized.

Member

Zegeri commented Feb 21, 2016

Devs: Once you get in a lock-up, set manually the Switch 12 (Battle Sound Battle) to true. It should unlock the battle. It probably requires the implementation of MIDI ticks in CommandControlVariables.

@Zegeri

This comment has been minimized.

Member

Zegeri commented Feb 21, 2016

With a quick implementation of Audio::BGM_GetTicks, this battle works great.

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 21, 2016

Probably not the most accurate implementation (of a very rarely used feature) but does the job 👍

@Ghabry Ghabry changed the title from Return of Touhou Mother bug: Random lock-up during battles to Return of Touhou Mother: Random lock-up during battles (needs midi-tick) Feb 21, 2016

@Ghabry Ghabry closed this in #807 Mar 8, 2016

Ghabry added a commit that referenced this issue Mar 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment