I’m just starting to think about NPC movement. My present feeling is that an NPC should first explore an area and ‘remember’ the location of key features/areas. Sorta look around first and ‘say’ “oh, there’s a door over there and a window over here.” Identify areas of danger and areas of safety. And NPCs should be doing something, task/goal driven. I hate how, in some RPGs, the NPCs are always in the same spot doing the same thing. Its a little different in Oblivion, the NPCs seem to follow a time table. But I killed a shop/bar owner once and the waitress just kept moving around and even walked over the corpse. That doesn’t seem right. I noticed in some games, the patrols will notice a change. If a door, once closed, is now open or if a light is broken they will comment/act on it.
I hope this can be a broad discussion. Maybe compile a list of ways that NPCs can be controlled and site games that use that method. I’m new to this. I know some buzzwords like scripting, pathfinding, and waypoints but no real code to support it. How were the bots in Pac Man controlled? Does anyone have python code for this?
And maybe we can list websites that give sample code and such. I found a paper earlier tonight that presents an interesting take on NPC perception. www.kynogon.com/images-blog/ Documents/WPG1Perception.pdf
This way when a light bulb breaks it could send a message out saying it’s broke so all other objects in the world could react to it. You could also set a task to have the message get sent out so many seconds or minutes so that other NPCs will notice it.
“…games like MechWarrior. They use goal-based engines - each entity within the game is assigned a certain goal, be it ‘protect base’, ‘attack bridge’, ‘fly in circles’. As the game world changes, so do the goals of the various entities.”
Memory in Games generation5.org/content/2000/game01.asp
“…instead of covering each move combination or pattern (and have about 20 page of code), we could use an algorithm that would use memory of previous game so it wouldnâ€™t make the same mistakes over and over again (and use about 20 lines of code).”
Smart Moves: Intelligent Path-Finding gamasutra.com/features/19990212/sm_01.htm
" To demonstrate the workings of the algorithms visually, I have developed a program in Delphi 2.0 called “PathDemo.” It is available for readers to download. "
Also contains sample code for Breadth-first search, Dijkstra’s algorithm, and A*. See Listings 1-3 in the article.