Idea soccer, AI and the referee

sylvain_l

Member
I try to train myself on AI within soccer because it as a limited number of AI within a ruleset I understand and a game I don't care too much about (if it goes wrong, not perfect and the AIs do silly thing it's funny, not frustrating like in 4x).


But I realised that until now, I just implemented the rules as absolute (AI don't commit any foul, they always avoid offside, etc... ); not really soccer as played by humans :D (well honestly it's not already soccer when its 2D and no real physics)

Things are getting interesting adding an additionnal new kind of AI (referee), but also a bit out of my field.

Any Idea/suggestion how to implement a good referee (and assistants) in there ?
(I know what a referee is without knowing :confused: and google is more confusing me than helping: like https://www.google.ch/search?q=what+makes+a+good+soccer+referee give a lot of things to thought about... )
 
Well, I would say the ref having the rules hard-coded would be a good idea (ref variability INFURIATES football players, seriously, watch a controversial call with an Englishman around and you'll see). Players will get very angry if the ref 'randomly' makes a bad call because of AI. The AI for the actual players is harder. Perhaps mixing a FSM with a GOAP system could give you the flexibility to have the AI players break the rules sometimes. You could increase the priority of illegal moves if the AI team is behind, or even have 'aggression' variables within the players that add variability as to how likely they are to break the rules.
 

Yal

šŸ§ *penguin noises*
GMC Elder
I'd say what makes the most sense is something like this:
  • The referee takes rules as absolute and punishes any AI player breaking rules it can see, but has a limited vision range.
  • The referee tries moving and rotating so that it can see the ball and as many players as possible, but randomly casts glances in other directions if they haven't payed attention to certain players in a while.
  • Players can, if it would be beneficial, break rules if they think they're outside of the referee's view, but they can't actually access the referee's variables to check they're truly out of it.
  • The chance that a player breaks rules, and the chance that they estimate the judge's FOV correctly, are both based on the player's skills (moral and perception, or whatever).
 

sylvain_l

Member
(ref variability INFURIATES football players, seriously, watch a controversial call with an Englishman around and you'll see).
<3 this is a great idea. I didn't really thought before of the referee whistling a foul, when there was non..., and impact of angriness of players. (having insulting or fighting but not comming soon. Yet I even not have simply some basic push&pull - kickoff and throw-in are really barebone: player teleported to the position and immediat pass to nearest teammate )

  • The referee takes rules as absolute and punishes any AI player breaking rules it can see, but has a limited vision range.
  • The referee tries moving and rotating so that it can see the ball and as many players as possible, but randomly casts glances in other directions if they haven't payed attention to certain players in a while.
  • Players can, if it would be beneficial, break rules if they think they're outside of the referee's view, but they can't actually access the referee's variables to check they're truly out of it.
  • The chance that a player breaks rules, and the chance that they estimate the judge's FOV correctly, are both based on the player's skills (moral and perception, or whatever).
well, for now, referee is invisible (to prevent buggy inteception when player pass or run through him :p) and just move back and forward in middle of the field. always looking at the ball.
I started with just a % of fool detection depending of the distance of the action. and get to 0% in case there is a player in the direct line of sight.

technically actually I have only 2 fools (a % when a player collide with the player with the ball to get the ball, and when tackling collide a player there is also a high % if the tackle miss the ball). offside are gone, I need to get them back (I thought that a thing assistants referee are responsible for)

Actually I really struggle to see how to move the referee around; how to make him evaluate a "good position (as every players and the ball are moving around)"
actually moving when his % of detecting a foul <90% -has the good effect of also getting trigerred when is sight of the ball is blocked- and direction is based on position & direction of the ball - but it's a bit silly as referee is stuck in middle of the field, when player are playing in the border of the field :D). I'll test what happen if I free him whit that rule "as is"
 
Top