Code-Slinging for a Day

Hey Folks! Hope everyone had a good weekend. Fortunately, I think the hard work last week nailing down booth stuff earned me a more relaxing weekend. I was able to get some R&R without stressing over the big-ticket stuff for the first time in a while.

And since I have a bit of breathing room, I decided to do a bit of code work today. I checked out some bugs on my list to see what I could repro and fix, and managed to knock out a few things.

First, a rather strange bug involving a save game with an AI creature named "Player" was causing crashes. Ignoring the creepiness of the doppleganger, it looks like the issue was when a creature had the player's faction set. When this was the case, that creature tried to access some properties on the player that only exist on AI creatures (e.g. home tile). So I added a check here to avoid this null pointer.

Of course, this doesn't explain where the fake "Player" came from. It could be similar to the early sightings of King Eli, or completely unrelated. I'll have to keep an eye out for this.

I added some code to move the item context menu upward if it hides behind the message log. Now, it should behave a bit more like the item tooltip, always fitting fully on screen.

I reverted the scavenge site spawn rate optimization I made a while back. As several of you have pointed out, some problems were appearing as a result of the change, including the cryo facility scavenge site reappearing. I've reverted the change back to the old way, and simply capped the processing at 2 weeks' time per hex. In my testing, this seems to be long enough to produce reasonable spawned sites, but short enough to be unnoticeable processing time.

Finally, I did some testing with a trackpad and the right-click context menu. A long while back, MS Surface users reported that the right-click context menu didn't work in-game. I wasn't able to repro the issue at the time, and chalked it up to a Surface peculiarity.

By accident, I ended up reproducing the issue when I was using my MacBook Pro with Windows 7 loaded onto it. In this case, the right-click menu behaves as the Surface did when using the trackpad to click. The trackpad's button worked normally, but tapping the trackpad did not.

So far, this appears to be an issue with the way mouse events are triggered with normal mice vs. trackpad taps. I'm going to see if there's anything that can be done here, and if it's not too much rewriting, hopefully I can fix it.

That's all for today. Tomorrow may be more code work, or if booth stuff acts up, I may have to switch back. In any case, it was good to make some game progress today!