Implementing Hockey Players AI ?

Started by
6 comments, last by robert_loxy 10 years, 2 months ago

I am developing ice hockey game on 'android platform' so i wanted to know what would be the best approach while implement the AI for the players.

I have knowledge of AI but at the mean time i dont know what would be the right option to implement the AI

The algorithm chosen or written should also consider the limitation of the mobile hardware and should also be robust enough that it looks like an AI ?

So i would really appreciate if someone can guide me to the right path.

Advertisement

This is a shot in the dark, but you might want to do some searches on RoboCup Soccer? Yes, it's soccer, so not exactly the same, but it's still very similar in that you have a team of players trying to bring an object to the goal, while avoiding defenders, etc.

Hey Ferrous,

Firstly thnx for showing some direction 'RoboCup Soccer' looks interesting. Secondly why would you say its a shot in the dark ?

I have implemented the AI part but the use of AI word for it would be wrong in my perspective.

Basically i have 3 difficulties PRO,ROOKIE,EXPERT

My algorithm does is that it calculates all the player distance from the goal and sort it in increasing order. Now in

Pro = ball is passed to the 3rd person closest to the goal

Rookie = ball is passed to the 2nd person closest to the goal

Expert = ball is passed to the 1st person closest to the goal

and If team player has the ball i have coded 2-3 attacking formation they pick one and go for the attacking formation else all the player would go for tackling the ball from other team player.

Now you see this isnt AI, its just coded to look like an AI ..

Hey Ferrous,

Firstly thnx for showing some direction 'RoboCup Soccer' looks interesting. Secondly why would you say its a shot in the dark ?

I have implemented the AI part but the use of AI word for it would be wrong in my perspective.

Basically i have 3 difficulties PRO,ROOKIE,EXPERT

My algorithm does is that it calculates all the player distance from the goal and sort it in increasing order. Now in

Pro = ball is passed to the 3rd person closest to the goal

Rookie = ball is passed to the 2nd person closest to the goal

Expert = ball is passed to the 1st person closest to the goal

and If team player has the ball i have coded 2-3 attacking formation they pick one and go for the attacking formation else all the player would go for tackling the ball from other team player.

Now you see this isnt AI, its just coded to look like an AI ..

;

That is what AI is, code that is written to appear intelligent :)

More complex rules and evaluation functions can improve the illusion but it will always be an illusion, even a learning AI is just an illusion, i.e, you can make your AI "learn" while playing by adjusting the odds of each attack formation based on how well the player counters it. (allthough it is quite rare for game AI to learn while playing as it has a tendency to make it difficult to adjust the games difficulty)

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Hey Simon,

Thnx for giving me the motivation smile.png

i just wanted to have a professional approach with a proper agent toward the ai of players smile.png

Anyways Simon

if i would have to implement this game in PC what are my possible options and how i should pick the best 1 ?

Hey Simon,

Thnx for giving me the motivation smile.png

i just wanted to have a professional approach with a proper agent toward the ai of players smile.png

Anyways Simon

if i would have to implement this game in PC what are my possible options and how i should pick the best 1 ?

The options are unlimited, team sports are also very complicated.

Personally i would have each agent run its own AI no fixed attack patterns, each agent decides on his own actions based the value of that action. (you can add a bit of randomness to this but high value actions should be far more likely than lower value actions).

The hard part is evaluating the value of an action or location since there are so many factors that contribute to it in a game like hockey.

Basic actions would be:

Move to location, (locations could be evaluated based on their defensive, offensive and support values and the agents role)

Pass to location,

Pass to player (prefer unmarked players or players in strong offensive locations)

Shoot (distance, angle ?, goalkeeper location, friendly agents in better locations ?)

Tackle (Do we have support if we fail ? is the agents location weak enough to warrant the risk ?)

etc.

good evaluation functions and diverse actions will give a fairly good result.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Hey Ferrous,

Firstly thnx for showing some direction 'RoboCup Soccer' looks interesting. Secondly why would you say its a shot in the dark ?

I have implemented the AI part but the use of AI word for it would be wrong in my perspective.

Basically i have 3 difficulties PRO,ROOKIE,EXPERT

My algorithm does is that it calculates all the player distance from the goal and sort it in increasing order. Now in

Pro = ball is passed to the 3rd person closest to the goal

Rookie = ball is passed to the 2nd person closest to the goal

Expert = ball is passed to the 1st person closest to the goal

and If team player has the ball i have coded 2-3 attacking formation they pick one and go for the attacking formation else all the player would go for tackling the ball from other team player.

Now you see this isnt AI, its just coded to look like an AI ..

Shot in the dark, as it's not something I've done myself=) But yeah, what you have there is AI, for video games, that artificial part could also stand for fake, or perhaps simulated or mimicking. It's not real intelligence by any means.

Hey Ferrous,

I also had the same idea that every player should run its own AI agent with evaluation function in it, so are you suggesting that i use heuristic functions to implement the AI ?

I just want to implement a good approach that the AI looks like an AI not a simulation or mimicking stuff :)

This topic is closed to new replies.

Advertisement