Pong AI

Started by
2 comments, last by Tenac 15 years, 9 months ago
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.

=============================RhinoXNA - Easily start building 2D games in XNA!Projects

Advertisement
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.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

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.

=============================RhinoXNA - Easily start building 2D games in XNA!Projects

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