How to test NPC Parser: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MartinFuchs remove type matching, replace standard by merged expression matching |
imported>Pinch m Changed words.xml location |
||
| (23 intermediate revisions by 2 users not shown) | |||
| Line 6: | Line 6: | ||
__TOC__ |
__TOC__ |
||
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 |
After you designed a new NPC conversation, you have to implement it in the server code and test if the NPC understands all the user input like you planned. If you have not already looked at the guides for [[Stendhal NPC Coding]] and [[Stendhal Quest Coding]], these could be helpful. |
||
If during testing you find that the NPC is not responding as you expect, you should first check that the flow of conversation states is correct. If you are using standard Producer, Buyer or Seller code, this is already likely correct. Otherwise, the [[Stendhal_Quest_Coding_-_Part_2#Ask_the_players_whether_they_will_do_the_quest|quest tutorial]] covers the theory and how to test it. |
|||
After the conversation states are confirmed correct, you can check is that the NPC is correctly interpreting ''(parsing)'' what the player says. To support you in this process there is the NPC Conversation Parser Test Environment (PTE): |
|||
[[Image:npc parser testenv.png]] |
[[Image:npc parser testenv.png]] |
||
| Line 13: | Line 17: | ||
You can launch the dialog with the script "runpte.sh" on Unix/MacOS 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 . |
You can launch the dialog with the script "runpte.sh" on Unix/MacOS 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. You can see how the parser interprets the text, recognizes the words and merges them to longer expressions. Each expression is assigned an expression type like OBJect, SUBject, VERb or ADJective. If the parser discovers any unknown words, the surrounding expression is displayed in red color. You should add these new words to the word list "words.txt", located in the package "games.stendhal. |
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. You can see how the parser interprets the text, recognizes the words and merges them to longer expressions. Each expression is assigned an expression type like OBJect, SUBject, VERb or ADJective. If the parser discovers any unknown words, the surrounding expression is displayed in red color. You should add these new words to the word list "words.txt", located in the package "games.stendhal.common.parser" . |
||
In the right window section there are visible the fields Subject, Object, Verb, ... . If the expression type is unique in the sentence, you can immediately see the respective expressions. Otherwise you see the number of expression types. |
In the right window section there are visible the fields Subject, Object, Verb, ... . If the expression type is unique in the sentence, you can immediately see the respective expressions. Otherwise you see the number of expression types. |
||