-
-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move forward/backward and left/right delta buttons work again, delta_…
…buttons.py example, vizdoom_nocheat flag
- Loading branch information
Showing
20 changed files
with
313 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# The set of languages for which implicit dependencies are needed: | ||
set(CMAKE_DEPENDS_LANGUAGES | ||
) | ||
# The set of files for implicit dependencies of each language: | ||
|
||
# Targets to which this target links. | ||
set(CMAKE_TARGET_LINKED_INFO_FILES | ||
) | ||
|
||
# The include file search paths: | ||
set(CMAKE_C_TARGET_INCLUDE_PATH | ||
"../../vizdoom_api_src" | ||
) | ||
set(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) | ||
set(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) | ||
set(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# CMAKE generated file: DO NOT EDIT! | ||
# Generated by "Unix Makefiles" Generator, CMake Version 3.2 | ||
|
||
#============================================================================= | ||
# Special targets provided by cmake. | ||
|
||
# Disable implicit rules so canonical targets will work. | ||
.SUFFIXES: | ||
|
||
# Remove some rules from gmake that .SUFFIXES does not remove. | ||
SUFFIXES = | ||
|
||
.SUFFIXES: .hpux_make_needs_suffix_list | ||
|
||
# Suppress display of executed commands. | ||
$(VERBOSE).SILENT: | ||
|
||
# A target that is always out of date. | ||
cmake_force: | ||
.PHONY : cmake_force | ||
|
||
#============================================================================= | ||
# Set environment variables for the build. | ||
|
||
# The shell in which to execute make rules. | ||
SHELL = /bin/sh | ||
|
||
# The CMake executable. | ||
CMAKE_COMMAND = /usr/bin/cmake | ||
|
||
# The command to remove a file. | ||
RM = /usr/bin/cmake -E remove -f | ||
|
||
# Escaping for special characters. | ||
EQUALS = = | ||
|
||
# The top-level source directory on which CMake was run. | ||
CMAKE_SOURCE_DIR = /home/marek/Workspace/ViZDoom/examples/c++ | ||
|
||
# The top-level build directory on which CMake was run. | ||
CMAKE_BINARY_DIR = /home/marek/Workspace/ViZDoom/examples/c++ | ||
|
||
# Include any dependencies generated for this target. | ||
include CMakeFiles/../../bin/vizdoom.so.dir/depend.make | ||
|
||
# Include the progress variables for this target. | ||
include CMakeFiles/../../bin/vizdoom.so.dir/progress.make | ||
|
||
# Include the compile flags for this target's objects. | ||
include CMakeFiles/../../bin/vizdoom.so.dir/flags.make | ||
|
||
CMakeFiles/../../bin/vizdoom.so.dir/requires: | ||
.PHONY : CMakeFiles/../../bin/vizdoom.so.dir/requires | ||
|
||
CMakeFiles/../../bin/vizdoom.so.dir/clean: | ||
$(CMAKE_COMMAND) -P CMakeFiles/../../bin/vizdoom.so.dir/cmake_clean.cmake | ||
.PHONY : CMakeFiles/../../bin/vizdoom.so.dir/clean | ||
|
||
CMakeFiles/../../bin/vizdoom.so.dir/depend: | ||
cd /home/marek/Workspace/ViZDoom/examples/c++ && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/marek/Workspace/ViZDoom/examples/c++ /home/marek/Workspace/ViZDoom/examples/c++ /home/marek/Workspace/ViZDoom/examples/c++ /home/marek/Workspace/ViZDoom/examples/c++ /home/marek/Workspace/ViZDoom/examples/bin/vizdoom.so.dir/DependInfo.cmake --color=$(COLOR) | ||
.PHONY : CMakeFiles/../../bin/vizdoom.so.dir/depend | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
# Per-language clean rules from dependency scanning. | ||
foreach(lang) | ||
include(CMakeFiles/../../bin/vizdoom.so.dir/cmake_clean_${lang}.cmake OPTIONAL) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Empty dependencies file for ../../bin/vizdoom.so. | ||
# This may be replaced when dependencies are built. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# CMAKE generated file: DO NOT EDIT! | ||
# Generated by "Unix Makefiles" Generator, CMake Version 3.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/usr/bin/python | ||
|
||
from __future__ import print_function | ||
from vizdoom import * | ||
|
||
from random import choice | ||
from time import sleep | ||
from time import time | ||
|
||
|
||
game = DoomGame() | ||
|
||
game.set_vizdoom_path("../../bin/vizdoom") | ||
|
||
game.set_doom_game_path("../../scenarios/freedoom2.wad") | ||
game.set_doom_game_path("../../scenarios/doom2.wad") # Not provided with environment due to licences. | ||
|
||
game.set_doom_map("map01") | ||
|
||
game.set_screen_resolution(ScreenResolution.RES_640X480) | ||
|
||
|
||
# Adds delta buttons that will be allowed and set the maximum allowed value (optional). | ||
game.add_available_button(Button.MOVE_FORWARD_BACKWARD_DELTA, 10) | ||
game.add_available_button(Button.MOVE_LEFT_RIGHT_DELTA, 5) | ||
game.add_available_button(Button.TURN_LEFT_RIGHT_DELTA, 5) | ||
game.add_available_button(Button.LOOK_UP_DOWN_DELTA) | ||
|
||
# For normal buttons (binary) all values other than 0 are interpreted as pushed. | ||
# For delta buttons values determine a precision/speed. | ||
# | ||
# For TURN_LEFT_RIGHT_DELTA and LOOK_UP_DOWN_DELTA value is the angle (in degrees) | ||
# of which the viewing angle will change. | ||
# | ||
# For MOVE_FORWARD_BACKWARD_DELTA, MOVE_LEFT_RIGHT_DELTA, MOVE_UP_DOWN_DELTA (rarely used) | ||
# value is the speed of movement in a given direction (100 is close to the maximum speed). | ||
action = [100, 10, 10, 1] | ||
|
||
# If button's absolute value > max button's value then value = max value with original value sign. | ||
|
||
# Delta buttons in spectator modes correspond to mouse movements. | ||
# Maximum allowed values also apply to spectator modes. | ||
# game.add_game_args("+freelook 1") # Use this to enable looking around with the mouse. | ||
# game.set_mode(Mode.SPECTATOR) | ||
|
||
game.set_window_visible(True) | ||
|
||
game.init() | ||
|
||
episodes = 10 | ||
sleep_time = 0.028 | ||
|
||
for i in range(episodes): | ||
print("Episode #" + str(i+1)) | ||
|
||
game.new_episode() | ||
|
||
while not game.is_episode_finished(): | ||
|
||
s = game.get_state() | ||
r = game.make_action(action) | ||
|
||
t = game.get_episode_time() | ||
|
||
action[0] = t % 100 - 50 | ||
action[1] = t % 100 - 50 | ||
action[2] = t % 100 - 50 | ||
if not t % 25: | ||
action[3] = -action[3] | ||
|
||
print("State #" + str(s.number)) | ||
print("=====================") | ||
|
||
if sleep_time>0: | ||
sleep(sleep_time) | ||
|
||
print("Episode finished.") | ||
print("************************") | ||
|
||
game.close() | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.