Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeAction() waits forever #261

Closed
Ohsaworks opened this issue Oct 13, 2017 · 4 comments
Closed

makeAction() waits forever #261

Ohsaworks opened this issue Oct 13, 2017 · 4 comments

Comments

@Ohsaworks
Copy link

The function "DoomGame::makeAction()" suddenly stalls after several (100-500) steps performed.
I guess there is something infinite loop in advanceAction() such as WaitForDoomWork() while makeAction is performing.
https://github.com/mwydmuch/ViZDoom/blob/6232e1770d1ae78a8da66e2fc7ceaa0278c982cb/src/lib/ViZDoomGame.cpp#L160
https://github.com/mwydmuch/ViZDoom/blob/f8fc04e8590ffa7cb500e1dbfbdecb6ffdcf3f9d/src/lib/ViZDoomController.cpp#L1060

But I don't know exactly what is the problem.

Here is the description of my implementation:

  • Python 3
  • Multi-agent environment (two agents connect to a same environment simultaneously)
  • RepeatFrames >= 3 (somehow it works if RepeatFrames <= 2)
  • Health = 100% (perhaps, death is not a reason for stopping)

Does anyone have any idea for a solution?

@wjaskowski
Copy link
Collaborator

wjaskowski commented Oct 13, 2017 via email

@Ohsaworks
Copy link
Author

Sure. Here is the code to reproduce:
https://gist.github.com/Ohsaworks/90407ffb015fd06f243b2c8222c94aab

The code is on a setting as same as the one which I mentioned in the issue above.

  • Python 3
  • Multi-agent environment (two agents connect to a same environment simultaneously)
  • RepeatFrames >= 3 (somehow it works if RepeatFrames <= 2)
  • Health = 100% (perhaps, death is not a reason for stopping)

So, you can run it on python3. For example:
$ python3 template_multi.py

Then get:

AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
Press 'Q' to abort network game synchronization.
Contacting host: /AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
Press 'Q' to abort network game synchronization.
Got connect from node 1.                
Waiting for players: .. [ 2/ 2]
Sending all here.                       

Total players: 2                        

Waiting for other players: .. [ 2/ 2]
Console player number: 1                
Received All Here, sending ACK.         

Go                                      
Total players: 2                        

Console player number: 1                
Received All Here, sending ACK.         
Received "Go."                          

Total players: 2                        

Found Player1 (node 1, player 1)        
Found Player2 (node 1, player 2)        
Found Player2 (node 0, player 2)        




Episode #1
piyo 10
host before
hoge 10
guest before
host after
(...never awake...)
^CTraceback (most recent call last):
  File "template_multi.py", line 114, in <module>
    host_player()
  File "template_multi.py", line 62, in host_player
    game.make_action(choice(actions), frame_repeat)
vizdoom.vizdoom.SignalException: Signal SIGINT received. ViZDoom instance has been closed.

As you can see, the code stalls in game.make_action.
This is why I have speculation that makeAction stops.

The issue somehow depends on a parameter RepeatFrame.
Though I set the RepeatFrame = 10 (line 11) in the code,
you can also confirm the issue won't appear if RepeatFrame = 2.
Please try to make sure the issue occurs by running the code.

@Miffyli
Copy link
Collaborator

Miffyli commented Oct 16, 2017

Just pitching in that it indeed gets stuck in same for me (Ubuntu 16.04, VizDoom 1.1.4, Python 3.5), but using ASYNC_PLAYER seems to work (albeit it is not too good for training). This seems very related to #228 , but back then SYNC worked to some extent.

(PS: You might want to use scenarios designed for multiplayer/deathmatch, such as "cig.cfg", just to make sure it is not the config/scenario breaking things up :) )

@jkterry1
Copy link
Member

jkterry1 commented Oct 7, 2024

Hey,

I'm going to close this issue since there haven't been any new updates ~8 years. If anyone has this bug again, please reply here or create a new issue :)

@jkterry1 jkterry1 closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants