Search Unity

Chat Bot

Discussion in 'Game Design' started by Someonelse812, Oct 30, 2014.

  1. Someonelse812

    Someonelse812

    Joined:
    Oct 26, 2014
    Posts:
    9
    Hello Everyone
    I'm new to game design and new to this forum, so I'm sorry if this is in the wrong forum or if this question isn't specific enough. I don't know enough yet to know what I'm doing or even ask the right questions, but I've recently become obsessed with learning Unity and Blender so I'm hoping someone can at least point me in the right direction?

    Anyway, my idea is this...
    Chat Bots have become pretty advanced, in fact just in this past year a chat bot has passed the turing test. So I was thinking, what if you get a decent quality chat bot and put it in the game? For specific NPCs and quest related conversation I would still want to write specific dialogue, but for random NPCs I would just want to have some personality aspects that could be put together randomly to create a personality. Then when the player talks to some random, non quest related NPC they can actually have a conversation rather than just getting the same old repeated line about an arrow in the knee.

    I'm guessing this is a big sweeping idea that is WAY beyond anything I could ever hope for any time in the near future, but that is my idea.
    What do you think?
     
    randomperson42 likes this.
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,528
    I think you would have a challenge getting people to talk to something they know is not a person, like it's a person. For example, when I use Siri - which is, of course, designed to make the user feel they're talking to a person, in a sense - I started off using full sentences ("Siri, will it rain today?"), but as I got used to it, the sentences got more and more streamlined until I'm just giving Siri direct commands ("Siri, hourly forecast"), the bare minimum to get the job done.

    Let's assume you do manage to create a very convincing chatbot engine, and integrate it into your game. I think if your player has to chat with an NPC to advance the plot, they may start off having real-ish conversations. But eventually, they will start to pare it down to just what they think will get them from plot point A to plot point B.

    You could punish the player for that (maybe make the NPC think the player is curt and rude, making it difficult to accomplish certain objectives), but TBH I think that will simply turn the player off to the game rather than encouraging politeness.

    And if talking to NPC's doesn't get them from plot point A to plot point B, they probably won't do it at all. The only reason anyone does it now (with the arrow to the knee NPCs) is looking for the right guy to talk to.
     
  3. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    It's a nice idea, but the amount of work that would have to go into such a system seems like it'd be more trouble than it's worth?
    It's worth noting that any talks of bots passing the Turing Test are largely irrelevant in situations such as this.
    The Turing Test measures essentially the ability of an AI to feign intelligence, not posses actual intelligence.
    Therefore applying the current techniques used to 'pass' Turing Tests are fairly useless, given their propensity to just deflect the conversation to avoid answering questions.

    Creating a bot that chats about your game, to the player, while providing any kind of useful interaction other than simple amusement, seems likely to be beyond the bounds of Chat Bots at this point. (Edit: Unless you vastly simplify the idea of a chat bot down to something that simply recognises key words in the sentences, or similar, which has been done before in games. I'd say that's a bit less interesting from a players perspective though.)

    Hey, I'd love for you to try and prove that wrong though :)

    (It's also highly under debate as to the validity of any of these passes, but that's here nor there)
     
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,528
    I disagree on that point. When you put a tennis ball in your game, it's feigning a sphere. You put a rigidbody on it, it's feigning gravity and collisions using math and logic. Everything in every game is a feint, and dialog/intelligence need not be any different.
     
  5. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    That's true, but I'm talking about the bot needing to be intelligent about what it talks about, relating to the game.
    If every time you asked a bot how dangerous they think 'Mutilation Pass' is to the north, and all they can do is deflect the question by talking about how lovely the weather is, it's not going to be very useful to the player.

    This is based on the assumption we're using one of the bots used in the recent Turing Test competitions, which tend to fool people by never directly answering questions (not a useful trait for a bot, though it does allow it to fake being human).
     
  6. runner

    runner

    Joined:
    Jul 10, 2010
    Posts:
    865
    NPC's in RPG's have been known to give out quests, Move the story forward and give one-liners such as "I took an arrow in the knee". Even responses to the players Abilities such as "I'am gonna kill that "^%#^" when i see him.
    I usually find that NPC's that are standing around only have 1 or 2 different response's they make when they are within range of another, The thing is you find these kind of NPC's in a great many games. Oratory or otherwise they may not respond to text but they are chat bots in a way.

    Just my take.
     
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,138
    This is something I've thought about a lot, as I have some experience with chatbots (my BRIAN program won third place in the '98 Loebner competition). And I'm one of those role-playing players who likes to actually play a role, and I get mighty annoyed at all the dumb-as-a-chair NPCs with their one or two lines of dialog.

    Now back in the days of MUDs (hi @Teila!), there were NPCs who could actually hold up their end of a conversation for a while. It helped that dialogs in those days were not menu-driven; everybody was at a keyboard anyway, and if you had something to say, you just typed it. These NPCs could discuss a variety of topics, and in a few cases even be useful — healing you if you asked them nicely, reporting whether they'd seen somebody (you're asking about) recently, etc.

    In addition to regular NPCs, there were bot players who connected just like regular players, but ran entirely in code. Some developers (including me) made a game of seeing how realistic they could make these AI players, which meant they could do things like join you on quests, attack monsters when directed to, and at the same time make appropriate small talk so you wouldn't know the difference. OK, so they usually didn't fool people for very long... but they were way better than anything you see in modern games.

    (And then there were cyborg players, who had a human at the keyboard, but a large number of things they did, including combat and navigation, were automated... good times!)

    So! This idea of embedding a chatbot in a game isn't new. But it might be a hard fit for modern conventions, where dialog is almost exclusively menu-driven.

    I wonder, though, if more free-form dialog will make a comeback now that speech recognition is cheap and good (mostly due to Nuance).

    Finally... if anybody does want to try putting more intelligent chat into their games... please hire me! I love this sort of thing, and I will knock it out of the park.
     
    longisle, Ryiah and Teila like this.
  8. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,696
    Hey, Joe! :)

    Unfortunately, non-menu driven dialogue is based on keywords, so you get the player saying stuff like "Where" knowing that word would trigger a response. Not that doing such things is bad, but it makes all your carefully placed dialogue a waste of time.

    I would be very interested in figuring out a way to make NPC dialogue more realistic. I believe it was in Oblivion where I first saw NPCs gossiping to each other about what your character did (or did not do) and spreading basic gossip in town. In a MOG it would be nice to have triggers that made certain player characters part of local gossip. I guess you could tie it to tags. Not super realistic but could be fun for the players, at least for the role players who care about such things more than leveling up.

    I do remember having conversations with NPCs. Of course, I did that in later games too, even if the NPC didn't respond back. :)
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,414
    You reminded me of a game I ran into called Façade. It mixed natural language processing with a graphical environment and voice acting.
     
    Last edited: Oct 30, 2014
    Gigiwoo likes this.
  10. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,696
    Ooo, I want to play that game. It is one of the 1001 games you should play before you die! lol Maybe I will wait a few more years.
     
    Gigiwoo likes this.
  11. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    6,528
    Wow, that game looks awful. I mean, it looks like a cool game, it just looks awful. Kind of a shame it doesn't run on modern Macs, I'd like to have played it.
     
  12. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,138
    @Ryiah, I missed out on Façade, and no longer have a computer old enough to run it, alas. But it does look pretty cool (so thanks for pointing it out!).

    @Teila, it's not always true that text-based dialog is driven by keywords. That's often true, but it doesn't have to be; we can do quite a lot of real natural language processing (NLP) these days. Even back in the day, I wrote bots that did more than just respond to keywords; they used flexible sentence templates (much like Siri does today) to let you ask not just "where" but "where is Bob", "where did Sheila go", "where can I get a decent meal", etc.

    I think NPC gossip is a somewhat unrelated topic — also cool, but relies much more on a knowledge system than on NLP.

    I'm still not sure how to deal with players' inability (or unwillingness) to type, though. I think kids these days, faced with a prompt and blinking cursor, would be like "...What's this? Am I supposed to actually type something?!?" And without either typing or speech recognition (SR), it's real hard to have much of a flexible conversation. I've toyed with ideas where you construct your utterance from a rich branching tree of options (pretty much, word by word), but that also feels like too much work for the player.

    But hey, maybe SR is the way to go. Anybody know of a game that makes good use of that?
     
  13. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    795
    Facade got me when I first played it not knowing what to expect from it
    -- listening to a married couple arguing about their lives looking at their various furnitures and paintings thinking 'when the hell does the game actually even start' ? Only when arguments started to heat finally realising - *this* is the game )
     
  14. Someonelse812

    Someonelse812

    Joined:
    Oct 26, 2014
    Posts:
    9
    Thanks for your responses! They are very enlightening.

    I guess I should have specified; I meant that the conversations would be text based, with the player typing things on the keyboard. It would be possible to have voice recognition, but then you have to talk out loud and I know that when I play games I'm very often keeping the sound down because I don't live alone. So when I feel the urge to yell at the screen I keep my voice down and I would not be comfortable with speaking my conversations out loud, especially since there will likely be things said in character that might sound very bad when heard out of context by someone down the hall.

    @ Joe: I can't afford to pay much, but I would love to have a chat bot in the RPG I'm working on, but I wouldn't need your help for a while. Right now I'm still learning unity. I have a story completely written with tons of branching options and at least 4 different endings, along with tons of side quests and some ideas for a class system (which I expect will change when I get into actually programming all those classes and abilities). Right now I'm still learning unity. Eventually I'm going to put together a proof of concept and make it as good as I can by myself using assets from the asset store. Then I'm going to start a kickstarter to fund the rest of the project and hire some real artists and programmers to pull off the things I can't do by myself. And, if my proof of concept is good enough and fun to play, I'll probably put it out for free, maybe with some ads to help fund the project.

    My idea is that there are side quests that are not assigned to any one specific NPC, more just assigned to an area with some random variable that determines if any given NPC has knowledge about it, what knowledge and whether they care enough about it to seek the PC's help. It might just be that an NPC mentions a dungeon full of monsters up in the hills and the PC is on their own to explore and find it, or maybe that NPC wants the PC to go to the dungeon for some reason, if so they would tell the PC about it and how to find it (maybe even pin it on the world map).

    In regards to players being curt with the system, I can't disagree with anything that was said. But IMHO that doesn't really matter. This is a role playing element that comes with some necessity (getting side quests). Players who have no interest in serious role playing will learn a short hand for dealing with NPCs, and that's fine if that's how they want to play the game. When I play a game I role play, even if it isn't an RPG or it's an RPG with a limited scope. I imagine a whole back story and side plot and my actions in the game are based on my own internal fantasy. A player like me, obsessed with role playing, would enjoy this. Because you never know what NPC might have a quest, so you have to talk to a lot of them. You can't even get tips online, like go talk to that guy and get the quest. It would be like, talk to everyone in this area and there is a 70% chance you will get access to the quest, then, if the NPC has the potential to give the quest, you have to get them to actually give it to you (if you're playing an obviously evil character (necromancer or black knight or something) some poor goodly peasant isn't going to even ask you to save their puppy, especially if you're rude to them, but if you seem kind and heroic they will ask for your help).

    @ 3agle: in that case the NPC might not know about mutilation pass and if they do they will have certain information about it, in which case the PC can get them to share what they know, which could be easy or difficult depending on who the PC and the NPC are in relation to each other.

    In addition to quest information there would be tons of irrelevant information about the game world. Think of the Elder Scrolls games (I've only played Oblivion and Skyrim FYI), they are full of books, some of which give some kind of benefit, but most of them are just flavor text you can completely ignore them with no consequence, or you can read it if you like (I've spent hours reading those books and I don't feel like I've even read half of them). It's the same kind of thing with the NPCs, they can share information or even tell stories. I also like the idea of randomly generating NPCs, having a bunch of elements (physical attributes, race, class, skills, personalities, etc) that can be put together at random to create unique characters with personalities that get an emotional response out of a player (assuming they're a role player and not a roll player, to borrow a phrase from Dungeons & Dragons). Then, each instantiation of the game will have different NPCs giving quests and no two games will ever be the same (beyond the main story line, which itself has a lot of options).
    Furthermore, you could use this same method to create random dungeon crawls and other quest. Just have a ton of quest elements that can be put together at random. No two games will ever be the same.
    Of course, I'm only talking about doing this for side quests, not the main story line.
     
  15. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,823
    I think, reading deeper into your question, you're talking about a very important story topic: immersing the player, through 'selling' that the game world reacts to them.

    The great games of history have either feigned this extremely well (Chrono Trigger) or have actually allowed for this (Chrono Trigger, Radiant Historia.) They didn't do this by any attempt to have NPCs mimic human intelligence, but instead by creating compelling decisions; whether those decisions were true decisions or not is immaterial.

    I recommend reading this dissection of Chrono Trigger to see what I mean, as well as to get some good tips on NPC sociology. Thanks to my recent storytelling failures in The Hero's Journey, I've been reading up on how to write better stories and NPCs, and this was of profound value to me.
     
    Gigiwoo likes this.
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,614
    For your RPG, is chatbot-style dialogue generation perhaps better suited to non-interactive barks and/or for generating the content of menu-based conversation trees? This way it gets to shine as a method of portraying compelling decisions (as @Asvarduil writes), rather than a technical feat of natural language processing.

    Shroud of the Avatar is attempting to bring back freeform text conversations, and after several iterations it looks like they're falling back to keyword recognition. Even so, testers are still having difficulty guessing the right keywords, and also resorting to "where bob" keyword patterns out of convenience, which breaks immersion. The fault might simply be in implementation, but they have some smart folks working on it.

    Is this an intractable problem? Façade did better, but if I recall correctly even the authors themselves suggested that their approach, while groundbreaking in its domain, isn't scaleable to something with the complexity of a typical RPG. (If you do want to incorporate some of their techniques, though, AIGameDev had a good article.)
     
    Gigiwoo likes this.
  17. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,823
    First, Natural Language Processing is hard. There's a reason that Microsoft has taken great pains and a huge budget to develop Cortana for Windows Phone, ditto for Siri on Apple. There's reasons that Rosetta Stone costs ~$500 USD. NLP is not a trivial, fast, or easy problem to solve, and some of the world's brightest minds are working on it - in research contexts, not even much that's terribly concrete, let alone a time- and budget-sensitive context like a video game.

    Final Fantasy II for the NES had a cool system of doing things - you could learn keywords (remember, you were constrained to an NES controller), and could use Key Items in conversations. Given that, in a way, conversations are one of the major pillars of an RPG, it makes sense that you'd want to have good writing and compelling game systems for whittling useful information and/or loot and shortcuts out of NPCs. Even though FFII didn't take it as far as they could, the first couple of hours of the game had really cool uses of the keyword/key item system. If they'd found small-scale ways to help players reason out the usages, or better skill provide minor uses to get minor rewards, that would've been all the better.
     
  18. dialobot

    dialobot

    Joined:
    Feb 19, 2015
    Posts:
    1
    I think that the possibilities about NLP and chatbot in games are endless. In games we have more less the same language interaction of the '80s-'90s games. Just Façade tried something new but it was an Academic POC and not a real game.
    Of course NLP is hard for not-specialized guys, but for people like @joe and me is a years passion and job! (Ask me to create a 3D model or an artistic landscape and I will tell you that is a impossible task ;-)
    I think that we have to start to consider this new figure in the gamedev team. A position with writing skills and NLP knowledge and tricks.

    I made a Italian NLP toys POC (like IBM's new Watson Smart Toy) and it works fine with kids. I made a lot of apps and web sites that gives informations to thousand of users.
    Why can't this approach be used in game?

    The dialoguing part of the game has to be designed properly as other parts of the game: for example you can start with a not-human character (a magic door, an animal, an elf). In this way the player does not expect to have a perfectly intelligent and fluent NPC. Or you can create a game that does not require a human-deep dialogue on a huge number of topics (i.e. ghosts, toys for kids, parts of 3D or interactive books).
    A real important point is the methodological approach: if you want to create a game with a "near perfect" first release it would be very costly.
    But if you can manage a bottom-up, multiple cycle testing, Wizard of Oz approach then it is possible to reach very quickly a good NLP-AI. I created 2 years ago a company ( see Intoote ) that uses this approach in building NLP bots (with also new algorithms to manage the quick prototyping and developing) and it works fine for not-games applications.

    I think that you can not create a professional NLP system inside Unity. But it is possible to use API (of course your player has to be online). I'm really interested in testing NLP in games and books: please contact me if you want more information or if you have a game with dialoguing NPC in mind.
     
    Last edited: Feb 19, 2015
    JoeStrout likes this.