Simple Pong AI

Started by
6 comments, last by treezy 21 years, 9 months ago
Hey everyone. I was wondering how I would inplement a some what advanced AI for a simple Pong game that I''ve put together in 2 days using SDL. I''m 16 and relatively new to game programming and artificial intelligence. I''ve searched the net looking for solutions but have only found a very basic algorithm that I figured out on my own: pseudo-code if batx < ballx then move bat right if batx > ballx then move bat left
Advertisement
I''ve posted the source on my site. Feel free to take a peek at it and give me any suggestions to how I can make the AI better.

The code compiles under Linux, but should compile under Windows too with some minor adjustments to the Makefile. Just haven''t had the time to boot to XP and fix it.


Here''s the URL:
http://users.1st.net/jecoleman/airpong-0.1.0.tar.gz
You might want to look at the forum where they have article requests. I know Jeromy Walsh was working on a Pong tutorial.

Dave Mark
President and Lead Designer
Intrinsic Algorithm Development

"Reducing the world to mathematical equations!"

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!"

i made a pong game for a java applet not too long with some AI... not exactly very advanced ai but it did the job.
its up for show on my website at the moment
http://users.bigpond.net.au/bcowcher/test.html
take a look at it, if the ai in that is close to what your after i can send you the source for it, mind you tho my coding style is very err.. erratic

Get busy livin'' or get busy dyin''... - Shawshank Redemption
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
basically to make it play more fun, you need to add reaction time, some randomness (like sometimes moving to far past the ball), and other mistakes the player makes. dont just limit the paddle speed (unless your really press for time).

just a slight siggestion. next time you post a question. dont have the title and the message conflict. the titel asks for simple pong ai, while the message asks for advanced pong ai.

[edited by - a person on July 1, 2002 3:52:06 AM]
thanks for the advice
Ahh but the title and the message do correspond. The title says Simple Pong AI and the message asks for Advanced AI for Simple Pong. So technically they do.. sorry for being picky.
I''ve created an actual site for the project.

Go to http://airpong.sourceforge.net and check it out and give me some feedback on what you think.

This topic is closed to new replies.

Advertisement