I can’t believe the last post was two months ago. Actually, I can believe it, because I know why it took me so long. It took me so long because I was working on getting the pathfinding back together in Forgotten Times 2. I say back together, because when I originally wrote the AI, the characters had the power to move between any arbitrary points in an area. However, since then (circa 2003-04) I basically ripped out everyone’s brains and left them standing stationary and waiting for the player to interact with them. Now, since May, I’ve been putting the pathfinding back in to support some new plot segments, and it’s been more than a little difficult. The problem is that I not only ripped out everyone’s brains, I also changed how the software gives commands to the different characters. Circa 2003-04, I figured out how to get from point A to point B as part of the main document class. Since then, I’ve moved the brain power into the characters themselves, leaving the document class to basically store data. While that makes sense from a compartmentalization standpoint, it didn’t work at all from the standpoint of making the AI work, since the data I needed for pathfinding was stored in the form of private members of the document class.
Unsurprisingly, that caused no end of heartache which in the end was resolved with a tremendously ugly (but functional) solution – I duplicated the data I needed as global data. At some point, I’ll rationalize things so that I don’t have duplicate data stored as globals and as private members of the document class. At this point though, I’m just happy that I got things working.