Jump to content
  • Advertisement

Archived

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

AlbertoT

Chasing algo

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I would like to know wether NN has been succesfully used for a "chasing" 2D algo. The player chases the PC driven bot . The bot escapes, avoiding obstacles. Inputs should be player and bot''s position and speed, outputs the bot''s acceleration I am concern that NN may be too much predictable. As an alternative I am planning to use random prefabricated patterns What do you think? thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Well, the NN would only be useful for learning how a player is chasing them and trying to avoid the pattern that the player chooses. For just trying to get away from the player while avoiding obstacles, it would seem like a combination of steering (avoidance) algos would to the trick. Are you specifically looking for a way of doing this with NNs or are you trying to solve the chasing problem itself?

Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
Thanks
I am trying to solve the chasing problem itself for a game application.
In other words , the bot should behave more or less in a realistic and logic manner but ,even more important its reactions should be difficult to predict.
I thought also to train several NN''S and then to switch randomly among them .

Share this post


Link to post
Share on other sites
quote:
Original post by AlbertoT
I thought also to train several NN'S and then to switch randomly among them .

Why not just have one evasion algorithm with some random components to the choices it makes so that is not predictable? Evasion, at its core, is simply an excercise in mathematics. Find the formula for "getting away" and then introduce some parametric noise (randomness) into its perceptions and decisions and you have a very decent "escape" algorithm.

Check out Craig Reynolds' site on flocking and steering behaviors to see some examples of what I am talking about.


Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

[edited by - InnocuousFox on May 8, 2004 11:07:14 AM]

Share this post


Link to post
Share on other sites
Hello InnocuousFox

Thanks a lot ,Craig''s site is very interesting.
I have read his articles on a computer magazine sometime ago and I was looking for them .

These chasing algohritms are based on a continuos monitoring of the enemy and of the ambient.
I suppose that they can not produce "Irrational" but "efficient" strategies
For example, the bot might suddenly turn 180°, running towards the player, who does not expect such reaction, or heading , for a while, towards a corner instead of a vast free area , and so on.

I wonder wether a sequence of random patterns can work better for a game application.
The bot loops through the available patterns and select , randomly, the ones which do not collide with the world and with the enemy.
Then the pattern is executed ,at the end an other pattern is selected and so on
Obviously the patterns must be short enough because the player''s position changes continuosly

What do you think?

Share this post


Link to post
Share on other sites
Well, as I mentioned, by taking a mathematically sound (perfect?) route and introducing randomness +/- either side of it... or even a few random parts throughout the various calculations, you can get some "less than perfect" results. In fact, by combining a few random items you can get an approximate bell curve that will do "almost optimum" results most of the time with the occasional "wild" result popping in less often.

For example, if you wanted to do +/-30 degrees (a 61 degree spread), instead of doing a (rand(60)-30) equation, do 3 (rand(10)-5). The result would be a lot of +/-10, fewer that range out to +/-20 and very few that get to +/-30.

As you suggested, however, you can have a "playbook" that is a number of different algorithms. One may be a mathematical avoidance one, one may be "OddTactic1" and another may be "CrazyMove". Create a random selection from those mostly biassing the normal evasion algorithm. Then, every X number of game loop cycles (or even a random number of cycles between them), decide whether or not to throw in a weird move or not. There a ton of ways you could set up the sequencing depending on how you want it to look/act.

The bottom line is that a NN is going to end up looking a lot like what you could mathematically deduce anyway... it will just take a lot longer to produce the results.

Dave Mark - President and Lead Designer
Intrinsic Algorithm -
"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!