ChrisNeedham24 / microcosm

A little 4X game written using Pyxel.
GNU General Public License v3.0
11 stars 8 forks source link

Deploy overlay bug #142

Closed ChrisNeedham24 closed 11 months ago

ChrisNeedham24 commented 1 year ago

This bug renders the game unplayable if it occurs, and it can happen fairly easily.

Steps to reproduce:

  1. Ensure that you have a settlement with a unit garrisoned.
  2. Select the settlement.
  3. Press the D key - you should see the standard deploy overlay appear.
  4. Now, press the D key again - the settlement overlay should now be displayed, but quads surrounding the settlement will still be highlighting as they are when you are deploying a unit.
  5. At this point, clicking no longer has any real effect. You could technically play the rest of the game by only selecting blessings and improvements but that's not exactly ideal. To progress the bug, click the only place you can: within one of the highlighted deploy quads.
  6. The unit should have been deployed, but the deploy overlay will now be incorrectly displayed. Now the reverse has occurred - the keyboard no longer works at all, but you can move the unit around. However, once the unit has exhausted its stamina, the player can no longer take any action at all.

The bug is due to the event handling of the D key in game_input_handler.py. Ideally, players would be able to press the D key again when deploying a unit to cease the deployment. However, if this is too hard to achieve, it is probably fine to just not allow players to cease deployments at all.