PDA

Click to See Complete Forum and Search --> : pong AI


MidgetsBro
May 15th, 2001, 11:35 AM
Since I can't reply to my previous post, I am going to ask this in a new thread. How can I make a stupid pong AI? I tried making one but it is too intelligent. It never misses. I need it to be stupid sometimes so that it misses and the player has a chance.

Thanx

P.S. John/James:

What's this all about?

Fatal error: Call to undefined function: forcepost() in /usr/local/etc/httpd/sites/vbforums.com/htdocs/newreply.php on line 66

Illuminator
May 15th, 2001, 02:08 PM
There are many ways to simulate a semi-realistic computer opponent.

I havn't tried any of these but they many work. I assume you have a maximum speed at which the paddle can be moved.

-> Have the computer make guesses where the ball will cross his end whenever the ball bounces off a new surface. Each time apply a variance variable that will offset the guess by a little.

->Give the computer a random reaction time delay before a guess is made, thus it might react too late. (With paddle speed the computer can move to the guess spot in time)

The higher the variance variable and reaction delay the worse the computer will perform.

Sastraxi
May 15th, 2001, 03:32 PM
I've used the 2nd approach before and it works very well, tried to implement the first one but failed...

But that's years behind me...

The only thing wrong with the 2nd approach is that it gets a bit programmatic.