Skip to content
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

Game not responding after surrender in campaign mode #381

Closed
psa-jforestier opened this issue Jul 29, 2021 · 6 comments
Closed

Game not responding after surrender in campaign mode #381

psa-jforestier opened this issue Jul 29, 2021 · 6 comments

Comments

@psa-jforestier
Copy link
Contributor

psa-jforestier commented Jul 29, 2021

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.

  • Download Wargus-portable-3.1.3.exe

  • 7-unzip it on the desktop

  • start wargus.exe

  • Select GOG_setup_warcraft_ii_2.02_v4_(french)_(28734)
    Run inno extract (extract all content of the installer)
    Extraction continue ("Detected BNE CD")
    No extract for DOS expansion CD
    Crash at the end of extraction, but it doesnt matter

  • Launch Stratagus.exe -p -a

  • Single Player Campaign > Campaign

  • In Tides of Darkness, select Alliance, 1 st mission (Hillsbrad), then Start Mission

  • When the mission is started, do nothing and click on Menu > End Scenario > Surrender

  • Restart the mission after the resumee screen

  • Unable to click anywhere : UI stalled . F10 not working, keyboard not respondig too. Only the mouse is moving.

  • The red lines at the top of the screen is still moving, indicating there is internal activity.

  • Window can be resized or moved, and screen is refreshing

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):

  • OS: Win 7 32b
  • Version 3.1.3 (portable)
  • Tested with 3.1.1 and 3.1.2 : same prb
@dmitry-bikbaev
Copy link

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.02_v4_(28734).exe (Detected BNE CD, extraction full complete).

@psa-jforestier
Copy link
Contributor Author

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 :

  • Edit file wc2/preferences.lua and set option ShowTips to true
  • Start v3.1.3, in Single Player Game > Campaign Game > Tides of Darkness : Alliance > Hillsbrad > Start Mission
  • On the briefing window, click on Continue, and the game start.
  • You can see the "Tips" window. Leave "Show tips at startup" checked. Click on Close to close the tips window
  • Play the game
  • Surrender
  • When the game restart, the Tips window is displayed, you can click on Close to close it.
  • ⚠️ Now the game is frozen. You cant select unit, or click on any menu.

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

  • When the game start, Surrender yourself
  • After the Surrender screens, the game restart. No Tip is displayed.
  • You can select units, move them, attack
  • Click on Menu or F10, the Game Menu is displayed and return to the game
  • ⚠️ Now the game is frozen

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

@dmitry-bikbaev
Copy link

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
Copy link
Contributor Author

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
Copy link
Member

timfel commented Aug 26, 2021

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
Copy link
Member

timfel commented Dec 27, 2022

Fixed

@timfel timfel closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants