Wednesday 23 April 2014

Frustrations

I've been stuck on the same problem for a couple of weeks now. It's really annoying. The game has reached a level of complexity where it's really tough to address difficult issues in one or two hour spurts every so often.

Basically, because of the complexity of the AI system (to allow for more interesting stuff later), it is a big job in itself just to try out a particular approach. There are 4 different levels of state machines :

1.  the player at the physical level  - standing, running etc. (handles "locomotion" details)

2. the player at the decision making level - the "brain" which instructs the physical level player to go into a "running" state for example. The brain can be in a "covering" state where it basically analyses where the ball is and tells the physical player to run to a suitable position. Or a dribbling state where it tells the player where to dribble to, or decides to pass, shoot or clear the ball.

3. the team states. For example when a team is in a "defending" state the players are aware of this and can go into a "cover" state as opposed to a "support" state for an attacking team.

4. the match states - for example "kickoff", "throwin" etc. which feeds into both teams so they can select the correct state for themselves and their players.

So you can see, in tweaking the architecture of how the whole thing works together, it sometimes gets rather intimidating and something you'd want to tackle (excuse the pun) in more concentrated blocks of work (as opposed to 30 mins tonight, and then an hour in 5 days when you've completely lost your flow of thought already.)

Anyway, it's annoying because the thing is so close to  actually being a complete game of football. The specific issue I'm having now is merely the transition of possession when two players are vying for control of the ball at the same time. It sounds trivial but there are a lot of domino like effects and implications for the system of state machines in handling who is actually dribbling the ball.

If a player can't recognize correctly that he should be dribbling as opposed to pressing the ball, he'll constantly chase after the ball whilst dribbling at the same time, resulting in him running blindly in a straight line - ARRRGHH!


No comments:

Post a Comment