Basic Game AI
This is al hypothetical so please don't bash me for think about something like a (oh no!) mmorpg.
Say I wanted to make a basic game AI that would act like a real person in an mmorpg
and it would talk, train at good spots witt not very many people, and other things like determining "good stats" for itself and pretty much making its own character. What should I look into for something like this.
Depends on how good you want it too look. Theres a tradoff in it.
The more realistic it is, the more processing power (and memory) it consumes.
You should look into A* for pathfinding.
LATA* For learning pathfinding (when you don't have the full map)
You decide what to do, using a utility function, as well as finding out how often something occures.
So, for eg. Increasing your mana one level might have the utility of +24, but which fill fail 100% of the time, because something will happen.
But if increasing your hp by 1, might have a utility of +2, but if it will suceed 100% of the time, you do that.
You could also explore bayens logic. Because once you've got enough logic, you can get it to do things like the previous eg, very well. (evaluating how good each action is, based on what it knows)
From,
Nice coder
The more realistic it is, the more processing power (and memory) it consumes.
You should look into A* for pathfinding.
LATA* For learning pathfinding (when you don't have the full map)
You decide what to do, using a utility function, as well as finding out how often something occures.
So, for eg. Increasing your mana one level might have the utility of +24, but which fill fail 100% of the time, because something will happen.
But if increasing your hp by 1, might have a utility of +2, but if it will suceed 100% of the time, you do that.
You could also explore bayens logic. Because once you've got enough logic, you can get it to do things like the previous eg, very well. (evaluating how good each action is, based on what it knows)
From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
A bot or NPC that is indistinguishable from a human player is something that, if even possible, is still a long way away. In fact, Alan Turing proposed a famous test for AI that claimed an artificial agent would be truly intelligent only if a human would not be able to accurately infer that it was artificial. This test has never been passed.
Therefore, you would at least have to make some compromises on your goal. One challenge you would face in an mmorpg is the wide range of activities a human could perform. Some people play to socialize, some play to slash and hack, while others enjoy playing around with the economic system. Overall, most human players would likely exhibit a wide range of behaviors while playing in an mmorpg.
In order to look non-artificial, an agent would have to find some way to cycle through these various behaviors. Otherwise, interacting with that agent would become boring and predictable. One thing you could look into is a desire based state machine for deciding what types of behaviors to exhibit. When an agent is performing a task, his desire to perform that task will decrease at some predetermined rate (linear, quadratic, exponential, whatever you decide works best). When not performing a task, the agent's desire to perform that task will increase. To really mix things up, you can give different activities different growth or decay functions. The agent would change behaviors any time another behavior's desire level was larger than his current behavior's desire level by a certain amount.
This would solve the problem of making the agent's behavior selection look natural, but once the behavior is selected, the agent needs to perform that behavior in a natural manner. For this purpose, I would suggest looking into reinforcement learning or developmental robotics. These are heavy topics, and typically don't make it into games because most studios don't have the resources to invest on these research areas when a simple state-machine could have done the trick, but if you really want the satisfaction of doing it right, these are very active research fields and many of the techniques are not computationally expensive (but do require massive amounts of training time or offline computation to even get to a rudimentary level of quality).
The most difficult part of the problem would be speech. There are simple programs out there that mimic human conversation (look up eliza bot for reference), but these are usually easy to spot as artificial and easy to trick. For example, try telling the eliza bot that "necessity is the mother of invention." It will respond by asking you about your family because it cued on the word mother.
Finally, in addition to pathfinding with A*, you should have some other pathfinding algorithms as well. Not all travel in an mmorpg is about "get me form point A to point B." Sometimes it's about "follow the quest leader" or just simply "roam until you find something interesting."
Therefore, you would at least have to make some compromises on your goal. One challenge you would face in an mmorpg is the wide range of activities a human could perform. Some people play to socialize, some play to slash and hack, while others enjoy playing around with the economic system. Overall, most human players would likely exhibit a wide range of behaviors while playing in an mmorpg.
In order to look non-artificial, an agent would have to find some way to cycle through these various behaviors. Otherwise, interacting with that agent would become boring and predictable. One thing you could look into is a desire based state machine for deciding what types of behaviors to exhibit. When an agent is performing a task, his desire to perform that task will decrease at some predetermined rate (linear, quadratic, exponential, whatever you decide works best). When not performing a task, the agent's desire to perform that task will increase. To really mix things up, you can give different activities different growth or decay functions. The agent would change behaviors any time another behavior's desire level was larger than his current behavior's desire level by a certain amount.
This would solve the problem of making the agent's behavior selection look natural, but once the behavior is selected, the agent needs to perform that behavior in a natural manner. For this purpose, I would suggest looking into reinforcement learning or developmental robotics. These are heavy topics, and typically don't make it into games because most studios don't have the resources to invest on these research areas when a simple state-machine could have done the trick, but if you really want the satisfaction of doing it right, these are very active research fields and many of the techniques are not computationally expensive (but do require massive amounts of training time or offline computation to even get to a rudimentary level of quality).
The most difficult part of the problem would be speech. There are simple programs out there that mimic human conversation (look up eliza bot for reference), but these are usually easy to spot as artificial and easy to trick. For example, try telling the eliza bot that "necessity is the mother of invention." It will respond by asking you about your family because it cued on the word mother.
Finally, in addition to pathfinding with A*, you should have some other pathfinding algorithms as well. Not all travel in an mmorpg is about "get me form point A to point B." Sometimes it's about "follow the quest leader" or just simply "roam until you find something interesting."
You should look into finite state machines. Those would work.
Also chatbots. When you up to it, ask about it here in the forums, theres a lot of know-how in these forums on how to make them.
Now, for an exploritory be
Of things that move, what you could have, ihaviour, what you should try and do, is make up an internal map, of everything that doesn't move.
s a zone where the thing could be. (based on max speed). When that gets as big as the map, you remove it.
This lets you, say find someone your looking for. (find spots where they were found before, look at where they might be...) It'll also let you find somethin deposit when you want to. (ie. you need an item right away, like a potion or something).
From,
Nice coder
Also chatbots. When you up to it, ask about it here in the forums, theres a lot of know-how in these forums on how to make them.
Now, for an exploritory be
Of things that move, what you could have, ihaviour, what you should try and do, is make up an internal map, of everything that doesn't move.
s a zone where the thing could be. (based on max speed). When that gets as big as the map, you remove it.
This lets you, say find someone your looking for. (find spots where they were found before, look at where they might be...) It'll also let you find somethin deposit when you want to. (ie. you need an item right away, like a potion or something).
From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Is there any way to incorporate a chat bot into a java program and is java even a logical choice for AI programming. If it is not and another lanugae is better is there any way I could write it in the other language and incorparate it into a java prog. To sum it up " This helps a ton but I need a way to do it or incorp. it into java" Thx guys
oh java. [sad]
ok, it would be Possible (it won't blow up), but its certenly not the best tool for the job (you can make a nice little chatbot in lisp in 30 seconds flat. VB would take 2-3 minutes...).
You could probably make one of the simpler ones. (maybe, but really lisps list handling abilities make it second-to-none on things like this), but i wouldn't try to push your luck.
From,
Nice coder.
ok, it would be Possible (it won't blow up), but its certenly not the best tool for the job (you can make a nice little chatbot in lisp in 30 seconds flat. VB would take 2-3 minutes...).
You could probably make one of the simpler ones. (maybe, but really lisps list handling abilities make it second-to-none on things like this), but i wouldn't try to push your luck.
From,
Nice coder.
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Can I implement LISP into java then or do I have to do it in java. And how hard is LISP to learn?
Quote: Original post by Tallshortkid
Can I implement LISP into java then or do I have to do it in java. And how hard is LISP to learn?
If you've never used a functional language before, learning any functional language will be a formidable challenge, but very much worth the effort in the long run. There have been several times where I have been writing something in C++ that relies heavily on recursion and had an "enlightening moment" where I thought "wow, this would've been so much easier in LISP."
I'd recommend going to www.schemers.org for getting started with functional programming. Scheme is a dialect of LISP.
January 12, 2005 08:45 PM
What do you mean by implement LISP into Java? There are LISP interpreters written in Java if that's what you mean. I would say LISP is not that hard to learn unless it is your first functional programming language, in which case it might take a little while to wrap your head around. You might also look into Scheme, which is pretty much the same but to me slightly simpler.
I would agree that LISP or a LISP like language is probably preferable for writing a pattern matching kind of chat bot. There are a lot of classic chatbots like ELIZA and PARRY, that have been rewritten many times over in LISP and LISP variants.
However, it's definately still possible to write a chatbot in Java. I found this ELIZA implementation in Java for example: http://chayden.net/eliza/Eliza.shtml I would also say that although this Java implementation is a bit longer (as far as lines of code) than the standard LISP implementations, it's also a bit easier to read (for me at least).
I would agree that LISP or a LISP like language is probably preferable for writing a pattern matching kind of chat bot. There are a lot of classic chatbots like ELIZA and PARRY, that have been rewritten many times over in LISP and LISP variants.
However, it's definately still possible to write a chatbot in Java. I found this ELIZA implementation in Java for example: http://chayden.net/eliza/Eliza.shtml I would also say that although this Java implementation is a bit longer (as far as lines of code) than the standard LISP implementations, it's also a bit easier to read (for me at least).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement