Posted 17 September 2012 - 11:21 PM
A lot of games run on scripts now that fire off when their triggers are toggled, but all these scripts and events are only self aware, and have no idea that it is not an appropriate time for them to be playing. This happens in games like Red Dead Redemption, or Skyrim.
A lot of RPG NPC characters try to do way too much these days anyways, and they end up as an annoyance instead of having a good effect on game mechanics. They just need to stand behind a counter and talk. They don't need to sleep, wander around the town square, go to the tavern, etc... If I walk in at midnight, just have him say a line about how I woke him up or whatever. In Skyrim they are either out on errands, or stumbling around their shops like drunks and knocking everything over due to an over zealous physic system. Everything they do other than standing behind their counter and selling me stuff is counter productive and lessens the experience.
Path finding is a flawed concept. Go stand around in a crowded public place and watch how well actual living creatures are able to path find. We are too distracted with whatever else is on our minds or smart phone screens. Even animals bump into or walk over each other! But when NPCs in a game do this, we call it unrealistic.
Path finding in 3d spaces is very time consuming, and it's often done very crudely just to keep the game running at a good speed. Pathfinding functions will often give up if they are taking too long, and then try again in a second or two. You'll end up with a NPC running in place against a wall until then!
The problem with some of the things in the first post is that a lot of things are queued up, and then they go down the list and act on every action item in their list. The dead NPC was alive and a valid object when the action was queued up, but somewhere along the line they died, or became invalid. You have to draw the line somewhere, and you can't have an infinite loop of validity checks.