AI can be pretty single minded and still be fun to try to overcome. It does not necessarily take too many rules. What you do have to do is to decide what AI you want to program.
Do you want to have the opponent block you? Then a rule to make him move in front of you is all you really need.
Do you want him to sneak ahead of you and arm a trap? That's more complicated.
Start simple, and see if that provides good entertainment. It does not have to be overly complicated to be challenging.
barkbark00 said: American football, or real football??
You mean the football where there are MASSIVE, bone-crunching tackles and no one cries or the one where people pretend to hurt themselves and everyone cries... and take their shirts off... and cuddle shirtless... and pat each other on the bum?
And before anyone makes a joke about the helmets and pads and American players being pussies... I think you'd want a LITTLE protection when being hit head on by a 400lb linebacker!
You would need to track the position of the 'ball' and have your Ai move to it every x seconds. You would also want to include that the AI cannot go over the halfway line so the above rule would need to be wrapped in a rule.
i.e.
1st off contrain the 'balls' x and y position to new attributes called something like ball_x and ball_y.
Then you need a rule on your Opponent Actor
if ball_x is < 240 (halfway landscape) Rule - Every 0.5 seconds, move to ball_x and ball_y or interpolate to ball_x and ball_y
You'd need to play with timings to get the appropriate level of hardness required
You would then need collide rules and will need to set things like density and restitution to get the feel right.
Thats a rough idea and is one way you could achieve it, it doesnt mean its the best way.
Hope thats enough to get you thinking and going
You'll need to play with all of this, New rule on your
beefy_clyro said: You would need to track the position of the 'ball' and have your Ai move to it every x seconds. You would also want to include that the AI cannot go over the halfway line so the above rule would need to be wrapped in a rule.
i.e. Thanks)) I will try IT!!
1st off contrain the 'balls' x and y position to new attributes called something like ball_x and ball_y.
Then you need a rule on your Opponent Actor
if ball_x is < 240 (halfway landscape) Rule - Every 0.5 seconds, move to ball_x and ball_y or interpolate to ball_x and ball_y
You'd need to play with timings to get the appropriate level of hardness required
You would then need collide rules and will need to set things like density and restitution to get the feel right.
Thats a rough idea and is one way you could achieve it, it doesnt mean its the best way.
Hope thats enough to get you thinking and going
You'll need to play with all of this, New rule on your
Usually you have make a grid on paper. The grid is like a reference chart. On one side you have the possible situations and the other the actions it will do. Then add a little bit of randomness. Then you convert your chart into code. From it you will get "if then" statements or in GS's case "rules"
First I would think about what I do when I play the game. Really break it down into stages.
When I cannot hit the ball I tend to follow the balls x position loosely. Looser the nearer it is to the opponent. Then I am in defense mode.
When I am getting ready to hit the ball I follow the balls x position and wait until the ball enters a reachable area. An invisible actor may denote a reachable area.
When I can hit the ball I tend to pull back(y axis) and then move quickly towards the ball's x,y axis to hit it.
There is also anticipating rebounds. This may get into a math area I cannot go to.
At first get a computer opponent who cannot be beaten. It always blocks the goal and hits the ball. Then loosen the timing so there is a little random delay. Play with different ways to follow the balls x position. Maybe use different methods for different parts of the pitch.
You will never be finished but just define clearly what you want to get achieved.
Comments
its going to be a challenge.
www.marcosriffel.com
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Do you want to have the opponent block you? Then a rule to make him move in front of you is all you really need.
Do you want him to sneak ahead of you and arm a trap? That's more complicated.
Start simple, and see if that provides good entertainment. It does not have to be overly complicated to be challenging.
Hope this helps...
How Air Soccer from Pedalagames http://gamesalad.com/forums/topic.php?id=8603
Thanks)
i.e.
1st off contrain the 'balls' x and y position to new attributes called something like ball_x and ball_y.
Then you need a rule on your Opponent Actor
if ball_x is < 240 (halfway landscape)
Rule - Every 0.5 seconds, move to ball_x and ball_y or interpolate to ball_x and ball_y
You'd need to play with timings to get the appropriate level of hardness required
You would then need collide rules and will need to set things like density and restitution to get the feel right.
Thats a rough idea and is one way you could achieve it, it doesnt mean its the best way.
Hope thats enough to get you thinking and going
You'll need to play with all of this,
New rule on your
First I would think about what I do when I play the game. Really break it down into stages.
When I cannot hit the ball I tend to follow the balls x position loosely. Looser the nearer it is to the opponent. Then I am in defense mode.
When I am getting ready to hit the ball I follow the balls x position and wait until the ball enters a reachable area. An invisible actor may denote a reachable area.
When I can hit the ball I tend to pull back(y axis) and then move quickly towards the ball's x,y axis to hit it.
There is also anticipating rebounds. This may get into a math area I cannot go to.
At first get a computer opponent who cannot be beaten. It always blocks the goal and hits the ball. Then loosen the timing so there is a little random delay. Play with different ways to follow the balls x position. Maybe use different methods for different parts of the pitch.
You will never be finished but just define clearly what you want to get achieved.
Hope this helps