LARG / HFO

Half Field Offense in Robocup 2D Soccer
MIT License
230 stars 93 forks source link

Exp2 #9

Closed uniq10 closed 8 years ago

uniq10 commented 8 years ago

Hi Matthew,

Prof. Shivaram had asked us to permanently remove the non HFO players. We are directly using the sample_player binary rather than the start.sh script so that we get each individual player pid's which is later used to kill the unnecessary players.

Please check if this is fine.

mhauskn commented 8 years ago

Thanks for the PR. The simulator runs much faster without the other agents connected!

One problem I've noticed is that games start before the player-controlled-agent has connected.

More comments to follow.

mhauskn commented 8 years ago

When testing on OSX, the game doesn't start because the trainer never gets past the checkIfAllPlayersConnected call. The players never report in. The problem stems from too small a wait time between starting / terminating players. See in-line comments below.

uniq10 commented 8 years ago

Alright.

I wasn't able to replicate the game staring before agent connection problem on Ubuntu 15.04.

Will change the sleep value and report.

mhauskn commented 8 years ago

Yeah, things work correctly for me on Ubuntu. OSX is just weird... But the weirdness existed prior to this PR. So after you change the sleep values, this looks good.

mhauskn commented 8 years ago

Actually on Ubuntu, the following command does not work correctly:

(./bin/HFO --offense-agents=1 --offense-npcs=0 --no-sync &) && ./example/hfo_example_agent

Instead of having an offense agent, we get an offense npc. The offense agent then dies:

matthew@drogba:~/projects/HFO$ (./bin/HFO --offense-agents=1 --offense-npcs=0 --no-sync &) && ./example/hfo_example_agent
[Agent Client] Connecting to Agent Server on port 6000
[Trainer] Launching Agent 0
[Trainer] Something necessary closed (offense_agent_0), exiting
[Trainer] TotalFrames = 0, AvgFramesPerTrial = nan, AvgFramesPerGoal = nan
[Trainer] Trials             : 0
[Trainer] Goals              : 0
[Trainer] Defense Captured   : 0
[Trainer] Balls Out of Bounds: 0
[Trainer] Out of Time        : 0
[start.py] Cleaning up server and other processes
[Agent Client] ERROR Unable to communicate with server: Connection refused

On further inspection this seems to be caused by the no-sync flag.

uniq10 commented 8 years ago

This problem is gone when I added sleep time after the agent connect too.

I noticed another common problem in this pull request and also in the master branch. When --no-sync is set the npcs do not wait for agent connect. They start playing before the agent connects.

mhauskn commented 8 years ago

Cool, can you push your changes so this PR gets updated?

mhauskn commented 8 years ago

Hey, just wanted to make sure this thread doesn't go stale. Can you push the changes so I can verify that examples work correctly?

uniq10 commented 8 years ago

Sorry about that was a bit busy with Sarsa. Will push it immediately.

mhauskn commented 8 years ago

Testing on another Ubuntu box, the basic single agent offense example is still giving me the same error described above even without --no-sync flag.

An alternative way of going about this would be to not kill the un-needed team members until after everyone has joined. I'll poke around tomorrow and see if I can figure something out...

mhauskn commented 8 years ago

Hey, I did some refactoring to your PR. Tried to create a PR against your PR, but things weren't looking right. So I just made a separate PR. Can you take a look at it and make sure everything looks alright? https://github.com/mhauskn/HFO/pull/12/

On Thu, Oct 8, 2015 at 2:22 PM, UNiQ10 notifications@github.com wrote:

Sorry about that was a bit busy with Sarsa. Will push it immediately.

— Reply to this email directly or view it on GitHub https://github.com/mhauskn/HFO/pull/9#issuecomment-146661790.

mhauskn commented 8 years ago

Addressed by PR #12