davewx7 / citadel

A turn based strategy game based on the Anura engine
Other
97 stars 25 forks source link

Inspect possible heisenbug. #205

Open ghost opened 6 years ago

ghost commented 6 years ago
  1. Run the game enforcing 16:9 (with --width and --height if necessary). Access the choose deck panel. Everything is showing fine. Close the game.

  2. Run the game enforcing 16:10 (with --width and --height if necessary). Access the choose deck panel. Everything is showing fine. Close the game.

  3. Run the game enforcing 15:10 (with --width and --height if necessary). Access the choose deck panel. Everything is showing fine. Close the game.

Replace _x with 125, and _y with 160, here: https://github.com/davewx7/citadel/blob/b67f966a85dd722681509d9b30ee9cf75c075e48/data/objects/choose_deck_controller.cfg#L228-L229

Comment all these lines: https://github.com/davewx7/citadel/blob/b67f966a85dd722681509d9b30ee9cf75c075e48/data/objects/choose_deck_controller.cfg#L245-L253

Rerun tests 1. to 3.; x and y are having the same effective values than before, but at the choose deck panel, something weird is happening and the deck portraits are more spaced than before.

What is happening?

ghost commented 6 years ago

Reproducible consistently just by replacing _x with 125 and _y with 160, here: https://github.com/davewx7/citadel/blob/b67f966a85dd722681509d9b30ee9cf75c075e48/data/objects/choose_deck_controller.cfg#L228-L229

It's not necessary to comment these lines to reproduce: https://github.com/davewx7/citadel/blob/b67f966a85dd722681509d9b30ee9cf75c075e48/data/objects/choose_deck_controller.cfg#L245-L253

ghost commented 6 years ago

Adding dump(2) logging at lib.citadel.py(1) and through the unroll of lines 228 and 229 of data/objects/choose_deck_controller in b67f966a85 hints (results of expressions are not reproducible without enforcing a 700x700 window):

Maybe related to these evidences:

At the login pane:

--> level.dimensions
[0, 0, 700, 700]
--> lib.citadel.py(160)
124
-->

At the main lobby:

--> level.dimensions
[0, 0, 700, 393]
--> lib.citadel.py(160)
70
-->

Maybe related to issue https://github.com/davewx7/citadel/issues/179.

ghost commented 6 years ago

At the login pane:

--> level.dimensions
[0, 0, 700, 700]
--> lib.citadel.py(160)
124
--> _

At the main lobby:

--> level.dimensions
[0, 0, 700, 393]
--> lib.citadel.py(160)
70
--> _

I forgot to mention the most important quirk about this, that is: Getting back to the login pane, level.dimensions is valued [0, 0, 700, 700] again, meanwhile lib.citadel.py(160) is not changing their value (like if it's cached?) so in this example it is still valued 70.