Alpha 5 has a bug that is responsible for almost half of its crashreports:
For reasons, Windows does not allow to change windows pixel format more than once (something about it being more complicated than destroy and recreate the window). These are rules of the game and this is fine. How does it affect Knights Province? Well, changing AA mode required to recreate OpenGL context, which in turn, required to reset the pixel format, which, when performed on the same window, caused an error. Unluckily, due to being non-modal, displaying that error dialog caused the underlying window to repaint itself, which triggered OpenGL context recreation once again (since it was missing) .. And now the code started to repeat itself, causing less-than-informative EInvalidPointer exception, since some things should not be used twice, especially in such manner.
The bug did not reveal itself before, because the only change that required recreation of OpenGL context was toggling the game fullscreen. Fullscreen toggle is special, because it recreates the window behind the scenes, thus always providing new “material” for which new pixel format could be set. AA is another such change added in Alpha 5.
I was able to recreate and fix a crash that was happening on changing AA (anti-aliasing) mode, if that change was made without toggling fullscreen mode. Hopefully that is the crash that was plaguing Alpha 5 for the players that have sent me their crashreports. Thank you guys for sending them in, they helped a lot!
Alpha 6 is around the corner, bugfix will be there. Hopefully without many more new bugs 😉
P.S. For now, workaround for this crash is – when you want to toggle AA, always toggle fullscreen mode alongside.