Soccer AI, can it be done?
GreenfroggGames
Member Posts: 224
I'm planning on making a 1 vs 1 soccer game where you can play against an AI opponent. The Ball will bounce off of walls that are placed around the field. Is it possible to have the AI always trying to hit the ball so that the ball is aimed towards the player goal? Even if it requires the AI to bounce the ball off the wall?
Comments
Absolutely @GreenfroggGames , with a bit of maths and a bit of tables you can make a very intelligent AI soccer team (both opponent and your own). It can get complex though, so start with the small things. Break it down in small problem and master each of them before tackling the big picture.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch Do you mean placing a lot of coordinates in a table?
@GreenfroggGames
Sure, keep track of all the player positions in a table.
That way you can build up logic for each player according to their position (defensive, midfield, attackers), such as passing to other team mates, going for the goal or falling back into formation.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch Sounds great, I'll give it a go. Thanks
I started trying to work this out a while back and got lost, very lost. If it wasn't for the bread crumbs i'd still be lost now..
@smurfted Sounds like I might not want to go down this path
I can't commit enough time to try this myself, but what about a two-players game like tennis or handball as a place to start figuring this out?
@PhilipCC I don't get that much time to work on games nowadays, so this kinda scared me off. Will stick to simple and small games for now. Thanks tough
@GreenfroggGames , @PhilipCC
"Complex" does not equal "Complicated"
One can come up with 2 or 3 very simple rules for each player and have very clever "looking" and complex behavior emerge from it.
Just as a start:
Defence/midfield
Attackers/strikers
Get these simple rules implemented and you already have the semblance of a cooperative team.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch Thanks for the tip. I think I'll do a 1 on 1 game with some fun gameplay twist
True hopscotch. What i started getting lost on was ownership of the ball & control handover. While it was working it didn't feel very smooth..
That said it was a while ago, maybe i should have another bash.
@Hopscotch I love the way you break things down into a simple algorithm.
Once I download Sierra on my IMac I'm going to give those instructions to Siri and see what she comes up with.
the first game i made was a "table football" style. i made it that way because its a more easy approach than having real players running free , the AI its just the bar moving up and down following the position of the ball. So its really not that accurate but it seems that people like it.
so i think its posible to do a simple 1 on 1 soccer style game
good luck!
That gives me an idea for a voice driven soccer app for Alexa, with the gameplay given back as running commentary. Coming soon!
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
I built an AI for my air hockey game. Building a simple AI is a good place to start. The tricky part of building a good AI is adding the human element into it. It's easy to build an accurate AI, it's much trickier to build one that makes mistakes randomly.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS