Archived

This topic is now archived and is closed to further replies.

RASP

Sports management AI

Recommended Posts

RASP    122
I''m developing a match engine for a cricket managment simulation at present and am looking for a bit of guidance with regards to AI. When a ball is bowled, a batsman interprets where it lands on the pitch and depending on where a randomn number falls, he either plays a defensive, normal or attacking stroke. It works out which ''region'' of the field the ball goes to depending on which shot they have played. This isn''t exactly how I''d imagined would be the best option when implementing something like this. Does anyone know of any good AI tips when doing a sports management sim like this?

Share this post


Link to post
Share on other sites
RASP    122
As in Player AI... I''m developing it in C++ but haven''t really had much experience with AI in the past. What are the typical approaches to this problem in match engines?

Share this post


Link to post
Share on other sites
fup    463
The player AI for sports sims is typically driven by a finite state machine (FSM). Each player role: batsman, fielder, bowler, may have one or several states associated with it. The players change state depending on one or more conditions, which you as the programmer create (It's also possible to use other techniques in the creation of these conditions or rulesets but don't worry about that, you can create a perfectly fine sports sim using hand crafted FSMs).

For example a fielder may have the states:

Wait at Position
Run toward ball
Catch Ball
Throw ball to player X

One of the exit conditions for the Wait at Position state may be that a batsman has hit the ball toward the fielder's sector. This condition would change the fielder's state to Run Toward Ball.

One of the exit conditions for Run Toward Ball might be that the ball is within catching range at which point the fielder will change state to Catch the Ball. Another exit condition for Run Toward Ball might be that the ball has landed too far away in which case the fielder should change state to Wait at Position.

And so on

Hope this helps



My Website: ai-junkie.com | My Book: AI Techniques for Game Programming

[edited by - fup on August 8, 2003 11:51:33 AM]

Share this post


Link to post
Share on other sites