Grasp of the Fallen
Grasp of the Fallen / Engines /

Natural Language Parsing

Updated: 4/8/2006

natural language parsing - DIFFICULT

assume: player is in town talking to a villager and there is a cave outside town.  The player has been given a quest by Gina to find her son.  She said he's usually playing around the cave.

1. player: "Where is the cave?"
2. villager: "The Bat's Cave(red) is a short walk southeast of town. Gina's son likes to climb the rocks outside the cave."
3. player: "I see, How dangerous is the cave?"
4. villager: "The cave could be scary for Gina's boy, but you seem like you're quite capable to venture there alone."
5. player: "Thanks a lot"
6. villager: "Good luck finding Gina's son."

Programming analysis for above conversation:

1.  run pre-processor
 found "where" - looking for object/location. 
 check for specific object/location and then check for generic match.
 found generic "cave", search for specific caves the villager knows about. - found "Bat's Cave"
 retrieve data for "Where" "Bat's Cave".
 distance from location of villager - 0.3 kilometers
 direction from parent location of villager(town) - southeast
 retrieve location tree for the villager and "Bat's Cave"
 Found: world -> region -> town -> villager
 Found: world -> region -> "Bat's Cave"
 rate distance on 1 to 10 scale: 0.3 miles take <1 minute to walk Result: 1
 get text variation for distance: 1 - Found: "short walk"
 get text variation for direction: "southeast of town"
 check for known quest in Bat's Cave Found: "Gina's son missing"
 get text variation for: "About" "Gina's son missing" : Found "Gina's son likes to climb the rocks outside the cave."
 build final result: "The Bat's Cave is a short walk southeast of town. Gina's son likes to climb the rocks outside the cave."
3. run pre-processor
 found "how" - look for a keyword adjective or verb. Found: "dangerous"
 check for object/location: Found "cave"  Is cave in previous conversation? Yes - use data. Found "Bat's Cave"
 retrieve data for "How" "Dangerous" "Bat's Cave"
 rate difficulty 1 to 10: 1
 get text variation for difficult: 1  result: "you seem like you're quite capable to venture there alone."
 check for associated quest difficulty: Found "Gina's son missing" -> difficulty: 6
 get text variation for difficult: 6  result: "The cave could be scary for Gina's boy"
 check difference in difficulty: 5 - high - make exception in speech (, but)
 result: "The cave could be scary for Gina's boy, but you seem like you're quite capable to venture there alone."
5. run pre-processor
 found "thank" and nothing else
 was there previous conversation? yes
 get text variation for "good bye" and "Gina's son missing"
 Result: "Good luck finding Gina's son."


Player input pre-processor:
 run word updater - replace all words with the preferred similiar word. 
 remove extra words (the, is, an, a, etc)
 look for question mark and question words (who,what,when,where,why,how)

What's in the database:
 The database would store generic events.
 The location, difficulty, direction and other things would be variables.
 On each world events update, the current events will be checked for expiration. Expired events are updated to the next idle status marker (which could be the end of the event) Randomly new events are created.  The total number of world events has to be about the same all the time to prevent too much CPU usage.  NPCs can complete events on their own.  Some events require activation by the player only. 




©2004-2019 GraspoftheFallen.com - All Rights Reserved. An RPG game under development by Bruce Kirkpatrick | Jetendo CMS | Web Design | Have comments? Email Me