Okay, so after largely ignoring the problem for a long time and working on other features of my game I finally got around to fixing this, and I'm posting...