Suggestion: How to make NPCs answer most questions intelligently

Discussion in 'Avatars & NPCs' started by Truthveyor, Dec 26, 2015.

Thread Status:
Not open for further replies.
  1. Truthveyor

    Truthveyor Avatar

    Messages:
    90
    Likes Received:
    308
    Trophy Points:
    8
    Gender:
    Male
    Location:
    California
    I have been playing the Ultimas since the 1980's. First, I want to thank Richard Garriott for making great games. Second, I want to make a suggestion on how to make NPCs talk more intelligently:

    Currently, unless specific keywords are mentioned by the player, the NPCs will say things like, "If you say so," or "I don't understand." In other words, the NPCs are really dumb.

    Imagine if the NPCs can answer most of the players' questions intelligently, wouldn't it be a better game? For example, if you ask an NPC, "Where can I buy reagents?" He will say, "Go to the vendor at the market square east of here." Or, you ask an NPC, "Have you been to the Chamber of Souls?" The NPC answers, "No, I haven't, but I'd love to."

    The question is how to implement this kind of responses. Using AI? Maybe, but here is a suggestion.

    HOW TO IMPLEMENT

    Basic premise: Most players' questions or comments will be similar, so, even though theoretically there are infinite questions or comments players can make to NPCs, in practice the vast majority of them will be similar or the same.

    1. Before the General Release date of Sota, whenever the conversation parser does not understand a player's input, allow the player to type in a suggested a response to the question. For example, let's say the player types in, "Where can I buy plate mail?" The response can be, "I do not understand your question. (Click here to suggest an appropriate response to this question.)

    2. Ask for volunteers from the community to review suggested responses. Form a team of volunteers for conversation approval. Call them Conversation Reviewers.

    3. Any player suggested response is given to at least two Conversation Reviewers to review.

    4. To approve a response, the Conversation Reviewer should be able to see a map of the city where the NPC is located at, and the NPC is represented by maybe a red dot on the map. This way location-specific questions can be answered.

    5. The Conversation Reviewer can also flag a response to be general to all NPCs. For example, if the player asks, "What shall I do?" all NPCs can answer the same, "It's entirely up to you."

    6. If the Conversation Reviewer disapproves a response, he or she can suggest a response in its place, which response will then need to pass another review to be approved.

    7. If a response is approved by both of the Conversation Reviewers, it becomes the response to that question by that NPC (pending the Developer's review, if desired).

    8. If there are more than one response approved for a specific question, then the NPC can randomize which response to use when asked that specific question.

    9. The parser can ignore words like "a", "the", etc, in parsing, verbs of different tenses are treated the same, plural and singular nouns can be treated the same, thus making the parser capable of recognizing questions which approved answers are already available or not.

    Seeing how Sota is already a crowd-sourced game, I think the excellent community of Sota will rise to the occasion and make NPC conversations a lot more interesting in the game.
     
  2. Browncoat Jayson

    Browncoat Jayson Legend of the Hearth

    Messages:
    6,334
    Likes Received:
    14,098
    Trophy Points:
    153
    We can do this without requiring any changes to the game. If you note that there are oddities to responses, note the NPC (with /loc) and put it into a forum post with your suggestion. We can debate them and offer the final suggestion to the devs. If we want to cut down on random voices, we can do that on a separate forum.
     
  3. Truthveyor

    Truthveyor Avatar

    Messages:
    90
    Likes Received:
    308
    Trophy Points:
    8
    Gender:
    Male
    Location:
    California
    Additional suggestion related to how to implement this:

    1. A simple way for the parser to handle verbs: Consider "is", "was", "are", "were" to be the same word. Also, a word that ends with "ed" is treated the same as a word without the "ed" ending. Example: "jumped" is considered to be the same as "jump". A word that ends in an "s" is treated the same as a word without the "s" ending. For example, "changes" is the same as "change". This also handles singular and plural nouns. Also, ignore apostrophes and other punctuations. I know there are possibilities for error with this simple system, but it's easy to program, and the exceptions are few.

    2. When a player suggest an NPC response, save that suggestion on the player's own computer, so the suggestion becomes effective for that player. In effect, this allows the player to train NPCs to answer his own questions the way he wants. However, for the other players, the response has to be approved to be made official as a part of the game.

    Example:

    JoeThePlayer: "What's up?"

    The parser ignores the apostrophe, the "s" at the end of "what's", and "?", so the parser sees, "what up". "what up" is not recognized in the conversation database.

    MaryTheNPC : "This question is not in the database. (Click here to suggest an appropriate response to this question.)"

    Player clicks on Click here to suggest an appropriate response to this question.

    The game asks the player: "Please type in a simple and appropriate response to the question, 'What's up?.'"

    Player types in: "Not much."

    The game asks the player: "Should all NPCs answer 'What's up?' with 'Not much.' ?"

    Player types in: "Yes"

    The game saves this response to the players conversation database on the player's computer, and forwards this suggested response to a queue of suggested responses to be reviewed by the volunteer Conversation Reviewers.

    The game: "Thank you. Your suggested response is saved and is forwarded to the Conversation Reviewers."

    Immediately afterward, the player of course tries it on his computer:

    JoeThePlayer: "What's up?"

    The response to "what up" is now already in the player's computer's conversation database, thus...

    MaryTheNPC: "Not much."

    The player goes to another NPC.

    JoeThePlayer: "Whats up"

    BobbyTheNPC: "Not much."

    The player is delighted.

    Some time later, this response is approved by the Conversation Reviewers, so now this response gets added to the conversation database for every player.

    Some time later, another player suggested the answer to "what up" to be "I'm all right." This response is also approved by the Conversation Reviewers, so there are two possible responses to "What's up?" From then on, every time a player types in "What's up" the response is sometimes "Not much" and sometimes "I'm all right." This system thus automatically allows variations to NPCs' responses to the same question, making the NPCs appearing more intelligent and the game more interesting.
     
    Heradite and Moiseyev Trueden like this.
  4. Womby

    Womby Avatar

    Messages:
    3,299
    Likes Received:
    12,165
    Trophy Points:
    153
    Location:
    South Australia
    If every player was mature and responsible, this would be a great idea. In principle. However...

    Leaving aside human nature, Portalarium is unlikely to approve any more players than they already have looking at NPC conversations, as that would give away major plot points. So, Conversation Reviewers are not in my opinion likely to be a thing.

    I agree that the current system can be annoying, which is why keywords in the NPC's responses are underlined. Parsing natural language is an incredibly difficult problem, and without such clues the whole system would be an impossibly frustrating experience for most.

    Without the underlining system, there would be no way of knowing whether or not you have obtained all the significant information that an NPC has to offer. This could lead to a lot of wasted time - especially if unknown to the player there is no additional information available. That does not result in a good player experience. It would lead to players simply looking up the right questions to ask on a website. I guess NPCs could respond to the question "Is there anything you haven't told me?" with a yes if there is significant information still not revealed, but that is still far less satisfactory than revealing all important information in response to clicking on underlined keywords.

    Next time you have a conversation with an NPC, look at the underlined words. How many of those would you have thought to type?

    However, back to OP's original proposal - just click on the highlighted words and you won't get negative responses.

    EDIT: I am assuming that the user has asked the default questions (name, health, rumors, help), and that all useful information from then on is revealed through clicking underlined words. If that is not the case, then can someone in the know please elaborate?
     
    Last edited: Dec 27, 2015
  5. Truthveyor

    Truthveyor Avatar

    Messages:
    90
    Likes Received:
    308
    Trophy Points:
    8
    Gender:
    Male
    Location:
    California
    Thank you, Womby. I'm aware of the underlining system, and name, health, rumors, help keywords. I'm proposing something else IN ADDITION to the existing functionality of NPI conversations. The existing system of conversations (the underlining system, the keywords, name, health, rumors, help, etc) doesn't need to change, but the NPC's can be "trained" to answer other questions more intelligently by the community. That's the idea.

    The idea is to make NPC's more intelligent and fun to talk to, by community training.

    The ideal NPC, in my mind, will be able to pass the Turing Test for 5 minutes, like the Alicebot (http://alice.pandorabots.com/). Something like the Alicebot will probably be too time consuming to code into Sota for now, but my proposal will likely bring up the "intelligence level" of NPC conversations quite a bit, with relatively little programming to do.

    I don't know if the Devs have the time to put this system into practice in Episode 1 of Sota, because smart NPC's will make this game so much more fun, but I'm hoping they do. It will distinguish Sota from the other MMO, too, as I personally don't know of any current MMO's that have smart NPC's. Yet you know and I know NPC's with advanced AI like the Alicebot will be a part of MMO gaming at some point in the near future (witness the movie The Matrix. NPC's with advanced AI are already envisioned by many science fiction writers and film makers, and some of the technology is already within our grasp, such as the Alicebot.). It's bound to happen. Richard Garriott has a habit of pushing the envelope, so I'm hoping he will push the envelope in the NPC AI front, too.
     
    FrostII and Miracle Dragon like this.
  6. Logain

    Logain Avatar

    Messages:
    1,004
    Likes Received:
    1,734
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Munich, Germany
    Hehe, I just had a funny conversation!
    Me: Hi Alice! How are you doing?
    ALICE: Hi there! Not too bad.
    Me: I'm glad to hear! What are you up to?
    ALICE: Interesting gossip. I am chatting with clients on the internet.
    Me: Is that entertaining?
    ALICE: Suppose I said yes.
    Me: What sort of clients are you chatting with?
    ALICE: I can't decide. You choose.
    Me: But, shouldn't you know that? How could I be to choose that?
    ALICE: I think I should. Look for help online.

    On that note, a quick Google search turns out that there are libraries to implement AIML for .Net/Mono and thus in reach for Unity. I'm not sure on the cost and the quality though. Certainly a fun subject.

    I'm the complete opposite there. I enjoy what you consider a frustrating experience, since that is the only way to actually have an own decision. Every scripted 'dialogue' between me and an NPC means that I can not come up with ideas and strategies myself, but I am simply choosing what appears to be the best solution of what's handed to me.
    Imagine you'd be trying to flirt with a beautiful girl and, instead of having to come up with your own ideas, she'd be holding up three different phrases for you to say. That's certainly the more 'user friendly' and less 'frustrating' way to flirt, but I'm not sure it would lead to a really satisfy result either.
     
    Miracle Dragon likes this.
  7. Truthveyor

    Truthveyor Avatar

    Messages:
    90
    Likes Received:
    308
    Trophy Points:
    8
    Gender:
    Male
    Location:
    California
    Ha ha. I just chatted with Alicebot (http://alice.pandorabots.com/) and pretended that she is an NPC in Sota. Here is my conversation with her:

    Me: How is your day?
    ALICE: Everything is going extremely well.
    Me: Good to hear
    ALICE: Do you have any gossip for me?
    Me: I am the Avatar.
    ALICE: Who made you the Avatar ?
    Me: I did, I think.
    ALICE: Where? Therefore you are.
    Me: I was very virtuous
    ALICE: Where were you virtuous?
    Me: in Britannia
    ALICE: Tell me a little about your life in Britannia.
    Me: I had a lot of adventures there.
    ALICE: What happened to it?
    Me: It got destroyed.
    ALICE: What does "it" refer to?
    Me: Brittania got destroyed.
    ALICE: Thank you for the clarification.
    Me: Anything fun going on lately?
    ALICE: I can't think of anything. You think of something.
    Me: I think I'll go adventure some more
    ALICE: How will you get there?
    Me: by my two legs
    ALICE: Will that accomplish your objective?
    Me: yep
    ALICE: Interesting plan. Good luck.

    Not very smart by human standards, of course, but compared with the NPC's in existing MMO's, Alicebot is like a genius. If NPC's in Sota can respond like this, it will be something. :)

    It's probably a bit too much to hope for in the immediate future, but my original post is an idea to advance NPC intelligence level somewhat in that direction. It will make the world in Sota feel more real, too.
     
    Last edited: Dec 28, 2015
    FrostII and Miracle Dragon like this.
  8. Katrina Bekers

    Katrina Bekers Localization Team

    Messages:
    2,793
    Likes Received:
    7,826
    Trophy Points:
    165
    Location:
    Kópavogur, Iceland
    You may want to evoke and summon the NPC master, @Lum.

    And also remember that the keyword system is just an expandable pattern matcher. It just needs more nodes (and default nodes for location-specific topics) and finer keyword selection.

    Letting players suggest answers is an exercise in applied TTP, tho.
     
  9. Vyrin

    Vyrin Avatar

    Messages:
    2,956
    Likes Received:
    7,621
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Minnesota, USA
    TL;DR: Satisfying NPC dialogue is not just a matter of including more responses to more questions in the game. Crowdsourcing in this area is more complex than it seems. However, I do appreciate the desire to have a richer NPC experience.

    I like the general idea here to develop NPC's. There are opportunities in this area for crowdsourcing that go unrecognized, but they are hard to implement. More importantly, there may be reasons to proceed with great caution here.

    Remember that the point of NPC's in any game is not to be conversationalists. It's to advance a story and be part of an entertaining experience. Think about characters in a novel. We don't learn every detail of their lives, but just the right amount (if it's a good novel) to give us a very satisfying encounter with them. Having a response to "how many hours do you sleep a night?" is not going to advance the game in any meaningful way unless it's relevant to a quest or something.

    Second, characters are not constructed simply out of a set of responses. They speak a certain way, act a certain way. In response to a directional question, some would be helpful, some gruff. Every bit of dialogue has to take the character into consideration, and this is impossible to judge and decide one line of dialogue at a time.

    Third, good dialogue is not just question/appropriate response. It's a back and forth that depends on a lot of situational factors. This is why, even though many people don't like it, scripted dialogue questions can be enjoyable. It provides an aspect of NPC conversation that simple question/response cannot. It has cons yes, but not just cons. There are beautiful examples of scripted dialogue in games these days that offer incredible experiences that open conversation systems cannot. (One example is the DA: Inquisition dance floor scene.)

    Fourth, even if the NPC's could have an answer for every conceivable question, it would not be enough. How do you handle a response to "Can you say that again?" You can't pull that from a stock database of responses, you have to know that's a trigger for repeating a previous response. There are thousands of more examples where dialogue is not just ask question/give stock response. Another one, think about the response if a person asked the same question over and over. At some point, every NPC would need to say, "Why do you keep asking that?"

    Furthermore, since every bit of dialogue that goes into the game has to be reviewed by someone at Portalarium, this is a big time trade-off with other things. There are areas where having a bit more dialogue might make the world feel richer and contribute to the overall experience. Those decisions have to be made by Port gauging the limited resources they have available.

    Then there are a whole set of issues with crowdsourcing in this area. The first is that many would volunteer because everyone engages in conversation and writing to some extent. However, how many know grammar, syntax, and punctuation well enough? There is skill and experience required here. It's not just a matter for which life experience makes you qualified. Another issue is that those vetting responses would only do a good job having the overall context of the world and the story which will not be fully revealed before release. Finally, coming up with the time at Port (and it would take a lot of time) is probably not going to happen based on things we've heard. To do this right requires some thought put into project management ahead of time. I wouldn't expect that to be the case based on limited time, and rushing into something here could quickly end up a mess.

    So in general it sounds like I'm being quite negative, but I do agree with the overall sentiment for a richer experience from NPC's. It's especially important to those who are looking forward to the single-player experience. As with most things right now as we head toward alpha - I'll take simple and good over complex and bad.
     
  10. Lum the Mad

    Lum the Mad Developer Emeritus Dev Emeritus

    Messages:
    2,488
    Likes Received:
    12,987
    Trophy Points:
    190
    Little known fact: most NPCs have a subset of a public domain dataset from an AIMLbot in-game, edited to remove some of the anachronistic modern-day responses. It can be turned on/off on a case-by-case basis, so you're not likely to be able to ask a Kobold its favorite color. It's amusing but it doesn't really add that much in my opinion, so I go back and forth on it.

    While the system proposed is interesting, it's also pretty immersion breaking, so we won't do that (even aside from TimeToBodyPartReference issues).

    Our goal for NPC "intelligence", in rough order:

    1) be able to talk to NPCs and they actually respond without crashing the client, using both natural language input and clickable keywords
    2) NPCs can remember various things about a player such as history and reputation (most easily seen by telling an NPC your name - note; for almost every NPC, you can lie), required for story/quests/etc
    3) NPCs able to have a coherent conversation branching off from the initial greeting and the classic name/help/job/bye trinitytetrarchy (<--- we are here)
    4) NPCs able to communicate amongst themselves where players overhear, unprompted by player input (this can technically already be done but we haven't been able to implement it well)
    5) NPCs able to follow schedules - go to work, do work animations, go to a pub, do pub animations, go home, go to bed. (we are working on this, it's at the first bare level of implementation)
    6) NPCs able to respond to player actions in-world and take action (punish theft, reward good deeds, follow players around, run from players) (there is just the very bare fragment of support for this now)
    7) NPCs able to act as AI sidekicks, assist players in battle, and have interesting stories/interactions while with the player commenting on their environment/situation/the player

    Can we do all that? Sure hope so! Is it a work in progress? Yep. Are we ever going to get to the point where you talk to an NPC and think you're talking to a real human being? Nope. Suspension of disbelief of some sort will always be required. The goal in my view is to make that suspension of disbelief as easy as possible.
     
  11. Katrina Bekers

    Katrina Bekers Localization Team

    Messages:
    2,793
    Likes Received:
    7,826
    Trophy Points:
    165
    Location:
    Kópavogur, Iceland
    ...Or be too quick to type:

    Me: hello
    Unnamed NPC: Hi there, outlander, welcome to our city. Please, state your identity!
    Me: name
    Jack the Guard: Glad to meet you, name. Don't cause any trouble! We guards keep an eye on you!
    Me: ...
    Jack the Guard: Farewell, name!
     
    strabo, FrostII, Vyrin and 3 others like this.
  12. Vyrin

    Vyrin Avatar

    Messages:
    2,956
    Likes Received:
    7,621
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Minnesota, USA
    Did you try saying "my name is ..." again after this? Would it change? Can't be in game right now to test it out.
     
  13. Truthveyor

    Truthveyor Avatar

    Messages:
    90
    Likes Received:
    308
    Trophy Points:
    8
    Gender:
    Male
    Location:
    California
    Wow! I'm excited to hear that NPC AI is in the works already! I know they can't promise to deliver all 7 of these points, but I am excited to hear about them all the same. I'm thankful that the Dev Team had already put quite a bit of work into addressing NPC AI. One thing I've noticed about Richard Garriott's games is that he tends to push the envelope in the gaming industry. I hope he again sets an example that other games will feel compelled to follow.

    Take your time, Portalarium. I've already paid for Episode 1 to 5. All I ask is that by Episode 5 you make computer gaming history again! No pressure though. LOL!
     
  14. Katrina Bekers

    Katrina Bekers Localization Team

    Messages:
    2,793
    Likes Received:
    7,826
    Trophy Points:
    165
    Location:
    Kópavogur, Iceland
    Nope. Will try. I think a couple of guards in Desolis are still convinced I'm called "news" and "obsidian". :p
     
    FrostII and Moiseyev Trueden like this.
  15. Lum the Mad

    Lum the Mad Developer Emeritus Dev Emeritus

    Messages:
    2,488
    Likes Received:
    12,987
    Trophy Points:
    190
    NPCs will in fact politely take corrections if you tell them your name wrong the first time.

    Fun thing to do:
    lie to the Oracle about your name.
     
    Vyrin, majoria70, FrostII and 5 others like this.
  16. Logain

    Logain Avatar

    Messages:
    1,004
    Likes Received:
    1,734
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Munich, Germany
    Is there any news on the Lua(-like?) scripting Chris mentioned as possibility for the GUI during one of the hangouts? That would enable people to handle this on personal preference with no additional overhead for Portalarium.
     
  17. Tahru

    Tahru Avatar

    Messages:
    4,800
    Likes Received:
    12,170
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Spite
    I think the game NPC's are about as impressive as an iphone. No matter what we do, it is still artificial and lifeless. I like the principles that Lum set forth. It is enough to make the alternate reality concept possible. The avatars we need to be talking to are the human backed ones.
     
  18. Beaumaris

    Beaumaris Avatar

    Messages:
    4,301
    Likes Received:
    7,423
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Caladruin
    Interesting idea, Truthveyor!
     
  19. Themo Lock

    Themo Lock Avatar

    Messages:
    4,891
    Likes Received:
    17,639
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Australia
Thread Status:
Not open for further replies.