python with bge

Show me some examples of rephrased questions?I think picking keywords could make it look like it understands.I think I will try to do it with logic bricks.The copy property actuator and message sensors.And also the state actuator.

You could always do like others have said and just scan entered strings for a manageable (read small) set of keywords:


if 'buy' in playerSentence and 'sword' in playerSentence:# run the buying sword code

As others have pointed out, everything you can do in python you can do in the BGE, and the great thing about python is that 9 out of 10 times somebody has already done what you’re doing and written a module for it. So another solution might be to use a python chatterbot like this one. Then you can train it to respond in a tone that works with your game world and link qustions/responses up to actions by searching strings for appropriate keywords.

Each human has some words that they do not understand.Humans seem specialized for the areas they live in and been to.If they learned the language well.It is unfair to expect a computer to understand every word.

Is the pip package already installed in python3.4?

I do not see a problem at all. I do not know if you are old enough … Laisure Suit Larry I, Space Quest I and other Adventure Games used textual input. The understandable word set was quite limited, nevertheless it worked. Btw. It was damn hard for English beginners.

[Even before that there were (and before my time) there were pure textual RPC games. I cant tell how powerfull their language was.]

Finally this is a pretty hard and slow way to contol a game. Therefore the input evolved from pure text input over “select your words” to pure point and click, which in my opinion is a great way to deal with context sensitive input on a computer screen.

I suggest you review your idea. “Feeling natural” is a little bit strange in the context of a computer game. I mean you touch a keyboard and look at a screen ;). As with each and every computer game, what is the goal of the game? What do you want to present?

I want to make a advanced artificial intelligence in a videogame world.Battery is that the full code or is it missing something?

I do not know what you mean with “Battery”.

Regarding AI … this is a scientific topic with several different goals (path-finding, self-organisation, object recognition etc). If you look at it from a game’s perspective usually the NPC behavior is meant.

@Monster, I think he’s referring to me with regards to the chatbot link I posted.

I suggested using a chatbot since there are loads of python implementations out there and many of them handle parsing text and generating appropriate responses. If you’re not sure how to google install with pips then I think you’re going to have a hard time creating an advanced AI.

Equally, I can’t tell you if the chatbot modules you’re looking at have all the functions you want or not. You’d have to look through the modules code/api and decide for yourself if they meet your needs. No matter how complete they are you’re going to have to write your own code to get them working in the BGE.

As Monster said, computer AI is a very complex subject. Most games just fudge it to give the appearance of smart NPCs.

It say’s that pip is already installed in python3.4 and i have it.So i have to just type pip install chatterbot in blenders text editor to get itready to go.If i am understanding correctly?

No, that’s a console command. You need to type “pip install chatterbot” in you system’s console. And that assumes that you’ve got your system variables set to recognise the word ‘pip’

How would I do that?

I’d suggest googling it, as it very much depends on your set up and searching for the specifics should help you figure out what you want to do.