Simple Pong AI
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
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
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
Intrinsic Algorithm Development
"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
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
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]
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]
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement