help with AI

i am a newbie in game deve, and made my first game (pong) which is at: www.geocities.com/alimanpagal/betagame.html

and it's source is at:

www.geocities.com/alimanpagal/TestCollision.java

the thing which is wrong with my game that it has zero intelligence, it's a traditional ping-pong game. the user's side is working al-right but the pc's side of the paddle never misses the ball. So please anyone who can tell me how can make the paddle hitting the ball procedure random please reply as soon as possible

[541 byte] By [alimanpagal] at [2007-9-27 13:57:31]
# 1

> i am a newbie in game deve, and made my first game

> (pong) which is at:

> www.geocities.com/alimanpagal/betagame.html

> and it's source is at:

> www.geocities.com/alimanpagal/TestCollision.java

>

> the thing which is wrong with my game that it has zero

> intelligence, it's a traditional ping-pong game. the

> user's side is working al-right but the pc's side of

> the paddle never misses the ball. So please anyone who

> can tell me how can make the paddle hitting the ball

> procedure random please reply as soon as possible

I haven't really done anything in terms of game programming, but some initial ideas for making it harder for the "computer" to hit, might be to have the "ball" move faster than the user can move the paddle, or change the response time of the computer so that it doesn't start moving with the ball immediately after it hits the user's paddle.

Another idea (probably more for later implementation)might be that the speed of the ball depends on how fast the user is moving when he/she hits the ball.

Tringard at 2007-7-5 21:46:52 > top of Java-index,Other Topics,Java Game Development...
# 2
> the thing which is wrong with my game that it has zero intelligence, it's a traditional ping-pong game. the> user's side is working al-right but the pc's side of the paddle never misses the ball. Yep, sounds like a traditional ping-pong game.
YATArchivist at 2007-7-5 21:46:52 > top of Java-index,Other Topics,Java Game Development...
# 3

instead of reacting to the immediate surroundings, put them in a cache, react to the cached ones then take a new snapshot (with a 100ms delay or whatnot), thus the pc is always one step out of turn, mix in some fairness (don't let the old caches get more than 3 or 4 steps old) and some randomness (sometimes take the oldest cache, sometimes skip the first few oldest) and lo, by playing quickly you can change the surrounding state before the AI notices

Shish

shishthemoomin at 2007-7-5 21:46:52 > top of Java-index,Other Topics,Java Game Development...
# 4
> the thing which is wrong with my game that it has zero> intelligence, ... the pc's side of> the paddle never misses the ball.You can try what is mentioned here: http://javaboutique.internet.com/tutorials/Java_Game_Programming/PongKIEng.html
jlbpa at 2007-7-5 21:46:52 > top of Java-index,Other Topics,Java Game Development...
# 5
thanx to all of u for ur support. inever thought the replies wud start coming in so fast.
alimanpagal at 2007-7-5 21:46:52 > top of Java-index,Other Topics,Java Game Development...