Sports' AI

Started by
5 comments, last by tayete 22 years, 9 months ago
Does anyone know any sports'' AI web, tutorial or similar? I am developing a sports game, and need to retouch some things... thanks guys "Nec spes, nec metus" - Gladiators'''' motto
"Nec spes, nec metus" - Gladiators'' motto
Advertisement
I think that''s a bit vague. You''d play soccer very differently to how you''d play baseball, or alpine skiiing. Maybe if you could specify the sport, we could be of more use?
Well, in fact it is a rugby game. I don''t expect to find any tutorial specifically aimed to developing rugby games, so I considered every team sport has some common features, that would allow me to paste them. For example, the way to take certain decisions, proximity of players (when should they come close to the one who has the ball), etc...

If anyone knows something, please post it here. Thanks again.

"Nec spes, nec metus" - Gladiators'''' motto
"Nec spes, nec metus" - Gladiators'' motto
Well. Even similar sports will have quite different AI. Comparing rugby with American football, for example... in rugby, when you have the ball, the people on your team will want to be behind you, so that you can pass the ball legally. Whereas in American football, some of them at least will want to be quite far ahead and probably wide, in order to receive a long pass. Basketball is another ball-throwing game, and in that your team-mates are probably going to stay fairly close to you, whether in front or behind.

So it''s obvious that a lot of it will depend on the game itself, and the situation in the game.

Maybe you can take these basic building blocks and work from there, adding rugby-specific rules as you go along:

Tactical:

a) Characters need to be able to decide where they want to be
b) Characters need to be able to decide how to get there
c) Characters need to be able to evade a certain person or place (eg. getting away from someone trying to tackle you). This is essentially the reverse of ''b''.
d) Being able to find a balance between a, b, and c... for instance, taking up a position in one part of the field, without staying too close to an opponent.

Strategic:

a) The ability to pick a ''strategy'' which influences the whole team. (Specifically, influencing option ''a'' above.) Perhaps once you have the basics down, the player should be able to influence or customise this.
b) Ability to change overall strategy in different situations. The simplest example is that you have different objectives when you''re attacking and have the ball to when you''re defending and the opponent has the ball.

For a good idea of a very simple (yet very effective) strategy system, look at Sensible World of Soccer. The idea was simple: the pitch was divided into a set number of zones (9 or 16, something like that), and when the ball was in that zone, your characters would try to get into a given position. So effectively you picked 16 different formations, one for every possible position of the ball. When the ball moved from one zone to the next in the course of play, the players would know where they had to run to. Ideally, you would have one set of positions for when you had the ball, and one set for when the opposition has the ball, as they might be slightly different.

Just a few ideas.
Thanks for your answer.

More or less is what I am creating right now. A general (strategic) objective depending on posession of the ball, situation on the pitch, score, and so on..., and then individual ones depending on the characters'' position.

Thanks for the coop.

"Nec spes, nec metus" - Gladiators'''' motto
"Nec spes, nec metus" - Gladiators'' motto
AI for team sports differs radically from AI for solo sports, so I first listed team sports for which AI guidelines could be drawn up.

Teamsports:
(Doubles) Badminton, Basketball, Football (soccer), (American) Football, Handball, (Field/ice) Hockey, (Doubles) Tennis, (Indoor/Beach) Volleyball. There may be more; please feel free to add.

Next I divided them according to whether they were "territorial" and/or "positional".

Territorial teamsports involve the prevention of an occurrence on the "home" part of the playing arena - the ball bouncing twice on your half in tennis/ping-pong, the ball hitting the floor in badminton/volleyball, etc. Non-territorial teamsports , OTOH, involve the manouvering of the "ball" into a goal situated at the end of the opponent''s portion of the playing area - soccer, basketball, hockey, football.

Note that baseball is neither territorial nor non-territorial by these definitions.

Positional teamsports require players to move to or within specific portions of the arena to play. Examples include volleyball (6 offensive/defensive zones), baseball, tennis, racquetball, etc. Pseudo-positional teamsports require movement to certain positions relative to other players in the arena. These include football, soccer, basketball, hockey and the like.

Sports may also be classified by whether they are passing or non-passing (or pseudo-passing like volleyball and, to some extent, baseball), turn-based (pitch, bat) or rally (constant back and forth; most sports are rally) and other divisions. Any two or more sports that fall into all the same divisions will have nearly identical rulesets, and rules governing motion can be generated from the influence of two or more divisions.

For example, if a sport is a passing sport but also a pseudo-positional sport (most passing games are), then passing involves finding the point of intersection of the eventual trajectory of the "ball" (I keep quoting the term "ball" because in some sports it may not be) and the path of the intended recipient, circumventing interception by opponents. So if player A has the "ball" and player B is making a run at goal with no obstructions, player A should pass such that the "ball" comes in front of player B (in soccer the "ball" should hit him/her in the shin if not controlled; in basketball, it should hit the chest) who then has an opportunity to advance the ball without losing rhythm.

However, beyond broad generalizations such as the above, it is not possible to really create general-purpose AI routines for sports due to the differences in numbers of players, plays, objectives and rules/restrictions (offsides, illegal defense, etc).

I''m a hardcore sports gamer and am working on technologies for sports gaming. I''d love to collaborate if you''re interested, particularly on physics and AI, or at least swap ideas. Drop me a line sometime at oluseyi@twcny.rr.com. Best wishes.
I have long thought about making a baseball or football (soccer) game, but have been stumped on the AI too. I have thought about many things for a football (soccer) game, and have read the articles on the "BOT Soccer games." Some of the AI is useful.

Carlos Camacho
Editor
iDevGames.com
Macintosh Game Development

This topic is closed to new replies.

Advertisement