Sunday, July 10, 2011

Commoner AI Project

Crimmor needs to feel like a big city. And that means not just buildings, but commoners, lots of commoners, behaving in natural ways. Definitely an AI challenge. What I've been doing is combining Uncle FB's npc control scripts with ones used by Lugaid of the Red Stripes in Danaan Unvanquished, and added in my own code.

The goal is to provide an advanced AI for those "unimportant nameless npc" groups that fill out game worlds, while keeping things simple for builders to implement by minimizing the need for things like local variables. This AI is not for any npc that you want to behave in a specific way. The builder places an npc with this AI in their heartbeat, and they will eventually behave depending on their creature tag using substring detection to catch "classes" such as commoner, merchant, noble, bard etc.

Day/Night schedules happen automatically depending on waypoints placed in the area by builder. The schedules have randomization built in, with the randomization controlled via script variables. Common actions such as farming, shopping etc are predefined for builders, so commoners that spawn and move towards waypoints indicating these behaviors will automatically adopt them. For example a builder can place a "farming" waypoint and any commoners who are directed to that area will automatically play farming type animations.

As this is a project for the benefit of the community, feel free to take, fix, and improve, as long as you contribute back so others can benefit.

Social Thread.

No comments:

Post a Comment