New AI

I haven’t had a lot to talk about in the last month, in part due to having taken on some contract work, and in part due to various distractions, including setting up a company and starting to figure out the necessary accounting and legal technicalities around that.

Which isn’t to say that things haven’t been going on. They absolutely have; at the moment, I’m at 75% of the way through the MS6 “AI Milestone” build. One of the most notable new bits is that simulated players now actually walk around buildings, instead of walking through them. Similarly, when interacting with a building, they will walk in and out of the building through a door, instead of walking straight through the wall. (Previous “most notable new bits” for this milestone build include using different models for different PC classes, proper models for monsters, animations on all of the above, etc.). But really, none of those are the really big change for this milestone.

The really big change for this milestone is is the rewrite that I’m doing to the bottom of the PC AI code; the bit which handles deciding what a PC wants to do right now, and how happy the AI subscriber is. The previous system (the one which has been the basis for MMORPG Tycoon 1.1, onward) really didn’t work properly; PCs would first decide what they wanted to do (“I want to gain a level”), and then go in search of ways to accomplish that goal, or get annoyed if there was no way to do whatever it was they wanted to do. It worked so badly that the whole system has basically been disabled for the last two or three major milestone builds, and PCs instead are just hard-coded to constantly try to do quests, or go grinding if there are no quests available.

Now PCs are becoming smarter. I’m setting up a system similar to the one used in The Sims, where objects in the world advertise potential activities which a PC can do with them, and the PCs evaluate which available activity would make them happiest right now. I’m about halfway through this conversion right now, and I’m reasonably pleased with how it’s going. Certainly I think it’ll provide a lot of potential for more interesting PC behaviour! Plus, it cleans up the AI code a lot, and should make it easier to maintain and extend in the future. It also opens up an intriguing possibility for modders to add new buildings or world objects to the game, and have them “just work” with the existing AI systems, which most definitely was not the case with the old AI system!

As of right now, the large tasks remaining for the MS6 build are:

  • Finish the action-picking AI rewrite.
  • Allow the user to open up a gateway into a town, by building a road to that side of the town.
  • Simple combat sprite effects, both for melee and missile attacks.
  • Implement PC socialising.
  • PCs should join up in parties.
  • Implement PC shopping.
  • Allow the player to create roads between regions.
  • Allow the player to create “epic quest-givers” who may only have a single quest, which will send a PC to another region.