GithubHelp home page GithubHelp logo

ai_football's People

Watchers

 avatar  avatar

ai_football's Issues

Advert Idea

people yelling at footballers on TV telling them what do
people yelling at fifa game telling players what to do

"complete control over your team's every move"

"learn to program!"
"master the beautiful game!"

Player AI DSL

Have a Domain Specific Language for the AI?

Example:

function nearest_team_mate() -> Player
    all_team_mates = $game.players[$self.team]
    all_team_mates.sort { |a, b| -> bool
        distance_squared_a = (a.position - $self.position):magnitude_squared()
        distance_squared_b = (b.position - $self.position):magnitude_squared()
        return distance_squared_a < distance_squared_b
    }
    return team_mates.first
end

function goal_mouth() -> Position
    return $game.pitch.positions.goal[$self.team]
end

context goal_kick (goal_kick_team)
    return if goal_kick_team != $self.team
    pass("punt", nearest_team_mate($self, $game))
end

context kickoff (kickoff_team)
    moveTowards(goal_mouth())
end

context interrupt (command, shouter)
    // Ignore all commands
end

context goal_kick (goal_kick_team)
    return if goal_kick_team != $self.team
    pass("punt", nearest_team_mate($self, $game))
end

context penalty (penalty_team)
    moveTowards(goal_mouth())
    // TODO: dive in a direction
end

context tick
    if $self.has_ball 
        if $self.holding_ball  // will only ever by true for goalkeepers
            $self:pass("throw", nearest_team_mate($self, $game)) // or roll?
        else
            $self:pass("drop", $self)
            $self:pass("sidefoot", nearest_team_mate($self, $game))
        end
    else
        // TODO: if shot then try to save
        // TODO: else position self on goal line at approp place
    end
end

Match Statistics

as well as recording goals, record other events.

  • yellow cards/red cards (although i guess currently there's no way to get these)
  • offsides
  • passes (and whether they connect or not)
  • shots (and whether they're on target)
  • goals
  • corners
  • penalties

but also useful data that wouldn't be shown to user until better processed

  • team gained/lost possession (to work out %)
  • throw ins

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.