Jump to content
  • Advertisement
Sign in to follow this  

what AI should i use

This topic is 2868 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am looking for advice.

i am making a dodge ball type game. where the player trys to remove the ball from themself. this is done by throwning and hitting another player with the ball. the players will have spells that will help in this task.

in this game i would like to add bots. but i don't know which technec to use.

any advice would be helpful.

Share this post

Link to post
Share on other sites
I have to agree with above... the game doesn't define the AI. The actions that agents take defines the AI. If you list actions, we can list techniques. Of course, once you actually start to list actions, the AI should start to take shape anyway.

Share this post

Link to post
Share on other sites
So the standard technique I've been using for AI for about 10 years (and 7 games) now...

1) Enumerate all of the things that the AI can do. Dodge. Throw ball. Catch ball. Run over to ball. That might be it for this game?

2) You need a way to pick one of those to do. I usually have an evaluator function that scores each one and selects the best (or picks one randomly, using the score as a weight - I've done it both ways). This is small and simple enough (if that really is all the possible actions) that a finite state machine might work better.

3) That's your high-level AI. Now you need to write the low-level AI that handles actually executing those. I.E. turning toward the ball, running over to it, picking it up, turning toward the player, throwing it, etc.

Share this post

Link to post
Share on other sites
OK thx so fare been a lot of help. as for actions here goes:

the idea is that there is only one ball in the game and this ball removes life. pawns (AI and Players) will try and remove the ball from themself.

the ball can't be dripped. it can only be thrown.

the ball is attached to a pawn and is only de-attached when another pawn is hit by the ball (the ball will then be attached to the pawn that was hit). if the ball is thrown and misses then it returns to the pawn that throw it.

life can only be lost by two means
- the pawn has the ball in their hands
- the pawn is hit by the ball

while the ball is in the air and not in the pawn's hands, no life is being lost. this means the pawn can tose the ball knowing it will return to them and just run losing no life in the process.

the ai should

- run for another pawn, when in possession of the ball, trying to get in range (need to choose which pawn to go for)
- run from the pawn that has the ball.
- use objects and other pawns in the level to sheild themself from the ball holder.
- run from the ball when the ball is tost at them
- tost the ball at nothing then run from ball
- when running from ball try to make ball hit another pawn.

- pick from a number of spells that will help to do the above. E.G. blink, dodge, reflect

also there will be 4 types of pawns

- strong, will run faster and longer, can block
- healthy, has more health
- wise, spell related pawn
- nimble, better at evading the ball

all will act in a different way

- will run from ball holder and try to block when needed
- will run for player, when has the ball.

- will hid from ball holder
- will run for player, when has the ball

- will use spells to keep out on range of ball holder.
- will use spells to get in range and throw ball.

- will evade the ball, shouldn't get ball that often
- will run for player, when has the ball. hard to remove ball.

Share this post

Link to post
Share on other sites
Sounds like you've got the hard part done - you know what the AI needs to do broken down. What keeps you from just using if/then/else to implement each player type?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!