#### Archived

This topic is now archived and is closed to further replies.

# natural language with NPCs

This topic is 5829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi folks! Please do not answer this post to tell me this can't be done. That's exactly what they said about faster-than-light travel I am a student of Cognitive Science, with an emphasis on linguistics. I'm looking at ways to incorporate natural language processing in games. I can't see any reason you can't type in English and communicate with the NPC's. The best I've found (Google) are some experiments from the 80's that yield more or less the following:
You are walking through the forest, vision in any direction
is blocked by the trees, except for the bright blue sky which
is clearly visible above.
>continue walking
I don't know the word 'continue'.
I don't know the word 'walking'.
I don't quite understand you.

Assuming I can do better, how would this factor intelligently into the design of my game? I would like to write some kind of (offline) game where you need to convince the characters to help you, and instruct them about your mission. The challenge, then, is not to complete the mission really but to talk the locals (I'm giving away some of my intended storyline here, but that's ok) into helping you. Ideas and comments, general or specific, are wanted. Ideas such as: - They are too afraid, busy, or religiously uninclined to help you - They don't speak your language - They have a very simplistic grammar Thanks for reading. Tom [edited by - ParadigmShift on December 4, 2002 12:04:35 AM]

##### Share on other sites
I''ts not impossible dude. We might not be able to do it yet but sure as hell it''s not impossible. The way I see it is that there''s two ways to do what you want to do
1. Accept pre generated phrases that must be perfect or if you want add a little checkig in
problem. Speach isn''t natural. It''s all pregenerated. This is the style used in REALLY REALLY old games.
2. Scan for key words and build up a grammatical structure of a sentence and then attempt to disern the perpuse of parts of it as well as how it is in context with previous or later parts of the mono-logue.
I''m no expert in this sort of thing but I reackon it''s possible and the second approach is probably the way to go. My advice is just write some simple little apps and try and do it. If you fail. Who cares. I fail at things all the time, I know there next to impossible when I start, but do I care? No. If you succeed. COOL! You''ll have a not original idea that might work pretty well. And even if you don''t succeed your game will be no worse off than any others because you don''t have it as no other games I see have it either.

##### Share on other sites

If what I was driving at was how to go about processing language, then this post would be off-topic. I think I have the academic resources and programming skill to do this. My point is, what happens to the game design when instead of a side "feature" in an RPG, natural, unscripted communication with characters is a central driving point of the story?

I can imagine how the conversations would work, I just don''t really know how to set up the interactions. Is it realtime (as opposed to turn-based) conversation? Can the characters ignore you? Can they walk up to you and start a conversation? None of this ever happens in games I''ve seen.

If I have enough of these kinds of ideas, I think I *will* have an original game.

Tom

##### Share on other sites
Interesting point. I don''t see why characters shouldn''t come up and talk to you for some reason, preferably NOT preset, although that could be tricky. I think that you would almost HAVE to have the conversation turn based because a. some people are slow typers and b. the computer types instantly. Yeah you can make the computer talk slower but who cares. What would be better is if you used voice translation used a mic and then converted it to text and then ran you speech thingy on it. That would be pretty cool. The only problem I see is managing to keep the conversation in bounds. I mean let''s say you''re suppose to talk to a charachter about something but you just talk about something else or heck I''m rambling about nothing here. But you have some valid questions. probably go with the mic or if not avaible, as in you don''t have speech recognition software, then go for turn based. I think the major hard part will actualy making the NPC''s say something interesting. Like let''s say you started talking about the weather. Sure they might understand the words but will they understand what weather is and how to give you feedback. This would require checking the actuall games weather setup and stuff. You know if you started talking about stuff that''s hapening how are they suppose to actualy now about it. Sure you could put a check in for the weather and that but there are infinite things you could find to talk about. I''m talking about making small talk with NPC''s. Maybe you don''t want to do this but I think that would be exceptionaly cool just being able to rock up to an NPC and start talking to him about his job and that.
Give me your thoughts because I''m interested in this.

##### Share on other sites
I know how you might go about it. In your code you can make a check to see if the user input a bunch of key terms. Like this for example here's a sample of a conversation in ancient times:

NPC: address me by my proper name!

User: what's your name you foolfaceldlfk. Key terms (what, name)

NPC: My name is arid the woodsman.

User: f**k Y*u you a.

NPC: I dont know what you're talking about. Key terms (none)

you get the idea. if what I just said is irrelevant to your subject then forgive me because I havent slept and these damn programming books are boooooooring.

[edited by - wazzoo on December 5, 2002 1:10:40 AM]

##### Share on other sites
Some thoughts on how you could do it: NPCs can walk up to the player and indicate they want to talk; you could show this with an icon or a sound clip or something. However, the player would have to start the conversation each time. Another choice is to actually bring up the conversation interface each time the NPC walks up. But, what if the player is in a hurry? They wouldn''t want to bother with getting out of conversations, although this may be more realistic.

A possible compromise would be an ''ignore'' option. If the player is in a hurry, they just check the box, and it automatically ignores conversations.

The actual conversation engine should be mostly turn-based. You could have it watch for idle time and make the NPC prompt the player.

"Are you paying attention to me?"
"Are you still alive?"
"Earth to stupid person!"

##### Share on other sites
quote:

If what I was driving at was how to go about processing language, then this post would be off-topic. I think I have the academic resources and programming skill to do this. My point is, what happens to the game design when instead of a side "feature" in an RPG, natural, unscripted communication with characters is a central driving point of the story?

quote:

Original post from Wazzoo:
I know how you might go about it. In your code you can make a check to see if the user input a bunch of key terms. Like this for example here''s a sample of a conversation in ancient times:

Get the picture!!!!

quote:

Some thoughts on how you could do it: NPCs can walk up to the player and indicate they want to talk; you could show this with an icon or a sound clip or something. However, the player would have to start the conversation each time. Another choice is to actually bring up the conversation interface each time the NPC walks up. But, what if the player is in a hurry? They wouldn''t want to bother with getting out of conversations, although this may be more realistic.

Some good points there. I personally think that they just start talking to you, as in saying stuff, and then you can choose to talk back or simply keep going. Then they can get pissed and that.

##### Share on other sites
Ramboboner, I''m not quite sure what you mean, if it''s a good thing then I''m not mad, if it''s a bad thing then I''m sorry for tryin'' to help. it''s freakin'' 1 a.m and I''m tired. nice idea paradigm I want you to check out www.GeneticAnomalies.com download ChronX, that game has an incredible AI, They''ve done what you''re currently trying to do. But there''s always room for improvement. Good luck

##### Share on other sites
What I meant was that ParadigmShift had just said that we don''t want to discuss HOW to work out the conversation but more how to use it in games and stuff like that. Basically what you said was good but ParadigmShift had just said that that wasn''t what this topic was suppose to be about

##### Share on other sites
All good ideas.

Wazzoo: Thanks for the link, but as to your previous comment looking for keywords is exactly what I don''t want to do. Simple directive counterexamples: "GET me everything but the SHOVEL" "WALK FORWARD, avoiding the wall" etc.

I like the idea of smalltalk. My idea is to have the NPCs interact with ALL of the world simulation. If there is weather, then they can potentially notice it. Of course, they might not notice (processing constraints) until you actually ask them about it, but that applies to people as well.

1. 1
Rutin
71
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633428
• Total Posts
3011822
• ### Who's Online (See full list)

There are no registered users currently online

×