AI in non-preconceived bodies
I''m trying to figure out what the best way would be to incorporate AI into custom designed units in a game. In the game I''m envisioning, players are able to design fighting creatures, and they are not limited to using modular parts. These creatures then need some sort of AI or script in order to function. I figure I either need one AI that can automatically adapt to whatever body it is in, or, I need a way for the game to automatically generate an AI for the creature when the creature''s design is complete.
In the first case, for example, if I plug the AI into a human model, then it is able to walk, manipulate the arms, hands, head, etc. If I plug the same AI into an Octopus, I want it to be able to figure out that it has eight tentacles, how it can move, etc. I don''t know if this means the AI has to be self-learning and figure things out like a baby (which might not be so bad if I have the creatures grow from babies) or if the AI could be made to figure these things out right away. In the second case, the game would need to be able to generate an AI for the creature automatically with no input other than the body within which the AI is to inhabit.
I''d appreciate any thoughts/ideas/comments. Thanks.
August 23, 2003 10:44 PM
Knowledge Representation, incorporate ''knowledge'' into each part. When the ai is searching for an action necessary for a goal, it will choose whichever part fits closest. A basic example would be choosing a weapon based on distance and speed of the target. As for locomotion, a trained neural net makes sense to me. It will take time to train, however. If possible, you could make a series of nets that are pre-trained for certain combinations(like 4 legs) and then adapt it for specific creatures(although I don''t know if that will work as I am definitely not an expert and don''t know which kind of network would be best).
There has been quite a lot of interesting research into this very idea, so you won''t have to start from scratch and work it all out for yourself.
One approach is to evolve a movement strategy for your creature based on a given goal/reward function. For example, your creature might have 2 legs, 2 flippers and claws. You''d like to get it to move in a straight line as fast as possible. You can encode movement commands for the legs, flippers and claws into a string and utilise a GA to find a string that produces optimal movement (for the given objective function).
Another approach - and one inspired by nature and used in robotics - is to give each leg its own neural controller. Cockroaches are interesting creatures in that the part of their brains that controls movement resides in the base of each leg. Each leg-brain controls the movements of the leg it is in and receives an input from the other leg-brains as to their state. The output of the current leg-brain is chosen so as to maximise the potential for the desired movement type.
So, to translate this into your creatures, you need to work out how body parts can move and interact with the environment. Presumably there are only a finite number of components that can be used to make a body part: for example, joints, bones, membranes, muscles, etc. You need some way of working out how each affects the other and how they interact together with the environment. Once you have that worked out, you can add an artificial neural network - or other form of classifier - to learn a functional relationship between the actions of each body part and every other body part.
Of course, this wont be easy. This is why most research to date that I can recall has worked with modular body parts. There was some interesting research done in NZ involving the evolution of non-natural body parts (like jointed wings), although I cannot recall the authors name. I think I can find the reference if needs be (I think it''s given in one of Rodney Brooks'' books).
Cheers,
Timkin
One approach is to evolve a movement strategy for your creature based on a given goal/reward function. For example, your creature might have 2 legs, 2 flippers and claws. You''d like to get it to move in a straight line as fast as possible. You can encode movement commands for the legs, flippers and claws into a string and utilise a GA to find a string that produces optimal movement (for the given objective function).
Another approach - and one inspired by nature and used in robotics - is to give each leg its own neural controller. Cockroaches are interesting creatures in that the part of their brains that controls movement resides in the base of each leg. Each leg-brain controls the movements of the leg it is in and receives an input from the other leg-brains as to their state. The output of the current leg-brain is chosen so as to maximise the potential for the desired movement type.
So, to translate this into your creatures, you need to work out how body parts can move and interact with the environment. Presumably there are only a finite number of components that can be used to make a body part: for example, joints, bones, membranes, muscles, etc. You need some way of working out how each affects the other and how they interact together with the environment. Once you have that worked out, you can add an artificial neural network - or other form of classifier - to learn a functional relationship between the actions of each body part and every other body part.
Of course, this wont be easy. This is why most research to date that I can recall has worked with modular body parts. There was some interesting research done in NZ involving the evolution of non-natural body parts (like jointed wings), although I cannot recall the authors name. I think I can find the reference if needs be (I think it''s given in one of Rodney Brooks'' books).
Cheers,
Timkin
An idea is to have information in a list with information on each limb, weapon etc that the creature has. So have your AI read through the information sorta like scripting language, and have AI having goals, in which it uses the information on its capabilities to achieve the goals.
I know its a little vague but if you keep thinking up on how it will use the information for its own purposes, im sure you'll get it.
edit:
actually like timkins mention of moving in a straight line, use body parts to try and get to one place. eg biting your mouth aint gonna get you there, so exclude that from the movement cycle.
it'll be quite hard to do with other things that require a combination of body parts, eg hunting, requires running and eating, but its gotta know when to eat when its in range, maybe store that universally in your ai.
[edited by - johnnyBravo on August 25, 2003 10:06:32 AM]
I know its a little vague but if you keep thinking up on how it will use the information for its own purposes, im sure you'll get it.
edit:
actually like timkins mention of moving in a straight line, use body parts to try and get to one place. eg biting your mouth aint gonna get you there, so exclude that from the movement cycle.
it'll be quite hard to do with other things that require a combination of body parts, eg hunting, requires running and eating, but its gotta know when to eat when its in range, maybe store that universally in your ai.
[edited by - johnnyBravo on August 25, 2003 10:06:32 AM]
quote: Original post by johnnyBravo
An idea is to have information in a list with information on each limb, weapon etc that the creature has. So have your AI read through the information sorta like scripting language, and have AI having goals, in which it uses the information on its capabilities to achieve the goals.
Yes but remember the limbs are not created in advance (non-preconceived, non-modular), so I can't encode them prior to distribution. The player will be creating the limbs so they can't be encoded prior to distribution.
[edited by - Trifler on August 25, 2003 2:13:41 PM]
August 25, 2003 03:10 PM
I agree with Timkins idea about using a Genetic Algorithm. I remember seeing something on the discovery channel about some guys that did something similar. They had some weird shaped bodies, and encoded the movement parameters as the gene string, and the fitness function was how far forward they could move in 5 seconds. They then evolved the strategies that the bodies used to move forward. Early generations made jerky lurching movements to get forward, then as the strategies evolved more, they began to actually crawl and/or walk in efficient ways.
Well i was just thinking of a way to identify a limb.
Like even if the limb was some sort of half hand half mouth. You could say it has a biting range, can hold things, moves in a certain way etc.
Sorta like instructions that come with the limb, so you may have 10 different customised limbs, but the information on how they work is stored in a list.
Any other ideas on how to use limbs without such information?
edit:
actually what i mean is, in real life you have physical boundaries no matter how you try and move your body, and you may have pain signals in the limb if you try to move it the wrong way.
You could create a system where you simulate all this or you could just give simple instructions on how things work.
It would be a little hard i believe to do this as you have to account for a quite a few things such as collision detection for each limb....
[edited by - johnnyBravo on August 25, 2003 8:08:15 PM]
Like even if the limb was some sort of half hand half mouth. You could say it has a biting range, can hold things, moves in a certain way etc.
Sorta like instructions that come with the limb, so you may have 10 different customised limbs, but the information on how they work is stored in a list.
Any other ideas on how to use limbs without such information?
edit:
actually what i mean is, in real life you have physical boundaries no matter how you try and move your body, and you may have pain signals in the limb if you try to move it the wrong way.
You could create a system where you simulate all this or you could just give simple instructions on how things work.
It would be a little hard i believe to do this as you have to account for a quite a few things such as collision detection for each limb....
[edited by - johnnyBravo on August 25, 2003 8:08:15 PM]
August 28, 2003 07:40 PM
ap from above: apparently I''m not speaking English, I guess I just wasn''t as specific as other posters
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement