Monday, August 19, 2019

How should I parse user input in a text adventure game?


Parsing user commands in a text adventure is a spectrum from Adventure's simple "go north" to some mind-bogglingly clever ones in hhgttg.


I seem to remember reading nice how-tos in computer magazines back in the 80s, but now I find almost nothing on the 'net except a brief Wikipedia ref.


How would you do it?





Update: I went with the simplest approach possible in my Ludum Dare entry.



Answer



Did you search in the interactive fiction community? They still write parsers and some try to push the envelope by implementing new techniques such as natural language processing.


See for example this link for articles describing approaches used:


http://ifwiki.org/index.php/Past_raif_topics:_Development:_part_2#Parsing


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...