I have been observing many different soccer AI's, including RoboCup. Although I've noticed that RoboCup AI's are way more complex than most (retro) game AI's. For what I'm planning to do, I'd like to keep it as simple as possible.
The system I've used in my first prototype is the one I told about earlier. Only a few players on the field are 'active': The ones from each team that are closest to the ball, and a player that is about to receive a pass. For the rest I loop through many positions on the field placed in a grid, and apply points to them based on many different factors.
For example some of these factors are:
- Can I receive a pass from the player with the ball from this position
- Is this position close to my home position (So that not all players will go to the same position)
- Can I shoot on goal from here?
- Are there no opponents to close to this position?
- Isn't there a teammate already at this position?
These are all for the team that has the ball, the defending team of couse has other factors, wich I still need to work on a bit more.
A similair strategy is also used to find the best player to pass to.
I like how it looks so far, but it still needs a lot of tweaking. I've seen players pass back to the keeper when they could also have shot at goal for example.
The formation database system Hodgman talked about (and wich apparantly is also used in FIFA and PES) would probably be better, but it will be much more complicated and I'd seriously have so study soccer tactics. Also, I like how chaotic my current system is.
Thanks again, and more tips and suggestions are welcome!
I have heard about flocking before, but never thought that it could be usefull for something like this. I will definately have a look at it.
The formation database system would be the most complicated part by far, since the players should find a balance between keeping to their formation, and wandering off to mark an opponent, or to get to the ball or wathever. (And of course to keep in more interesting)
Passing is indeed also a problem. I think I'm going to do that by looping through all teammates and giving each of them a 'score' for how good it is to pass the ball to them. Then pass to the one with the highest score. I was also thinking about using this system for positioning the players in some ocasions.
Player spesific skills and characteristics is something for later. I first want to focus on making some identical players play a game of soccer, then I'll make different players/teams.