Dumb AI For Pong

Started by
5 comments, last by CJWR 18 years, 9 months ago
I'm not sure if this has been asked before, but what the heck. = ] I know that AI for a pong game is easy to impleament, and make the NPC really smart. My question is how do you make the Pong NPC smart at times and yet stupid at other times? Because in my Pong game, it seems to be either super smart or super stupid... = / Is it possible for it to be both? Anyone have any ideas on how to make Pong AI fun? Even if you haven't coded AI yet, just general AI ideas would be cool to. Thank you ahead of time for all the help, and reply's.
Advertisement
You could slow the reaction time down of the AI, say he only starts to move towards the ball when it crosses the net. That's what I would try!
What we do in life... Echoes in eternity
Use a random number to check if the AI should act smart or dumb. Just don't make it too obvious for the player...
Quote:Original post by Jemburula
You could slow the reaction time down of the AI, say he only starts to move towards the ball when it crosses the net. That's what I would try!


It's already doing that, but I have the Pong NPC acting like a human to some what. Like say after you hit the ball back towards the other player, normally the player will move back to the middle of the screen and get ready for the next play. Well that's what the Pong NPC is doing. Acting like we would.

Quote:Original post by Kalasjniekof
Use a random number to check if the AI should act smart or dumb. Just don't make it too obvious for the player...


I'm going to try that tonight... ummm, well this morning now. = ]

The biggest problem is that the AI won't play like humans. It won't mess up and miss, except in the cases where it can't reach the ball because of a delay. The way I'd do it is to fuzz up the information the AI gets on the ball position.
I would do it this way:
When ball reflects increase ball speed.And the dificulty level will affect only computers response time.So if AI delay time is long it has more chance to miss the ball.And of course this will be ( i think so ) more realistic cos whatever delay time AI has it will hit the very slow balls .So dificulty level will be only AI delay time which you must tweak acordingly. :)
Serbia,Zrenjanin
Quote:Original post by erjo
The biggest problem is that the AI won't play like humans. It won't mess up and miss, except in the cases where it can't reach the ball because of a delay. The way I'd do it is to fuzz up the information the AI gets on the ball position.


on that note:
if i were to have the an ai try to play pong, i would have it try to always keep the ball on the paddle (in terms of y) so give the ball's location +/- a rand number. this way it'll still try to follow the ball (as we as humans do) but it won't know just where the ball is. this should make it miss from time to time, but still make it look as if the ai is trying.
Charles Reed, CEO of CJWR Software LLC

This topic is closed to new replies.

Advertisement