How to test NPC Parser: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>MartinFuchs
edit description
imported>MartinFuchs
mNo edit summary
Line 11: Line 11:
[[Image:npc parser testenv.png]]
[[Image:npc parser testenv.png]]


You can launch the dialog it with the script runpte.sh or runbte.bat on windows. This will compile the server and tools part, then launch the Java dialog. It may be even easier or you to run it directly from Eclipse by launching the class games.stendhal.tools.npcparsertestenv.TestEnvDlg .
You can launch the dialog with the script "runpte.sh" on Unix/Mac and with "runbte.bat" on windows. This will compile the server and tools part, then launch the Java dialog. It may be even easier or you to run it directly from Eclipse by launching the class games.stendhal.tools.npcparsertestenv.TestEnvDlg .


The dialog displays how the conversation parser interprets user input and gives a hint about not yet known words. You can choose one of the predefined example sentences or write your own text into the input field. This way you can design the NPC conversations and test how the parser reacts on user input. Currently the most important output for developers may be the "trigger" field in the right bottom of the upper "Sentence" section of the window. Looking at this you can see which trigger expression is evaluated from user input, word list and grammar rules. This is used for matching in the finit state machine.
The dialog displays how the conversation parser interprets user input and gives a hint about not yet known words. You can choose one of the predefined example sentences or write your own text into the input field. This way you can design the NPC conversations and test how the parser reacts on user input. Currently the most important output for developers may be the "trigger" field in the right bottom of the upper "Sentence" section of the window. Looking at this you can see which trigger expression is evaluated from user input, word list and grammar rules. This is used for matching in the finit state machine.
Line 20: Line 20:
if you use exact mathcing, it does not match.
if you use exact mathcing, it does not match.


You may also have a look into the [http://stendhalgame.org/hudson/job/stendhal_HEAD/javadoc/games/stendhal/server/entity/npc/parser/doc-files/ConversationParser.odp documentation of the NPC Conversation Parser].


[[Category:Stendhal]]
[[Category:Stendhal]]

Revision as of 20:47, 11 December 2010



Stendhal Quests

After you designed a new NPC conversation, you have to implement it in the server code and test if the NPC understands all user input like you planed. To support you in this process there is the NPC Conversation Parser Test Environment (PTE):

You can launch the dialog with the script "runpte.sh" on Unix/Mac and with "runbte.bat" on windows. This will compile the server and tools part, then launch the Java dialog. It may be even easier or you to run it directly from Eclipse by launching the class games.stendhal.tools.npcparsertestenv.TestEnvDlg .

The dialog displays how the conversation parser interprets user input and gives a hint about not yet known words. You can choose one of the predefined example sentences or write your own text into the input field. This way you can design the NPC conversations and test how the parser reacts on user input. Currently the most important output for developers may be the "trigger" field in the right bottom of the upper "Sentence" section of the window. Looking at this you can see which trigger expression is evaluated from user input, word list and grammar rules. This is used for matching in the finit state machine. In the "Matching" section located at the bottom of the window you can select an expression type and enter a matching expression. After activating "test match" you see if the user input in the upper section matches the expression in the lower section.

It says that buy 3,000 cookie matches buy 3 cookies yes this matches when using the standard mathing method the expressions match, the njumber is just an attribute. if you use exact mathcing, it does not match.

You may also have a look into the documentation of the NPC Conversation Parser.