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

MOHAWK: RIVEN: Return to main menu after the credits #1318

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@dafioram
Member

dafioram commented Aug 26, 2018

Like the original, the game now returns to main menu upon the
credits finishing. The game cannot be resumed.

The states have been reset so combos are changed and puzzles are reset.

@dafioram dafioram requested a review from bgK Aug 26, 2018

@dafioram

This comment has been minimized.

Show comment
Hide comment
@dafioram

dafioram Aug 31, 2018

Member

The game seems to work fine, but if you try to watch one of the end games again from the main menu after finishing the game once, it will show the end game video flashing and then it will core dump.

Member

dafioram commented Aug 31, 2018

The game seems to work fine, but if you try to watch one of the end games again from the main menu after finishing the game once, it will show the end game video flashing and then it will core dump.

@dafioram

This comment has been minimized.

Show comment
Hide comment
@dafioram

dafioram Sep 1, 2018

Member

After rebasing there is no video issues, but the end game videos can still segfault when trying to play another game ending after the first.

`Thread 1 "scummvm" received signal SIGSEGV, Segmentation fault.
0x000055555563ec4f in Common::HashMap<unsigned short, Mohawk::MohawkSurface*, Common::Hash, Common::EqualTo >::begin (
this=0x555556483248) at ./common/hashmap.h:258
258 if (_storage[ctr] && _storage[ctr] != HASHMAP_DUMMY_NODE)

(gdb) bt
#0 0x000055555563ec4f in Common::HashMap<unsigned short, Mohawk::MohawkSurface*, Common::Hash, Common::EqualTo >::begin() (this=0x555556483248) at ./common/hashmap.h:258

#1 0x000055555563dc08 in Mohawk::GraphicsManager::clearCache() (this=0x555556483240) at engines/mohawk/graphics.cpp:79

#2 0x00005555555ff004 in Mohawk::MohawkEngine_Riven::changeToCard(unsigned short) (this=0x7ffff4ac7ca0 <main_arena+96>, dest=1)
at engines/mohawk/riven.cpp:605

#3 0x000055555561e203 in Mohawk::RivenStack::runCredits(unsigned short, unsigned int, unsigned int) (this=0x5555565a9ab0, video=11, delay=5000, videoFrameCountOverride=0) at engines/mohawk/riven_stack.cpp:265

Member

dafioram commented Sep 1, 2018

After rebasing there is no video issues, but the end game videos can still segfault when trying to play another game ending after the first.

`Thread 1 "scummvm" received signal SIGSEGV, Segmentation fault.
0x000055555563ec4f in Common::HashMap<unsigned short, Mohawk::MohawkSurface*, Common::Hash, Common::EqualTo >::begin (
this=0x555556483248) at ./common/hashmap.h:258
258 if (_storage[ctr] && _storage[ctr] != HASHMAP_DUMMY_NODE)

(gdb) bt
#0 0x000055555563ec4f in Common::HashMap<unsigned short, Mohawk::MohawkSurface*, Common::Hash, Common::EqualTo >::begin() (this=0x555556483248) at ./common/hashmap.h:258

#1 0x000055555563dc08 in Mohawk::GraphicsManager::clearCache() (this=0x555556483240) at engines/mohawk/graphics.cpp:79

#2 0x00005555555ff004 in Mohawk::MohawkEngine_Riven::changeToCard(unsigned short) (this=0x7ffff4ac7ca0 <main_arena+96>, dest=1)
at engines/mohawk/riven.cpp:605

#3 0x000055555561e203 in Mohawk::RivenStack::runCredits(unsigned short, unsigned int, unsigned int) (this=0x5555565a9ab0, video=11, delay=5000, videoFrameCountOverride=0) at engines/mohawk/riven_stack.cpp:265

@bgK

This comment has been minimized.

Show comment
Hide comment
@bgK

bgK Sep 1, 2018

Member

One needs to be careful when calling _vm->changeToStack, because it destroys the currently active stack objet. That is to say the this pointer is no longer valid after calling it in this context. It's much safer to queue a stack change using the script system so it's executed on the next frame. See what's done in ASpit::xaNewGame. I'm not sure that this is your problem though.

Member

bgK commented Sep 1, 2018

One needs to be careful when calling _vm->changeToStack, because it destroys the currently active stack objet. That is to say the this pointer is no longer valid after calling it in this context. It's much safer to queue a stack change using the script system so it's executed on the next frame. See what's done in ASpit::xaNewGame. I'm not sure that this is your problem though.

@dafioram

This comment has been minimized.

Show comment
Hide comment
@dafioram

dafioram Sep 2, 2018

Member

This is the best version yet, no crashes, but I am seeing at least one issue.

The game doesn't return to the main menu after watching one of the ends, but instead goes to a blank screen, this is for the ending where Ghen kills the player in his office for refusing to enter the book.

Member

dafioram commented Sep 2, 2018

This is the best version yet, no crashes, but I am seeing at least one issue.

The game doesn't return to the main menu after watching one of the ends, but instead goes to a blank screen, this is for the ending where Ghen kills the player in his office for refusing to enter the book.

MOHAWK: RIVEN: Return to main menu after the credits
Like the original the game loop returns to the main menu
after the credits end.

The variable states are reset and the player can start
a new game or load an old one.
@dafioram

This comment has been minimized.

Show comment
Hide comment
@dafioram

dafioram Sep 2, 2018

Member

Alright, I've fixed that game ending. It wasn't running the script to change to the main menu because the script manager was stopped in Ospit::xbookclick. I removed the blocking of the scripts from running.

I tried keeping that in and doing a clearing of the script manager que, but that lead to script running issues in doFrame(), maybe that stopAllScript() can be kept in by changing goToMainMenu menu change script to happen immediately rather than que it up, if that is desired, but that will need to be checked against the other game endings.

I am now able to play though all game endings in the same riven instance.

Member

dafioram commented Sep 2, 2018

Alright, I've fixed that game ending. It wasn't running the script to change to the main menu because the script manager was stopped in Ospit::xbookclick. I removed the blocking of the scripts from running.

I tried keeping that in and doing a clearing of the script manager que, but that lead to script running issues in doFrame(), maybe that stopAllScript() can be kept in by changing goToMainMenu menu change script to happen immediately rather than que it up, if that is desired, but that will need to be checked against the other game endings.

I am now able to play though all game endings in the same riven instance.

@dafioram

This comment has been minimized.

Show comment
Hide comment
@dafioram

dafioram Sep 4, 2018

Member

I loaded a saved game at the good ending, then played through the game again choosing the good ending again and it played fine.

I did encounter Trac#10698, but I think thats not riven specific and most people won't be switching back and forth between windowed/fullscreen.

Member

dafioram commented Sep 4, 2018

I loaded a saved game at the good ending, then played through the game again choosing the good ending again and it played fine.

I did encounter Trac#10698, but I think thats not riven specific and most people won't be switching back and forth between windowed/fullscreen.

@bgK

This comment has been minimized.

Show comment
Hide comment
@bgK

bgK Sep 9, 2018

Member

Thanks! I've merged this manually, simplifying the code a bit.

Member

bgK commented Sep 9, 2018

Thanks! I've merged this manually, simplifying the code a bit.

@bgK bgK closed this Sep 9, 2018

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