Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
355 stars 55 forks source link

Game not responding after surrender in campaign mode #381

Closed psa-jforestier closed 1 year ago

psa-jforestier commented 3 years ago

Describe the bug After surrender a mission in ToD Campaign and starting the mission again, the game is not respondig (no menu, no action on unit).

To Reproduce A fresh install of the Portable version of Wargus, master build 3.1.3 I cleaned all Wargus data folder (rm -rf c:\users\xxx\documents\Stratagus) Anti Virus deactivated, Administrator right.

Expected behavior Game respondig to event

Screenshots and Logs Last lines of stdout.txt are

C:\projects\stratagus\src\sound\sound_server.cpp:370: PlayMusic: play music music/Human Battle 1.ogg
C:\projects\stratagus\src\sound\sound_server.cpp:278: PlaySample: play sample 128
C:\projects\stratagus\src\sound\sound_server.cpp:278: PlaySample: play sample 128
C:\projects\stratagus\src\sound\sound_server.cpp:370: PlayMusic: play music music/Human Battle 5.ogg

Last lines of stderr are :

GameCycle: 0d, seed: d501c4a0, Sync rand: 52343
backtrace returned 5 addresses
4:  0x0
3:  0x0
2:  0x0
1:  0x0
0:  0x0
GameCycle: 0d, init seed: 87654321
backtrace returned 4 addresses
3:  0x0
2:  0x0
1:  0x0
0:  0x0

Desktop (please complete the following information):

dmitry-bikbaev commented 3 years ago

I have reproduced that. I confirm the problem but I have one note. At my case, right after Surrender, and then Continue, new game begins ok , but then if you try to call up ANY menu for example, clicking on Menu button or by pressing F10 or F1, then after closing of menu the game begins to not respond to user input, its like game paused while wargus window isnt active and you using another app window. The difference in that you can press F10 and Esc(Return to Game) but in our case F10 isnt working. In addition, I see this "not responding" problem not only if call up any menu while gaming after Surrender, but also if switch to another app window and back to Wargus window. So this problem have to do with pausing stratagus game engine at certain circumstances such resuming after Surrender. My environment: OS: Win 7 32b / Version 3.1.3 (portable) - installed by self installer to desktop / source data from setup_warcraft_ii_2.02v4(28734).exe (Detected BNE CD, extraction full complete).

psa-jforestier commented 3 years ago

Hello. Your comment makes me do some other tests. It seems to be related to the first window game option appearing just after surrender and restarting a game. I try to explain :

Quit the game, restart a new game but this time uncheck the "Show tips at startup" on the Tips window

It looks like a hidden game window is holding the focus or something like that.

dmitry-bikbaev commented 3 years ago

I saw that, while I experimenting with/wo option "Show tips at startup" and at first sight this was a key fact , but further I saw the same problem while switching to another app and back to Wargus window. If unite this two facts , I think the problem must be in Pause Game procedure , isnt matter for what - this is appearing Tips/Menu or leaving Wargus window. Something in this procedure goes different if it is after Surrender. Some variable was not initialised while starting new game?

psa-jforestier commented 3 years ago

I notice, when this bug occurs, there is the indication "Game paused" in the status bar. I try to un-pause it (CTRL+P, or PAUSE key) but the keys are not working and the game can't be un-paused. I dont know where to start with this bug : I look at the Lua code, and the C++ "pause game" code, but no clear bug poped at my eyes.

timfel commented 3 years ago

Yeah, I've noticed this bug too, but haven't found the time to chase it down. My intuition would be to start with printf or step-wise debugging from the SDL event poll and then go from there.

timfel commented 1 year ago

Fixed