|
2 registered members (3run, AndrewAMD),
667
guests, and 1
spider. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Genetic Algorithms and Games
[Re: EpsiloN]
#115162
12/05/07 21:12
12/05/07 21:12
|
Joined: Jul 2004
Posts: 1,205 Greece
LarryLaffer
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,205
Greece
|
Quote:
While GA's always pick the 'fittest' , without accounting for this random factor that the best might 'die' or something else happens to his reproductional organ for example...
there's an image 
GAs don't always pick the fittest. There's a bunch of Selection algorithms available, like Roulette Wheel, Tournament, Rank Based , Truncation, Local Mating, The ECO Method and a whole lot. There's always a random factor in the Selection algorithm. Here's a pic from my prof's slides.

Quote:
As for the NNs , you may be right , but after I carefully studied what exactly the backprop did , and what exactly is a 'self organising network' I started to get dissapointed in the implementation of the concept of NNs. They narrowed it to a simple function that decreased or increased a value over time. (Like accelerate() for example ) Wich is limiting , IMHO , because it isnt really learning
Backpropagation isn't used for learning. Use a GA to train your ANN if you want Neural Networks that learn.
Quote:
Are you working on something related to all that? Maby a new AI ? I'd like to hear of some implementations into C-Script , because there arent many examples to 'learn' from.
I've made this, but nothing bigger yet. Once I release IntenseX, i plan on adding some learning functionality to its AI for later versions.
|
|
|
Re: Genetic Algorithms and Games
[Re: LarryLaffer]
#115163
12/06/07 13:55
12/06/07 13:55
|
Joined: Jan 2003
Posts: 4,305
Damocles
Expert
|
Expert
Joined: Jan 2003
Posts: 4,305
|
AI is mainly about searching for a sollution / a plan or action to reach a goal in the face of obstacles.
The mentioned methods of NN and GA provide the means to search for reaction patterns and adapt them generally to many situations. The power of NN is to generalize input-data, and get trained to give an (on average well working) output-reaction. The GA, when determinng the NN (connections and weights), can automatically search for a well defined net. You can combine GA and a backpropagation learning to make the whole process more efficent. (the GA looks for a good initial connection and weighting of the neurons, the backprop specifies it more accurately given the teaching-data)
But in the end, you will not be shure to have a "smart" creature, only a very good adapted creature.
The Finit State-Machine is a way to simplify the tasks, the creature has to solve. (The world is simplified to inputdata, and actions - defined by switching states) The transition between the states are determined between the logic (NN for example). But the actions the creature can do, can be defined by the states. (like in an RTS, where the single units are run by state-machines, but the AI planner by a more complex method)
-> but when running the actual simulation, the NN and even less the GA can not learn and adapt. This would blow the computation-requirements. They are defined in the pre-phase, before the simulation.
NN and GA in nature dont have the "purpose" to make "smart" creatures, but well adapted creatures, giving their environment. Creatures that do have a "smart" problem solving use neural nets (a dog for example), that have billions of connections. Those nets are far beoynd our reach, and I doupt that you can make a smart creature with just a few hundred Neurons. Else evolution would have not required the brains to become so big. (Big Brains take a lot of energy), if such smart behaviour could be realized with 500 neurons.
But there is another method to search for a Problem sollution, that is significantly "smarter" but also more specified. I will write about that method a bit later, as it takes some time.
|
|
|
Re: Genetic Algorithms and Games
[Re: Damocles]
#115164
12/06/07 21:54
12/06/07 21:54
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
You are right , that GAs and NNs will result in the best adapted creature. But , you're not reading what I'm writing  I'm talking about the 'concept' of all of this. In my example , the AI wont have a predefined set of states that change from one to another during the evaluation of situations. I'm talking about having a set of predefined states that can emerge together to give more 'freedom' and diffrent combinations for an AI to 'deside'. I'm refering to those as 'feelings'. (Anger , Curiosity.) And after you have this predefined list of 'feelings' that can act together , you'll have an 'evaluation function' to change the behavior of each 'feeling' based on the situation , and some more inputs (as creature status(health,possition) , best escape / attack route and many more). If you make an AI to change its behaviour automaticaly based on for example human behaviour against the AI , you'll get a learning AI (like the bots in Counter-Strike , or the creatures in Black & White , but they're a little more hardcoded) Also , you're talking about real world examples for Neural Nets (dog) but you're not accounting that noone knows how a real neuron acts (they only suggest that it has a 'treshold' value and weights on the connections. What if you actualy have many tresholds (like a minimum , maximum and average level). Plus , the brain in the process of learning , doesnt change weights between connections , it changes the number of connections providing 'shorter routes' to neurons (and the information will travel between a set of neurons faster than in the other set of neurons) wich will result in diffrent firing states , because a neuron could fire 5 times for example until the data from the other part of the neural net reaches that neuron , and makes it to fire again. Its a complex combination , that noone can 'define' , noone can explain how a brain actualy works.  (But , I'm getting there VERY  slowly.I can summarize the process of learning in one sentence , but I couldnt find anything relating to that on the net...Why people havent tought of that yet , I dont know  )
|
|
|
Re: Genetic Algorithms and Games
[Re: EpsiloN]
#115165
12/06/07 22:11
12/06/07 22:11
|
Joined: Jan 2003
Posts: 4,305
Damocles
Expert
|
Expert
Joined: Jan 2003
Posts: 4,305
|
The properties of natural Neurons are known, and that their learning is different to the technical Neurons. "Backpropagation" makes technical Neurons learn, but it is not the way the Brain learn in Nature. (Its more the problem that people forget that fact) Its hard to find topics on "real" learning, but there are shurely a lot of special scientific papers on that too.
But dont get tangled up, in trying to simulate a real Brain, just for the purpose to write an AI (for a Game I suppose). This would grow into a too-vast field of research, that you have to spend a lot of time on. Try to stick to more simple and abstract Methods for the purpose of Game AI. This way you will be able to realize AI for games in a reasonable time. You should use Neural Nets in the well know technical "setup", to learn behaviour. The Neural Net itself can harly make a good AI, it should be seen as an component of an AI, that can adapt values, and get trained to tune these.
For AI, try to always realize a problem sollution in the easiest way possible. (in this case well crafted State-machines with a flexible way to change the values for the transition-decisions) Only if you get stuck at a certain point, and cant get the AI to realize what you need for the gameplay, think about a method that is more complex.
In the end, an AI is only so good as the player can notice during the game. If you have a super-fancy AI, that could also be made with a simple state-machine, (as experienced by the player) the effort is not very productive from the point of Game-design.
|
|
|
Re: Genetic Algorithms and Games
[Re: Damocles]
#115166
12/07/07 17:37
12/07/07 17:37
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
Quote:
But dont get tangled up, in trying to simulate a real Brain, just for the purpose to write an AI (for a Game I suppose). This would grow into a too-vast field of research, that you have to spend a lot of time on. Try to stick to more simple and abstract Methods for the purpose of Game AI. This way you will be able to realize AI for games in a reasonable time. You should use Neural Nets in the well know technical "setup", to learn behaviour. The Neural Net itself can harly make a good AI, it should be seen as an component of an AI, that can adapt values, and get trained to tune these.
Thats part of the problem why real learning AI hasnt been developed yet Noone wants to bother to make an 'all purpose AI' that can understand the situation , when they could 'understand' the situation and hardcode it into an agent. You're right , it is faster and very simple (compared to 'Strong AI') but my purpose is to make an AI 'understand' a situation and evaluate what it should do. The secret is that I'm planning on letting the AI change the evaluation output , based on inputs (for example 'experience in the past'). As for how exactly it'll change the evaluation outcome I dont know. I'll first have to 'observe' in some situations real animals and how exactly they would change their 'way of thinking' (have lots of dogs , chickens & gooses around me). Animals because they're much more intelligent than a Chess AI (in terms of 'thinking') . And , btw , we're getting a little off topic here I'm currently deciding how the evaluations evaluation will work. (Eg. there should be a system to change the 'evaluation' system). Here comes the GA & probably the 'concept' (or maby even the actual) of NN. Yes , the way an angent will change its 'thinking' will be predictable , based on situations , but the point is to make it change its 'thinking' , even if with simple systems , in order to 'research' and gain more experience in this . After all , thats how we humans learn right ? I'm planning on testing with some 'ants' tommorow , gathering food and fighting a 'hardcoded' agents (some other bugs) in order to provide them with a real world examples. What do you think ? Isnt it worthed if it'll get mankind one step further ?
PS.: Dont get me wrong I'm not a born genius , and I'm not the smartest. I'm just an enthusiast , who wants to contribute even with something 'simple and small'. I'm pursuing the 'goals of my life' , called dreams And , btw , keep the comments comming I'm getting more ideas by the minute , I hope you (all of you) too 
|
|
|
Re: Genetic Algorithms and Games
[Re: EpsiloN]
#115167
12/08/07 03:30
12/08/07 03:30
|
Joined: Jan 2003
Posts: 4,305
Damocles
Expert
|
Expert
Joined: Jan 2003
Posts: 4,305
|
Go ahead, its good to have entusiastic ideas.
But in the end, i have realized, that all "big" ideas, that I came up with, where already developed by others in the past at some time. It will be the same with your Ideas to the sollution. Its a good way to develop those ideas yourself anyhow, wich makes you understand it better than just using a premade functionality or method.
Ants are a good simulation environment for GA based AI, as your single unit is not very complex, and the genetics will try to make a broader system than just a little ant (the complete hive) learn to accomplish things. Also good for GA: you can kill entities, but still preserve the genes. (As the hive has many ant with the same genes, the selection by killing is more accurate than for a single complex creature)
|
|
|
Re: Genetic Algorithms and Games
[Re: Damocles]
#115168
12/08/07 16:49
12/08/07 16:49
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
Quote:
Its a good way to develop those ideas yourself anyhow, wich makes you understand it better than just using a premade functionality or method. ... (As the hive has many ant with the same genes, the selection by killing is more accurate than for a single complex creature)
Thats my point we all write our games from scratch , we're not using templates for everything , because we want to learn on our own 
What do you mean by 'selection by killing' ? I should kill random ants and mix their genes ?  I'm beginning to understand how creatures (I mean all that can think,not 'single cell organisms' ) actualy learn , and I think I'm beginning to understand how it could be implemented in an AI. The process is easy to understand and explain , but there is just one 'feature' that I cant understand. Hopefully , after I make my AI more complex I'll understand  Btw , is anyone here working on AI ? I'm a little confused by the script in your example (Evolution), I'm too lazy to arrange the lines for easyer reading 
|
|
|
Re: Genetic Algorithms and Games
[Re: Damocles]
#115169
12/09/07 11:38
12/09/07 11:38
|
Joined: Oct 2006
Posts: 1,245
AlbertoT
Serious User
|
Serious User
Joined: Oct 2006
Posts: 1,245
|
Quote:
.
In the end, an AI is only so good as the player can notice during the game. If you have a super-fancy AI, that could also be made with a simple state-machine, (as experienced by the player) the effort is not very productive from the point of Game-design.
This is the point in my opinion I am also interested in sophisticated A.I. techniques but , at the same time, I can not but take not that commercial games , normally, dont' use them It seems that even the famous Black & White A.I. which was supposed to be a milestone of game AI was actually nothing else that a marketing issue The Black & White AI being very basic and it simply "cheat" same as all other games Is anybody aware of games, even "niche" or "serious" or "educational" games which use advanced AI , achieving results which would not be possible using state-machine ?
Last edited by AlbertoT; 12/09/07 11:41.
|
|
|
Re: Genetic Algorithms and Games
[Re: AlbertoT]
#115170
12/09/07 15:45
12/09/07 15:45
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
Actualy you cant avoid the use of FSMs , if you want something that could go around a corner and attack you surprisingly  Yes , the player probably wont notice if your AI is complex if you could achieve the same thing with simple if/else statements , but it will (100%) not act the best in every single situation. That'll be atleast 75% of the situations , but what about the other 25% where the AI gets killed by the player because it bumped into a wall and turned the other way to avoid another collision (where the player was aiming). If you can make an AI that complex that could evaluate a situation and act on its own evaluation (not the programmers 'way of thinking') you can expect it to behave even better than a human player in probably 99% of the situations. The AI in Black & White I is simple if you try the game without thinking , but if you think carefully , your AI can learn every single spell separately and use a mixture of them when attacking , it can learn when and what to attack. It can learn what you preffer (attack or defend) and to mimic the treatment you give to your people. Now , that sounds pretty complex to me , because the AI is 'artificialy' learning. But , what I'm talking about in my previous posts is that an AI can be made to 'actualy' learn. Not artificialy , to tell it what to learn and when , but to learn on its own and what it wants. To change its behaviour automaticaly according to its own 'brain' for the best of its survival (and probably of its friends in an enviropment). PS.: I failed with the ants , because I created two AIs , one for every ant and one 'global' that influenced every ant. I think the answer is in separate creatures made to act according to what they 'see' the other is doing (for example helping the ant to lift something). The more I think about it the more I think my answer is in GAs (for the learning part) , to pick one of possible 'reactions' according to a situation and enviropment and past experience.
|
|
|
Re: Genetic Algorithms and Games
[Re: EpsiloN]
#115171
12/09/07 18:58
12/09/07 18:58
|
Joined: Jul 2004
Posts: 1,205 Greece
LarryLaffer
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,205
Greece
|
Quote:
Is anybody aware of games, even "niche" or "serious" or "educational" games which use advanced AI , achieving results which would not be possible using state-machine ?
Here's a list of games making interesting use of Artificial Intelligence Techniques
Not in that list, there's also Colin McRae Rally 2.0, Forza Motorsport, ReVolt, C&C Renegade and FEAR.
So don't be a . There's more to life than FSMs 
|
|
|
|