ppaquette / gym-doom

Gym - Doom environments based on VizDoom.
102 stars 30 forks source link

How can I move the player? #6

Closed frala19871987 closed 7 years ago

frala19871987 commented 7 years ago

Hi please, can you show me how to move the player left, right and show for the DoomBasic-v0? I understand that it needs an action made of 43 integer ..

Thanks

ppaquette commented 7 years ago

To move left:

actions = [0] * 43   # Create an array of 43 zeros
actions[11] = 1      # MOVE_LEFT (Set index 11 to 1)

This will create an array where item with index 11 is 1 (i.e. [0,0,0..,0,1,0,...,0,0,0]

Use set index 0 to 1 for ATTACK set index 10 to 1 for MOVE_RIGHT set index 11 to 1 for MOVE_LEFT

frala19871987 commented 7 years ago

OK thanks I'll try now.

Thanks

frala19871987 commented 7 years ago

Hi, I'm sorry to reopen it. Is there a way to see how to describe all the possible movement like left, right, forward, back and shot? I would suggest to maybe create a module for each example you make like mario and doom. I think after that a user could just do player.left() or similar.

Thanks

ppaquette commented 7 years ago

There is a documentation per level, and one documentation for all commands (not all commands can be used on all levels).

You can also use a wrapper to convert the action space to a discrete or continuous action space.