Giter Site home page Giter Site logo

simplesoccermanager's People

Contributors

dirichi avatar

Watchers

 avatar  avatar

simplesoccermanager's Issues

commentary

ideally this should come during the game events. Perhaps preface them with a key word so that annyang knows to refuse this keyword. Perhaps also use nlp api to generate commentary

enabling user input and control

options include arduino, keyboard, or surface taps.

some algorithms may be affected, e.g. pass/shoot/dribble

an additional attribute for player perhaps, e.g. "isControlled"

user input buttons: longPass, shortPass, shoot, up, down, left, right

weird player movements

keeper sometimes moves like regular outfieldplayers and sometimes players in the "shooter" state keep moving. should be fixed by using statemeachines that determine player movements and are controlled by Game and Team objects.

Suggested states:

  • passing: in this state a player passes to a teammate.
  • receiving: in this state, a player has been passed to. player remains stationary until receives ball
  • shooting: in this state, a player shoots the ball
  • chasingBall: player chases ball
  • dribbling: player dribbles
  • makingAttackingRuns: if behind ball, moves to attacking position, if beyond ball && isStriker, moves to least congested region in opposition third
  • **makingDefensiveRuns:**if beyond ball move back, and stray slightly towards ball-Y direction,else if not in defensive position, move to defensive position,
  • preparingForKickOff:, move to kick off position
  • startingKickOff: go get the ball and start (chaseball mode maybe)
  • startingCorner: go get the ball and start (chaseball mode maybe)
  • startingGoalkick: go get the ball and start (chaseball mode maybe)
  • preparingForCorner: move to corner position
  • preparingForThrowing:, go neutral
  • preparingForGoalKick: move to goal kick position
  • neutral: not moving
  • roaming: choosing between pass, dribble, and shoot

Team controlling player state:

if(teaminAttackState){
    outfieldplayers.setState(makingAttackingRuns)
    keeper.setState(neutral)
    focusPlayer.setState(roaming)
}

if(teamInDefenseState){
    outfieldplayers.setState(makeDefensiveRuns)
    keeper.setState(keepermovement)
    focusPlayer.setState(chaseBall)
}
if(teamInNeutralState){
    allPlayers.setState(neutral)
}

if(teamInKickOffState){
    outfieldplayers.setState(preparingForKickOff)
    keeper.setState(preparingForKickOff)
    if(gameIsReadyForKickOff){
          focusPlayer.setState(chaseBall)

   }



}

and so on and so forth

update host when current host is disconnected

should be fixed sort of like

io.on('disconnect',function(socket){
if(socket==host){
    socket.broadcast.emit(" host exit");
    allUsers.remove(socket);
   setAsHost(allUsers[random(allUsers.length)]);

}

})

function setAsHost(socket){
    socket.broadcast.emit("setAsHost",0);

}

------------client side----------------------------------------------------------
socket.on("setAsHost", function(data){
game.isHost=true;
})

socket.on("host exit" function(data)){
    game.allPlayers.moveWithStoredVelocity()
    game.ball.moveWithStoredVelocity()

}

dribbling

players only move forward when dribbling
instead let's have them actually respond to markers

Example

if(state==dribble){
    if(noPlayerInFrontWithinXRadius){ 
        moveForward();    
    } 
    else{
        moveAwayFromPlayers(ArrayOfPlayersinXRadius)

    }
}
moveAwayFromPlayers(playersArr){
    var allAnglesOfMotion=[-180,-150,-130....180]
    var escapeAngle;
    for(player:playersArr){
        var centralAngle=getAngleToPlayer();
        var leftMostAngle=getLeftMostAngleToPlayer() //get angle to player.x/ypos-player._width
        var rightMostAngle=getRightMostAngleToPlayer() //get angle to player.x/ypos+player._width
        allAnglesOfMotion.remove(central,leftmost,rightmost)

    }
    escapeAngle=pickAngleAtRandomFrom(allAnglesOfMotion)
    this.moveAtAngle(escapleAngle)

}

enable multiple players

socket already permits users to see other users playing different games at the same time. let's get multiple users to play the same game

fulltime animation needed

perhaps give a full time state for teams, and players. in this time, there is no drain of morale of team players. there ought to be crowd cheering, and the players stand still

keeper movement

quite buggy. needs to either go side to side more quickly or chase ball when within a certain radius

enable human controlled players to call for the ball

ie if the team has ball, let the human controlled player send a message to the current player in possession,

if the focus player is computer controlled, it looks through his/her "messages" and for those players in its messages that have called for the ball, it artificially increases their attackingPositionrating, so as to give a better chance of passing to them

if the focus player is human controlled, the messages (from other human controlled players?) pop up on the respective sockets screen

incorporating socket

This, Dear Friends, Is Where Sh#@ Gets Real

  • for each newly created game the socket server will create a separate namespace or room
  • new users can access each of these rooms by choosing a game to join
  • on the client side:
    • there should be a function continually runs that ascertains the "speed of the game" or speed of computer. this is emmitted to all users in the room. The
    • every user also emits the position of all the players controlled by the computer, and their orientation, morale, dx, dy, speed
  • on the server side:
    • the slowest socket is chosen as the "controller " of the game. essentially, all the game logic for the computer controlled objects is run on the slowest socket. yet each socket/user controlls the specific player that they have chosen
      -the speed attribute or dx/dy of players is also determined by the slowest socket

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.