Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
help="Path to the configuration file of the scenario."
" Please see "
"../../scenarios/*cfg for more scenarios.")
args = parser.parse_args()
game = vzd.DoomGame()
# Use other config file if you wish.
game.load_config(args.config)
game.set_render_hud(False)
game.set_screen_resolution(vzd.ScreenResolution.RES_640X480)
# Set cv2 friendly format.
game.set_screen_format(vzd.ScreenFormat.BGR24)
# Enables labeling of the in game objects.
game.set_labels_buffer_enabled(True)
game.clear_available_game_variables()
game.add_available_game_variable(vzd.GameVariable.POSITION_X)
game.add_available_game_variable(vzd.GameVariable.POSITION_Y)
game.add_available_game_variable(vzd.GameVariable.POSITION_Z)
game.init()
actions = [[True, False, False], [False, True, False], [False, False, True]]
episodes = 10
# Sleep time between actions in ms
game = vzd.DoomGame()
# Use other config file if you wish.
game.load_config(args.config)
# game.set_console_enabled(True)
# game.set_window_visible(False)
# Just umcomment desired format for screen buffer (and map buffer).
# The last uncommented will be applied.
# Formats with C (CRCGCB and CBCGCR) were omitted cause they are not cv2 friendly.
# Default format is ScreenFormat.CRCGCB.
# OpenCV uses a BGR colorspace by default.
game.set_screen_format(vzd.ScreenFormat.BGR24)
# game.set_screen_format(ScreenFormat.RGB24)
# game.set_screen_format(ScreenFormat.RGBA32)
# game.set_screen_format(ScreenFormat.ARGB32)
# game.set_screen_format(ScreenFormat.BGRA32)
# game.set_screen_format(ScreenFormat.ABGR32)
# game.set_screen_format(ScreenFormat.GRAY8)
# Raw Doom buffer with palette's values. This one makes no sense in particular
# game.set_screen_format(ScreenFormat.DOOM_256_COLORS)
# Sets resolution for all buffers.
game.set_screen_resolution(vzd.ScreenResolution.RES_640X480)
# Enables depth buffer.
game.set_depth_buffer_enabled(True)
default=DEFAULT_CONFIG,
nargs="?",
help="Path to the configuration file of the scenario."
" Please see "
"../../scenarios/*cfg for more scenarios.")
args = parser.parse_args()
game = vzd.DoomGame()
game.load_config(args.config)
game.set_render_hud(False)
game.set_screen_resolution(vzd.ScreenResolution.RES_640X480)
# Set cv2 friendly format.
game.set_screen_format(vzd.ScreenFormat.BGR24)
# Enables rendering of automap.
game.set_automap_buffer_enabled(True)
# All map's geometry and objects will be displayed.
game.set_automap_mode(vzd.AutomapMode.OBJECTS_WITH_SIZE)
game.add_available_game_variable(vzd.GameVariable.POSITION_X)
game.add_available_game_variable(vzd.GameVariable.POSITION_Y)
game.add_available_game_variable(vzd.GameVariable.POSITION_Z)
# Disables game window (FPP view), we just want to see the automap.
game.set_window_visible(False)
# This CVAR can be used to make a map follow a player.
game.add_game_args("+am_followplayer 1")