Skip to main content
GameDev.net gamedev.net
🔒 Locked

AI for a volleyball game

Started by No_Germs May 18, 2005 at 7:34 AM 0 replies 2.2k views
Original Post
No_Germs
No_Germs
i've created a volleyball game where you control a paddle that hits the ball. the goal is the same as in real volley ball. i've began designing the ai for the computer opponent, but am having troubles with it. is there a systematic way for designing AI, cause i'm really just following my intuition... here's what id did (which i don't think is the best way to do it): the ai is very simple because the only parameter it determines is the coordinates the paddle should go to. the system works in two stages: 1. anlysis in what state the paddle should be: a."offense", if the ball is in our courtside and above the net and such. b."defence", if the ball is in the opponents courtside, but the opponet hasn't "dunked" the ball yet. c."save", if the ball is on a course for landing in our courtside. d."set up" when the ball is in our court side and in control (it's speed isn't big so we can't lose control), but the ball is below the net so we must give it a few hits up so it'll be above the net. e."ignore"- if the ball was last touched by the opponent, but it falls out of bounds, so no point in trying to save it. 2. base on the state of the paddle, a new coordinate is a assigned: if "offense", the paddle should be slightly above the ball, and further from it so the ball is between the paddle and the opponent's paddle. if "defence", the paddle should be where it covers the most territory. if "save", is should be under the ball, so it'll be able to hit it to go up. if "set up", it's the same, but it als tries to move the ball slightly to the left and right, so it'll be in the best place to "dunk it" if "ignore" don't do nothing. so... is this a right method of doing ai, and if not, what should i do (general tips would be great, too). thanks, noam :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.