Farama-Foundation / ViZDoom

Reinforcement Learning environments based on the 1993 game Doom :godmode:
https://vizdoom.farama.org/
1.74k stars 404 forks source link

Access to the top down map #84

Closed shehroze37-zz closed 8 years ago

shehroze37-zz commented 8 years ago

In the binding file, the button binding for top down map is listed but cant get access to the map. How can I get the top down map ?

mwydmuch commented 8 years ago

It's not available as a button for agent, but you can use game.send_command("togglemap"). EDIT: Should we add it as a button?

shehroze37-zz commented 8 years ago

Yesh I think getting access to the top down map will be useful as well. is it possible to get the map from the game state ? Cheers :-)

shehroze37-zz commented 8 years ago

When I call game.send_game_command("togglemap") it gives me a segmentation fault.

wjaskowski commented 8 years ago

When I call game.send_game_command("togglemap") it gives me a segmentation fault.

Works for me. Could you show an example that triggers the segfault? (Btw. note that map nor any command are unavailable during the competition).

shehroze37-zz commented 8 years ago

I'm running it in the spectator file with deadly corridor scenario.

game.send_game_command("togglemap")

game.add_game_args("+freelook 1")

game.set_screen_resolution(ScreenResolution.RES_640X480) game.set_render_hud(False) game.set_render_weapon( True ) game.set_window_visible(True) game.set_mode(Mode.SPECTATOR)

game.init()

wjaskowski commented 8 years ago

Put it after init() and new_episode()

On 9 June 2016 at 14:14, Shehroze Bhatti notifications@github.com wrote:

I'm running it in the spectator file with deadly corridor scenario.

game.send_game_command("togglemap")

game.add_game_args("+freelook 1")

game.set_screen_resolution(ScreenResolution.RES_640X480) game.set_render_hud(False) game.set_render_weapon( True ) game.set_window_visible(True) game.set_mode(Mode.SPECTATOR)

game.init()

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Marqt/ViZDoom/issues/84#issuecomment-224876963, or mute the thread https://github.com/notifications/unsubscribe/AEuSHa7t1sCxFQjeIDwYLgjhaM0Y0vm-ks5qKAOzgaJpZM4Iw7Uh .

shehroze37-zz commented 8 years ago

The binding for the map is tab but still not getting the map when I press tab. Do I need to change something in the binding file?

mihahauke commented 8 years ago

No. W don't expose this button. It may change in the future though.

mwydmuch commented 8 years ago

Only buttons added as available works in spectator mode. Additional bindings like togglemap, toggleconsole or showscores are disabled - commands are blocked, so game.send_command("tooglemap") will not work. In player mode commands are not filtered.

I have the idea to render the map on the another buffer and make it available as an additional channel. Possible that I will add it, but not in the near future.

mwydmuch commented 8 years ago

Top down map is now implemented as separate buffer on 1.1-dev branch. See buffers.py example. Additional options will be added to the api soon.

mwydmuch commented 8 years ago

Configuration options have been added some time ago. I think this feature is complete.

shehroze37-zz commented 8 years ago

The map for deathmatch is only partial. It does not show the whole environment !

mwydmuch commented 8 years ago

Somehow I did not notice that. Fixed, now map will follow the player. Thank you @shehroze37.

QingyuanWuNothing commented 7 months ago

Dear maintainer, would you mind giving some examples that how to access the top-down map? The link shown above cannot be accessed. Cheers :)

mwydmuch commented 6 months ago

Dear @QingyuanWuNothing, sorry for the long response time. Please see: https://github.com/Farama-Foundation/ViZDoom/blob/master/examples/python/automap_buffer.py - in this example, a top-down map is rendered as a buffer (an image).

and:

https://github.com/Farama-Foundation/ViZDoom/blob/master/examples/python/objects_and_sectors.py - in this example, a map is provided as a set of vertices and edges.