Advertisement

Working on AI for tennis simulation. Need some advice.

Started by July 02, 2005 04:16 PM
0 comments, last by NickGeorgia 19 years, 4 months ago
Here is probably a long read for some of you, it is for my new game Total Tennis Sim. I'm still working on less important things on my game (like files, finishing up interface, still working on the database) but I'm thinking ahead about the AI in my game. Here is what I got planned out (some taken from the design document): The court is divided up into 8 sections (Could be divided into more later for much more accuracy, but 8 is good for now), pretty much like a chessboard. Each side of the tennis court, has 4 zones. Example from google: [image]http://wings.avkids.com/Curriculums/Tennis/Images/crt_01a.jpg[/image] (still got no clue on how to post images on these forums) In these 4 zones is where the tennis player can be, and will do the following:Match Engine Flow: Player -> Player Location -> Player Action -> Location of/to Action -> After Action (if needed) -> Player Location First the player will be identified, then the player location will be identified, next the action from the player will be executed, then the action will go to where it needs to go *like the ball being hit across the net to the other player*, then any player after action *like standing up after a dive and charging the net*, and then once again the player location will be evaluated, and it will be the other players turn. It sounds simple, it is meant to be, right now I'm just trying to get the absolute basics. Now, tennis is kinda like pong, I stupidly, only realized that awhile ago. The only twist is, there is the addition of knocking the ball over a net, keepting it in bounds, and you can move up closer to the center. Now, first thing I want to get out of the way is player movement. I want to simulate real life, and in real life, tennis is all about anticipation *which is an attribute in the database, for each player*. So I have to mix in the player location, and then anticipate where the ball will go, and then act accordingly. In real life, most players are either running insanely to chase down a ball going the opposite direction, or they are either setting up to try to be near the middle so they can quickly move either direction. So in the game engine I will have to account for this somehow. Then, I will have to take in a player's personality, if he likes to charge the net, and if he does, he is either going to do it right after he serves, he gets the other player in a bad position and he is chasing down a ball, or the other player hits a shot that is meant to be close to the net. I am guessing Positioning, Decisions, Creativity, and Attitude will be evaluated to figure this one out. BTW, stats are based on a 1-20 rating system. So, I believe that pretty much takes care for the bare basics for player movement, any one else have any ideas, or anyting I missed, please let me know. Now, the other half of this, is the ball itself, in comparing it to pong, the ball is absolutely controlled by gravity, the force that it is hit by, and somewhat of a luck and experience. Also I have to account for the ball being hit out of bounds. On first serve in tennis, again depending on the player (which I will need to look up some real life serving statistics), they either cream the ball on their first serve, get an ace, fault, let, or the player returns it normally, doesn't return it well, and it hits the net or misshits. For now, I'm not sure if I should implement ball height, because, even though later on, the ball will have to be tracked heavily, right now i'm only in the beginning. I guess it just depends on if i'm evaluating the action, then displaying it, or if I'm doing it *on the fly* evaulating and displaying at the same time. So, I'm thinking for ball height, there will be 3, high, low, and middle. High being a lob, low being hit the net, or barely getting it over, and middle being somewhere in between, I guess it is a fuzzy subject at the moment. Where the ball goes, is dependent on the players actions, and his personality, and the current situation basically, my job is to check if the ball goes over the net, if it stays in bounds, what kind of shot it came from, and if the other player will have anything to do with it. Court type will also playa big deal with the ball, so I'll have to look up some statistics on differences between court types. So for now, I think that pretty much wraps it up for the basics. Anyone have any questions, or hopefully any suggestions for what I'm doing. If even just telling me this idea doesn't suck completely could also help as well ;) j/k After this, I hope to move on to Soccer (Football for anyone else who gets offended) Simulation. Which, if I think this is hard, managing 22 players... yikes, I can just imagine the horrors of the database for that game, maybe I'll have some help when I get that far. Anyways, thanks in advance for any help, suggestions, criticisms, all that good stuff.
Sounds like a fantastic game. However, it does seem like a lot of modeling will be involved to get some cool behaviors going. This is why I'm working on an AI framework to ease the pains. Unfortunately, it'll be a while.

This topic is closed to new replies.

Advertisement