Pong AI
I'm working on a Pong game and I've got the most basic implementation of AI going I can think of but it's too unrealistic currently. What I've got is the paddle follows the ball up and down no matter where it is on the screen. The speed of the paddle combined with the much faster speed of the ball though prevents the AI from being impossible to beat.
The other idea I had awhile ago was to wait until the ball was 50-75% of the screen away from the paddle before I started to move towards where the ball is and then randomize a short amount of over- or under- compensation so the paddle would either go to far and try to come back or wouldn't go far enough (simulate human distance error).
What do you think? I'm very bad with AI and am unsure of what method I should use. If you have another method by all means please share it.
Sounds good to me. Any delay or parametric noise that you can put in to "fuzzy things up" a bit will make it more realistic.
It's actually interesting, I was play testing some stuff last night and kept losing. I thought the simple AI I had built was much too simplistic but it's actually quite difficult and I think if I add anything I need to 1) make it seem more realistic, 2) add in some kind of handicap.
I made pong not too long ago and for my AI, if the ball's center was above the paddle's center, move the paddle up a little, otherwise move it a little down. If the ball was moving away from the AI paddle, move it at half speed back to the center, once the ball was going towards it again, start moving it towards the ball. Still pretty simple, but worked good.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement