From: Hesham <hes...@gm...> - 2007-02-05 11:02:16
Attachments:
soccerruleaspect.cpp
|
Hi Joschka and Junqing Wang, Sorry for the long delay. I couldn't answer earlier, that's a long story. Anyway, Junqing Wang, thank you so much for your report. I'm afraid, I didn't understand some parts of the report. Actually, if (mGameState->GetTime() != time) { return false; } isn't necessary. That was there to be sure when a new collision doesn't occur it doesn't go through the offside code. To get rid of it, there is a simple solution, please take a look at the attached file. So far as I noticed for the next version there is no offside. In December I was working on refactoring the offside code (I promised Joschka to finish it before January but I couldn't). Since it was my first code for the server I mad a big mistake in its design and that caused a lot of problems in debugging. Anyway, I got rid of my problems and have more free time. Since working on the offside doesn't make sense, I wonder if there is something that I can work on for the new server. (I'm following the discussion regarding multi-thread) With kind regards, Hesham On 12/21/06, w jq <wj...@ho...> wrote: > > Offside Bug Report > > As all we known that the offside rule in simulator was not perfect. Today > I > don`t want to > > complain about it, but to solve the problem. > > I have watched many many matches . Some team took the advantage of this > bug:Shooting the > > goal when they were offside. > > how could they do this ?how could some team can`t do this? > > The truth is that this team`s players don`t HIT the ball when they are > attacking.they just > > kick the ball. > > so I thought there must be something wrong with "Last kick agent". > > > Thus, I refered to the function > void > Ball::PrePhysicsUpdateInternal(float deltaTime) in ball.cpp > > The agent who kicked the ball is recorded , everything seems to be OK. > > Then ,I refered to the function > bool > SoccerRuleAspect::CheckOffside() > > Add some print code. > /*****************************************/ > if (mGameState->GetTime() != time) > { > GetLog()->Error() > << "ERROR: (SoccerRuleAspect) "<<mGameState->GetTime()<< " " > << > time <<endl; > return false; > } > /******************************************/ > Then ,when my player was dribbling. I thought the statement > (mGameState->GetTime() != time) > shall be FALSE sometimes,but things turned out to be not the same as I > thought. > > .... > ERROR: (SoccerRuleAspect) 13.017 13.007 > ERROR: (SoccerRuleAspect) 13.027 13.017 > ERROR: (SoccerRuleAspect) 13.037 13.027 > .... > After I refered to the function > void SimulationServer::Step() in Simulationserver.cpp > , I found the bug. > /*****************************************/ > mSceneServer->Update(mSimStep); > mGameControlServer->Update(mSimStep); > /*****************************************/ > After Update the Physics(UpdateLastCollidingAgent), > the sim time will add one sim step. > > As a result , if there is a agent kick the ball, the record time will > aways > be 0.01 > earlier than current time. > > > > One of the possible solutions: > > Add a bool member "mRecordTimeForKick"to class BallStateAspect > > Modify: > void > BallStateAspect::UpdateLastCollidingAgent(boost::shared_ptr<AgentAspect> > agent) > { > mLastCollidingAgent = agent; > mLastAgentCollisionTime = mGameState->GetTime(); > } > -> > void > BallStateAspect::UpdateLastCollidingAgent(boost::shared_ptr<AgentAspect> > agent) > { > mLastCollidingAgent = agent; > mRecordTimeForKick = true; > } > > Add "mRecordTimeForKick = false;" to > BallStateAspect::BallStateAspect() : SoccerControlAspect() > > Add " > if(mRecordTimeForKick) > { > mLastAgentCollisionTime = mGameState->GetTime(); > mRecordTimeForKick = false; > } > " to the end of the function -- > void BallStateAspect::UpdateLastCollidingAgent() > > > > > /****************************End of > report*****************************************/ > > Author:Junqing Wang > Team: Apollo3D , Nanjing University of Posts & Telecommunications, China > > _________________________________________________________________ > 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Sserver-three-d mailing list > Sse...@li... > https://lists.sourceforge.net/lists/listinfo/sserver-three-d > > |
From: Joschka B. <jbo...@un...> - 2007-02-05 15:59:37
|
Hi Hesham, Hesham wrote: > Sorry for the long delay. I couldn't answer earlier, that's a long > story. Anyway, Junqing Wang, thank you so much for your report. I'm > afraid, I didn't understand some parts of the report. Actually, > if (mGameState->GetTime() != time) > { > return false; > } > isn't necessary. That was there to be sure when a new collision > doesn't occur it doesn't go through the offside code. To get rid of > it, there is a simple solution, please take a look at the attached file. thanks for the updated file. I added you to the sserver project on SourceForge, so could you please commit your changes to the CVS? And please also snyc with the simspark CVS. > > So far as I noticed for the next version there is no offside. In > December I was working on refactoring the offside code (I promised > Joschka to finish it before January but I couldn't). Since it was my > first code for the server I mad a big mistake in its design and that > caused a lot of problems in debugging. Anyway, I got rid of my > problems and have more free time. Since working on the offside doesn't > make sense, I wonder if there is something that I can work on for the > new server. (I'm following the discussion regarding multi-thread) Well, I'm not sure yet, whether activating the offside in the competition makes sense yet (since some teams might not even be able to move very much), but at least for the GermanOpen etc., I'd like to have a version as bug-free as possible. But I'm also sure we find some other work for you, don't worry ;-) Thanks again, Joschka |
From: Hesham <hes...@gm...> - 2007-02-06 02:57:38
|
On 2/5/07, Joschka Boedecker <jbo...@un...> wrote: > > thanks for the updated file. I added you to the sserver project on > SourceForge, so could you please commit your changes to the CVS? And > please also snyc with the simspark CVS. OK. I'll commit it asap. Well, I'm not sure yet, whether activating the offside in the > competition makes sense yet (since some teams might not even be able to > move very much), but at least for the GermanOpen etc., I'd like to have > a version as bug-free as possible. But I'm also sure we find some other > work for you, don't worry ;-) Thanks :-) Cheers, Hesham |