From: <he...@us...> - 2014-05-13 14:54:05
|
Revision: 372 http://sourceforge.net/p/simspark/svn/372 Author: hedayat Date: 2014-05-13 14:54:02 +0000 (Tue, 13 May 2014) Log Message: ----------- * Clear Players in GoalLeft/Right before kickoff to make sure that opponent doesn't touch ball at the middle of the field. * Don't enforce crowding rules on kickoff, since opponent should not come near the ball Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-02-19 17:46:49 UTC (rev 371) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-05-13 14:54:02 UTC (rev 372) @@ -547,20 +547,28 @@ for(int unum=1; unum<=11; unum++) { - // I am the third closest player but i am too near the ball (and not the goalie) - if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && - (distArr[unum][idx] <= mMin3PlDistance + 0.01 && ordArr[unum][idx] == 3)) + TPlayMode playMode = mGameState->GetPlayMode(); + if ((playMode == PM_KickOff_Left && idx != TI_LEFT) + || (playMode == PM_KickOff_Right && idx != TI_RIGHT) + || (playMode != PM_KickOff_Left && playMode != PM_KickOff_Right)) { - playerFoulTime[unum][idx]++; - playerLastFoul[unum][idx] = FT_Crowding; + // I am the third closest player but i am too near the ball (and not the goalie) + if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance + && (distArr[unum][idx] <= mMin3PlDistance + 0.01 + && ordArr[unum][idx] == 3)) + { + playerFoulTime[unum][idx]++; + playerLastFoul[unum][idx] = FT_Crowding; + } + // I am the second closest player but i am too near the ball (and not the goalie) + else if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance + && distArr[unum][idx] <= mMin2PlDistance + 0.01 + && ordArr[unum][idx] == 2) + { + playerFoulTime[unum][idx]++; + playerLastFoul[unum][idx] = FT_Crowding; + } } - // I am the second closest player but i am too near the ball (and not the goalie) - else if(unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && - distArr[unum][idx] <= mMin2PlDistance + 0.01 && ordArr[unum][idx] == 2 ) - { - playerFoulTime[unum][idx]++; - playerLastFoul[unum][idx] = FT_Crowding; - } // Too many players inside my own penalty area and Im am the last one to enter or // the last one to enter was the goalie and I am the one further away from own goal else if((numPlInsideOwnArea[idx] > mMaxPlayersInsideOwnArea && unum != 1 && playerInsideOwnArea[unum][idx] == 1 && @@ -1631,7 +1639,11 @@ break; case PM_Goal_Left: + ClearPlayersBeforeKickOff(TI_RIGHT); + UpdateGoal(); + break; case PM_Goal_Right: + ClearPlayersBeforeKickOff(TI_LEFT); UpdateGoal(); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2014-06-02 10:39:26
|
Revision: 378 http://sourceforge.net/p/simspark/svn/378 Author: patmac369 Date: 2014-06-02 10:39:21 +0000 (Mon, 02 Jun 2014) Log Message: ----------- Fixing bug where opponent messaages were incorrectly labeled with a team's own team name. Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-05-30 16:27:30 UTC (rev 377) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-06-02 10:39:21 UTC (rev 378) @@ -1795,12 +1795,16 @@ boost::shared_ptr<Transform> transform_parent; boost::shared_ptr<RigidBody> agent_body; + std::string team = ""; + for ( SoccerBase::TAgentStateList::const_iterator it = agent_states.begin(); it != agent_states.end(); it++ ) { + // Get name of team to label all messages with + team = (*it)->GetPerceptName(ObjectState::PT_Player); if ( (*it)->GetUniformNumber() == number) { (*it)->AddSelfMessage(message); @@ -1818,7 +1822,6 @@ Vector3f relPos = pos - new_pos; relPos = SoccerBase::FlipView(relPos, idx); float direction = salt::gRadToDeg(salt::gArcTan2(relPos[1], relPos[0])); - std::string team = (*it)->GetPerceptName(ObjectState::PT_Player); (*it)->AddMessage(message, team, direction, true); } } @@ -1841,7 +1844,6 @@ Vector3f relPos = pos - new_pos; relPos = SoccerBase::FlipView(relPos, SoccerBase::OpponentTeam(idx)); float direction = salt::gRadToDeg(salt::gArcTan2(relPos[1], relPos[0])); - std::string team = (*it)->GetPerceptName(ObjectState::PT_Player); (*it)->AddMessage(message, team, direction, false); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2014-06-08 07:29:31
|
Revision: 380 http://sourceforge.net/p/simspark/svn/380 Author: patmac369 Date: 2014-06-08 07:29:26 +0000 (Sun, 08 Jun 2014) Log Message: ----------- Fixing a bug where the height of the position of the ball when moved after a failed free kick attempt (for instance a goal kick where the ball is not moved out of the goal box) might not be on the ground. I've seen this happen when manually changing play modes through the training command parser while trying to restore the state of a game from a logfile. Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-06-02 11:08:41 UTC (rev 379) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-06-08 07:29:26 UTC (rev 380) @@ -1271,6 +1271,7 @@ { // update freekickpos mFreeKickPos = mBallState->GetLastValidBallPosition(); + mFreeKickPos[2] = mBallRadius; return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2014-07-06 05:21:13
|
Revision: 384 http://sourceforge.net/p/simspark/svn/384 Author: patmac369 Date: 2014-07-06 05:21:04 +0000 (Sun, 06 Jul 2014) Log Message: ----------- Fixing a bug where rules such as too many players in their own penalty area was not being enforced. Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-06-24 20:58:27 UTC (rev 383) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2014-07-06 05:21:04 UTC (rev 384) @@ -548,27 +548,26 @@ for(int unum=1; unum<=11; unum++) { TPlayMode playMode = mGameState->GetPlayMode(); - if ((playMode == PM_KickOff_Left && idx != TI_LEFT) - || (playMode == PM_KickOff_Right && idx != TI_RIGHT) - || (playMode != PM_KickOff_Left && playMode != PM_KickOff_Right)) + bool checkCrowding = (playMode == PM_KickOff_Left && idx != TI_LEFT) + || (playMode == PM_KickOff_Right && idx != TI_RIGHT) + || (playMode != PM_KickOff_Left && playMode != PM_KickOff_Right); + + // I am the third closest player but i am too near the ball (and not the goalie) + if (checkCrowding && unum != 1 && closestPlayerDist[idx2] < mMinOppDistance + && (distArr[unum][idx] <= mMin3PlDistance + 0.01 + && ordArr[unum][idx] == 3)) { - // I am the third closest player but i am too near the ball (and not the goalie) - if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance - && (distArr[unum][idx] <= mMin3PlDistance + 0.01 - && ordArr[unum][idx] == 3)) - { playerFoulTime[unum][idx]++; playerLastFoul[unum][idx] = FT_Crowding; - } - // I am the second closest player but i am too near the ball (and not the goalie) - else if (unum != 1 && closestPlayerDist[idx2] < mMinOppDistance - && distArr[unum][idx] <= mMin2PlDistance + 0.01 - && ordArr[unum][idx] == 2) - { + } + // I am the second closest player but i am too near the ball (and not the goalie) + else if (checkCrowding && unum != 1 && closestPlayerDist[idx2] < mMinOppDistance + && distArr[unum][idx] <= mMin2PlDistance + 0.01 + && ordArr[unum][idx] == 2) + { playerFoulTime[unum][idx]++; playerLastFoul[unum][idx] = FT_Crowding; - } - } + } // Too many players inside my own penalty area and Im am the last one to enter or // the last one to enter was the goalie and I am the one further away from own goal else if((numPlInsideOwnArea[idx] > mMaxPlayersInsideOwnArea && unum != 1 && playerInsideOwnArea[unum][idx] == 1 && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2015-05-09 15:29:20
|
Revision: 389 http://sourceforge.net/p/simspark/svn/389 Author: patmac369 Date: 2015-05-09 15:29:18 +0000 (Sat, 09 May 2015) Log Message: ----------- Making penalty shootout kickoffs direct. Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2015-04-23 01:45:03 UTC (rev 388) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2015-05-09 15:29:18 UTC (rev 389) @@ -1440,14 +1440,19 @@ return false; } - /* don't allow goals directly from kickoff + /* don't allow goals directly from kickoff (penalty shot kickoffs are + * direct) * * todo it is allowed in FIFA rules, so we should get rid of it e.g. by * adding noise to the beam effector so that kickoff kicks cannot be * precisely planned */ boost::shared_ptr<AgentAspect> agent; - if (WasLastKickFromKickOff(agent)) + boost::shared_ptr<GameControlServer> game_control; + if (WasLastKickFromKickOff(agent) + && (SoccerBase::GetGameControlServer(*this, game_control) + && game_control->GetAgentCount() > 2) // todo: remove this when there is a "penalty" playmode + && !mPenaltyShootout) { PunishKickOffFoul(agent); // Return true so that we know the ball is in the goal and don't check This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2015-05-09 20:31:25
|
Revision: 390 http://sourceforge.net/p/simspark/svn/390 Author: patmac369 Date: 2015-05-09 20:31:23 +0000 (Sat, 09 May 2015) Log Message: ----------- Fixing a bug with free kicks where as soon as the ball was touched, and the playmode transitioned from free kick to play on, the ball was still moved back to the location of the free kick preventing the ball from being directly kicked out of a free kick. Also ensuring that the ball position for free kicks is updated correctly as this wasn't happening right after the ball was placed back at the center of the field after a goal was scored. Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2015-05-09 15:29:18 UTC (rev 389) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2015-05-09 20:31:23 UTC (rev 390) @@ -93,6 +93,9 @@ mBallBody->SetVelocity(Vector3f(0,0,0)); mBallBody->SetAngularVelocity(Vector3f(0,0,0)); mBallBody->Enable(); + // Set the free kick position to where we have moved the ball so as to not + // accidentally use an old ball position for the next free kick. + mFreeKickPos = Vector3f(pos.x(), pos.y(), mBallRadius); } /* Uses only Ball and Players positions and detects overcrowind near ball and areas and @@ -1141,7 +1144,6 @@ mRightPenaltyArea.minVec[1] : mRightPenaltyArea.maxVec[1]; } - MoveBall(mFreeKickPos); //-------------------------- // move away opponent team This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2015-07-09 03:02:49
|
Revision: 396 http://sourceforge.net/p/simspark/svn/396 Author: patmac369 Date: 2015-07-09 03:02:47 +0000 (Thu, 09 Jul 2015) Log Message: ----------- Turning off penalty shootout mode as soon as a goal is scored by the left team so that a later second goal won't be recorded if the goalie leaves the penalty area after the goal was scored. Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2015-06-06 07:28:08 UTC (rev 395) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2015-07-09 03:02:47 UTC (rev 396) @@ -109,6 +109,11 @@ { ResetFoulCounter(TI_LEFT); ResetFoulCounter(TI_RIGHT); + + if (mPenaltyShootout && mGameState->GetPlayMode() == PM_Goal_Left) { + // Cancel penalty shootout mode now that a goal has been scored + mPenaltyShootout = false; + } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |