Today has been one of those strange days that just leave you scratching your head!
I’ve had two hard crashes today while working on Chaos Groove. Both times neither Alt-tabbing, pressing ‘Control, Alt, & Delete’, or physically pressing the power button on my machine worked. I’ve had to manually unplug the PC and then replug in just to escape from the frozen game. The strange thing is I think that the error is not just due to my mistake, but due to the MSDN debugger. The second error when I reran in a windowed mode (to try to be able to get back to the OS), showed a simple undefined variable being added to, while not being used in an array or anything else like that. This time the debugger caught it, whereas just one minute earlier in fullscreen it hard crashed the PC when running in Debug mode.
About halfway through the day today I got a very strange thing happen with my particle effects. They were being drawn at the wrong angles after a creature attack effect, and even the spell beam effect was wrong. I couldn’t understand it and tried tracking it down, but it seemed that PTK’s blit was at fault because I hadn’t changed anything to do with the code in the particle side of the game, yet suddenly it was using the angle values passed to the blits very wrongly indeed. Despite double-checking the actual values passed (which were correct and hadn’t changed), the angle values were being treated as twice as large as they were. I.e. if I passed 0, it was correct, but passing 45 was treated as 90 degrees and passing 90 was being drawn as a graphics rotated to 180 degrees. A simple divide by 2 fixed this error.. But this is not an answer and makes the whole code feel far too fragile!
Finally I noticed something was a bit wrong in the config file reading for the new display code. It seemed that due to a comment error in the display.ini file, PTK might have been asked to open a fullsized 1280 x 1024 window instead of a fullscreen mode. I certainly never noticed any window gfx previously, but it seems for some unknown reason this completely screwed up PTK’s angle code. I haven’t got a clue why.. It’s now all working perfectly again.
It’s just been one of those days where I suspect I’ve attracted the attention of a malicious gremlin.