Game Development Community

NPC's you can chat with

by Nathaniel Gibson · in General Discussion · 10/02/2004 (10:09 am) · 13 replies

What if you could chat with NPC's in your games (RPG Games for example)? What if they could learn from what you said? What if they could actually perform actions based on those interactions you had with it. All interfaced through a chatbox in the game. And the best part is... each NPC now has it's own personality. They would also be able to talk to eachother and spread communication throughout the game environment.

The above may seem far reaching, but I have a program that I made back in 1999 called ROLAND which can do all of the things mentioned above if properly implemented into a video game. The algorithms are fast, and I'm always working on new ones. I could make one completely tailored to a game as well.... I'd be willing to get on a team for that too. I have C++ skills. ROLAND was written in QB at first and I ported to PHP a couple of months ago. Go to http://www.mye-business.com/roland/roland_online to check it out. All you have to do is register for free. This gives you an identity. The cool thing is that you can create your own identities in the onine version now... Anyway, it's food for thought.

~TaxDAY

About the author

Recent Threads

  • NPC's for RPG's

  • #1
    10/02/2004 (11:02 am)
    Have you seen the 2 NPC dialog editors in the resources?
    #2
    10/02/2004 (11:22 am)
    Nathaniel, you mean chatting, like typing out words and chatting.... not selecting dialogue from a dialogue tree?

    That reminds me of the old text-only adventure games... where you type "open door", or "read sign". Kinda like that right?

    Could you give some examples of how you would use this in a game?
    #3
    10/02/2004 (2:06 pm)
    For instance... In a game like Fable (for the XBox), you can interact with anyone, and there are a set number of personalities and things that these people will say to you. Now, if you were able to have a conversation with a NPC in the game like a chat interface, this would definitely deepen the complexity of the game. If the characters could also hold conversations with other characters and had a world-object based relationship...

    Check out ROLAND and see what I mean. The way that the NPC's would learn would be a little more involved though seeing as it's not only a text based interface they have with the world (like ROLAND). NPC's can interact with and observe objects in their world, so it would be a more realistic model than the text only version.
    #4
    10/02/2004 (2:07 pm)
    I'm talking about a fully 3d RPG
    #5
    10/02/2004 (3:06 pm)
    So basically, it's an extension of artificial intelligence...


    I'm not sure, though, how it is better than having a point and click menu. Like, if I wanted to talk about an object, I would click on that object in my inventory, for example... and that character would start talking about it. Also, dialogue trees keep the players on track with a quest or story and give hints as to what to do... if you have a completely open ended chat system, where you could say anything, it would be cool, but players might not know what to say or do.
    #6
    10/02/2004 (4:11 pm)
    Hey Nathaniel,

    Cool stuff. Producing AI that can competently understand natural language is the most highly sought after goal in both traditional AI research, and in game AI. In fact, Alan Turing, who is mostly regarded as the founder of modern computer science, proposed a test for when we'd actually be able to tell if we'd created true artificial intelligence. I'm sure you've heard of it already, but if not, wikipedia has some good info. The Turning Test isn't really a good test of artificial intelligence in general, but it'd certainly be a good test of natural-language processing AI.

    Roland is pretty cool, but I don't know if this kind of AI would be very useful in a game, at this point. Back in the mid-1960's, there was a chat bot called Eliza. Eliza has inspired many, many chatbots, some of which are pretty impressive, some less so. None of them though, come anywhere close to passing the Turing Test at this point.

    The most impressive chatbot I know of is one called A.L.I.C.E. You may have heard of that project too, it's pretty well-known. Alice is open-source, so anybody interested can check out how they make "her" work.

    In my opinion, none of the currently known bots are anywhere close to ready for use in a game as human-like characters. I'm sure though that some game design could be made to work around the concept of chatting with such a bot, which might be interesting.
    #7
    10/02/2004 (6:35 pm)
    I basically agree with what Josh said.

    @Nathaniel:
    I have my own similar chatbot program at www.fletchergames.com. It's set up like a Q&A site instead of using a standard chatbot setup, but it's the same sort of thing. The big difference is that the user only makes one input instead of having a whole conversation. It is a simple matter to alter the code to allow a conversation mode, but I like it better this way. When the knowledge base is larger, I'll have both options available.

    Anyways, the reason I'm typing this is to determine whether we can collaborate in some way. I want to make chatbots, but I don't want to spend ALL my time working just on chatbots.

    Unfortunately, putting new information in the knowledge base takes forever. If we work together:

    a) we could get the same amount of work done with each of us only doing half as much as we would have to do alone
    b) we could share ideas
    c) and we would probably come up with some things we would never have thought of otherwise

    There are plenty of issues with Bot Asylum that I would like to fix but don't know how. You probably have similar issues with Roland. Perhaps, we've already solved some of eachother's problems.

    My chatbot program is a Java applet. All it does is run inputs through a FSM to find the output. There's some little tricks to make this work better, but there is no learning algorithm. The knowledge base is updated through a program I wrote (called Botmaker).

    All the source code is on the website.

    Although we're using different programming languages, we may still be able to help eachother out alot. Perhaps we could develop a file format that works for both our programs and then combine our knowledge bases (or parts of them).

    Right now, I'm making a change (which I'll probably complete tomorrow) that will alter how inputs are set up in Botmaker - so the data file will look a little different after I update this. I have name/variable "switch" statements that I plan to move into the FSM. Currently, this is processed in data that should be dedicated entirely to the output.

    This isn't particularly vital, but I think it's better organized this way.

    I plan to add a sort of "Mad Libs" response function to Bot Asylum before too much longer. I'm also thinking about using a neural net instead of an FSM, but I'll have to buy a book about neural nets first (I'll probably buy the book by the end of the month, but I don't know how long it will take me to figure out neural nets). My AI book has a chapter about them, but that's not enough to get to work on it.

    At the same time, I'm working on a Java Game Programming Tutorial. As I move forward, I plan to work on my own more complicated games using some of the code from the tutorial.

    I've made games before, but most of them are either unfinished, unfun, or both.

    So you can see why I want to enlist help.

    By the way, why do you have the login for your chatbot? It doesn't seem to add anything, but it does give the user one more thing to do before getting to your chatbot. The login should be optional because some people might not bother to look at your chatbot if it takes the extra effort.
    #8
    10/03/2004 (12:11 am)
    The login is simply for the purpose of the bot knowing people's names. At a user level, the site is very simple. Each level has more controls over how the bot functions. Now, another thing that's cool. The bots can store conversation from a specific user and when the system is finding an appropriate reply, it values the entries in it's memory that the user has had with it more than entries from another user for instance. So, the logins are used to allow the chat bot to be a little more personalized. Plus, there are levels at which each user has access to ROLAND's functionalities and how much of a lasting impact that user has on the DB is determined by this level.

    I think we could definitely get together on something like that. I'm going the opposite way from Neural Nets with my bot. I agree that Neural Nets with AI would produce more realisitic results than the code currently in use by the ROLAND system.

    I'm not sure if you get the world of the AI I'm talking about. It's more based on ontology and sociology than neurology. Neurology has it's greatness, but it's not sufficient for creating systems that can "be" like humans have access to. We gain our access to being through conversation and language. Thus the concept behind roland is for the program to learn and grow from conversation.

    Now, there are also two different worlds of learning. See, right now... the only interface the ROLAND system has to the outside world is text based chat. Us as human beings have many interfaces to the world. Our eyes, nose, mouth, ears, and our entire body. This allows us to build a contextual reference. Now there is no doubt that context comes into play when a human being is learning. This context gives us a background to each of the things we learn. So actually, in a video game or an interactive 3d environment is the best place to teach a computer program that enlivens an NPC. For instance, if you are a hero in the game, the NPC would relate to you as that and have a whole world of information to convey to you about the world it lives in. Each conversation you would have with it would be inside of the context that the NPC relates to you in. The NPC will have observations and opinions about all of the objects in the world including you. Case Example:

    Now, let's say it was in a game like Fable for the XBox (I love that game). In which there is a distinct story line that the player can chose to follow at any time. Sure, you could sit there and talk to one of these NPC's for awhile and just make small talk, or you could ask it the pertinent questions to your quest. Now, since the NPC's will be talking to eachother at all times, they will share information indefinitely. Each NPC would have it's own knowledge it gained through conversation and experience. So let's say that you just took on a mission to go kill a werewolf. Once you accept the mission, there's someone watching you and they hear your conversation. Now, if you're a renowned hero, news of you will travel quickly naturally because of the nature of conversation. So if you went on your quest, the people who were told already would know, and if you talked to them, they might bring it up. Let's say you do go up to somebody who knows you're taking the quest. The first thing the NPC might mention is your newly acquired mission and depending on it's relationship to you, it could compliment you or tell you you're going to die. You would have the option to sit and talk to it some more about other things, ask it if it knows anything about werewolves, or ask if it's married.

    This kind of paints a picture of what I'm talking about. I'm actually working on a project that will create this level of intelligence with computer programs.

    The question that arises in what I said previously is how would the NPC's learn... how would their culture be created, their history, so on.... Well, that's for me to know and all of you to find out later.

    ~Tax
    #9
    10/03/2004 (10:29 am)
    You could still have the login be optional. There could be a guest login name that the program defaults to when there's no login. You could then have some sort of banner that says something like "Create a login name to get better replies".

    It sounds like our chatbots are almost opposites. The Bot Asylum chatbot knows nothing. It just maps inputs to outputs. It's not a new idea.

    What I would like best is to trade programming and algorithmic ideas (and maybe even some tidbits of source code) in order to make both our projects better. Possibilities here might be limited because our chatbots use very different approaches. And it sounds like you don't want to reveal any of the internal details of your system. That makes sense if you're trying to make money from your project, but it may make collaboration difficult.

    Since Bot Asylum is completely open to everyone, you're in a better position than I am to determine whether some sort of collaboration is possible.

    We may be able to help eachother out in some non-programmerish fashion. For instance, I use something called "categories" that essentially list is-a relationships. They have no relation to Alicebot's categories. They aren't anything special, but they have alot of potential power. I'm making the data free to everyone and trying to put it in an easily usable format, which no one else seems to have done. I'm one of those whackos who thinks that data should always be easily available.

    Categories
    *********
    Some examples of categories:
    @a=a,an,the
    @animalSingular=animal,@mammalSingular,@reptileSingular
    @whoIsHere=@whoIs here

    There are similar categories defined in Botmaker (though they're not the same - I merely paraphrased).

    a, an, and the are all essentially the same, so the @a category was created to make them effectively the same word.

    @animalSingular is meant to contain all the different words for one animal of ANY species. Since mammals are all animals, all the mammals are included by including it as a subcategory.

    Bot Asylum is smart enough to understand that "dog" is different from "brontasaurus" even though both would be animals.

    I only included @whoIsHere so that I could mention that Botmaker's categories allow phrases, not just words. And each phrase can have categories as a part of the phrase.

    I think this could be useful to both of us. This is a common technique. Relation databases are created to store huge amounts of this sort of data, and then uses can ask questions about the data and actually get a reply.

    I don't think this is in conflict with what you're doing. Having a huge database like this would help to give the chatbot a context to work with. It's by no means a cureall, but it would be useful.

    Some important points about categories are:
    a) They allow you define responses to a whole class of inputs with one of line of text (assuming that responses work that way)
    b) Creating them is easy but time-consuming
    c) Creating them is incredibly boring

    If you are interested in using something like this, we could help eachother out alot. We could each do a couple hours worth of categories a week (I suppose each of use would work on some particular subject) and send them to eachother. This would double the speed of category creation.

    Of course, that assumes that you are interested in using categories.

    Your Plan For A Game
    *****************
    What you're working is well beyond my capabilities and sounds like it would take a lifetime to complete if it's even possible with the current state of the art. But you seem to already have some plan in mind for the AI.

    It would be great to have though. I have an idea written down somewhere for an RPG using a genetic algorithm that shared many features with your idea. However, I know that I lack the capability to make such a game well. If you're prepared to work on such a game, you're well ahead of me.
    #10
    10/03/2004 (10:59 am)
    I don't think you need a large AI system for this. You just need a parser like what the very first most basic Scott Adams adventure games used. You face a bot and say "Go to the house". The parser see's 'Go' and "House' and there's some logic that determines that the bot do a container radius search for houses, and go to the nearest one. Even on the most basic level, this would be cool. I use Scott Adams adventures as an example but games like Zork used the same thing. They've been around for a long time. It makes me want to jump on the bandwagon. It's a good idea.
    #11
    10/03/2004 (6:03 pm)
    From what he said, he sounded like he's planning something much more elaborate.

    Starship Titanic contains chatbots, but he wants them to actually be aware of a dynamic world.

    The "normal" thing to do would be to script all the different responses for all the NPCs in the game. This would take forever for any large game. But he has some learning algorithm that I assume is supposed to do most of the work for him.
    #12
    10/03/2004 (9:40 pm)
    It works through teaching one that teaches many. :) I am a wacko for free data too... The specific algorithm I was talking about though is not solely my idea. I have a partner who owns a company that will be using these algorithms in chips... etc. That's why I can't really say much about it.

    The way that all of the bots would learn though is through parenting... see, it's not less work, just different work... Instead of scripting, I have to teach one of them enough to function in the world and then it's a matter of using that learning structure to pass on to the rest of the bots... so all of them would start off at roughly the same intelligence and knowledge level. They would then be able to learn from their individually. The coolest dynamic of the game will be that the NPC's can parent children, raise them, and teach them about the world they were "born" into. Now... What kind of RPG is this? Well, It's really not an RPG. It would be more something like a simulation game with heavy RPG elements. The coolest thing is that the bots will be able to create new things as creation exists in conversation. It's a massive network of conversations just like in our reality. On one level that's all we really are is a compilation of the conversations that run our lives. So given that, making something that can learn like human beings is easy given the right environment. And ofcourse, you can see the implementations that this sort of technology would have in areas besides video games.

    Anyway, enough talk, I'm going to bed. Thanks for the conversation, I appreciate it.

    ~TaxDAY
    #13
    10/05/2004 (12:19 pm)
    LifeLink AI is integrating natural language parsing so that NPCs can communicate with players intelligently. It has been in development for a few years and will be released within a year.

    www.lifelinkai.com