ben-ryder / Conqueror-of-Empires

A turn-based strategy game where up to 4 local players battle to be victorious, by expanding their empires, and controlling units to conquer cities and attack the enemy.
GNU General Public License v3.0
41 stars 9 forks source link

Game can't end unless a human wins [GH-2] #11

Closed ben-ryder closed 3 years ago

ben-ryder commented 4 years ago

Describe the bug If all human players die, the game does not end and the last surviving player must keep clicking through the next turn message as the computer players continue. If a computer player wins, the game will not end but will continue. This is because the check for player death is done in the conquer handling in the view which the computer player doesn't invoke.

To Reproduce All human players must be conquered, and a computer player must then conquer all other players.

Expected behaviour When a computer player wins, the game should end and there should be the appropriate message. When all human players die but computer players remain, this could be handled in multiple ways.

System Information (please complete the following information): n/a (This is a code bug/issue)

Additional context n/a

ben-ryder commented 3 years ago

I've now created a game save which can be used to reproduce this issue. See issue 11 reproduction.zip.

It looks like the exact issue behavior has changed since this issue was first raised:

and the last surviving player must keep clicking through the next turn message as the computer players continue.

This is no longer accurate. What happens now is that the next turn message for the last surviving human stays on the screen and the game freezes. The backend then runs though the rest of the game (computers only) in the background. When the game is over and there is one surviving computer player, the UI updates again and the game over message is displayed.

ben-ryder commented 3 years ago

I'm going to look to fix this by implementing option one where the game will end with a different game over message. This will probably work similar to the current game over message handling, but will instead be triggered when there are no human players left.

ben-ryder commented 3 years ago

This should now be fixed and this issue should no longer block work on GH-2.

COE - Humans Defeated Message