Files
Gymnasium/gym/envs/doom/doom_predict_position.py
Philip Paquette aff7a643cc Doom - Same Action Space Across Environments (#157)
* Doom - Added reward_threshold and timestep_limit for all environments

* Doom - Returning all available game variables

* Doom - Moved _seed to doom_env to avoid repetition in every environment

* Doom - Added ALT_ATTACK and made all action_space equivalent (same controls between environments).

* Doom - Actions can either be a short list of allowed actions or the full list of 41 commands

* Doom - Returning black observation space on error or is_finished, rather than empty list (which was triggering an error)

* Doom - HighLow.sample() returns the small list.

* Doom - Updated difficulty for some missions

* Doom - Fixed inconsistency between controls.md and deathmatch.cfg

* Doom - Issue #168 - Remove sleep statement from DoomEnv render

* Doom - Only using full action space (43 keys)

- Added 'normal', 'fast' and 'human' mode
- Set non-deterministic to True
- Set video.frames_per_second to 35
- Properly returning game variables

* Replaced warnings.warn by logger.warn

* Doom - Added NUM_ACTIONS and action_idx instead of x

* Doom - Added NUM_ACTIONS and action_idx instead of x

* Doom - reset() only calls game.new_episode() after first call

* Doom is now deterministic

* Doom - Partial fix for issue #167 - DoomDeathmatch environment crashes sporadically

* Doom - Standardized envs, simplified _reset

* Doom - Removed temporary fix for issue #167

* Doom - Added scoreboard summary and description
2016-06-14 15:57:47 -07:00

51 lines
1.9 KiB
Python

import logging
from gym.envs.doom import doom_env
logger = logging.getLogger(__name__)
class DoomPredictPositionEnv(doom_env.DoomEnv):
"""
------------ Training Mission 7 - Predict Position ------------
This map is designed to train you on using a rocket launcher.
It is a rectangular map with a monster on the opposite side. You need
to use your rocket launcher to kill it. The rocket adds a delay between
the moment it is fired and the moment it reaches the other side of the room.
You need to predict the position of the monster to kill it.
Allowed actions:
[0] - ATTACK - Shoot weapon - Values 0 or 1
[14] - TURN_RIGHT - Turn right - Values 0 or 1
[15] - TURN_LEFT - Turn left - Values 0 or 1
Note: see controls.md for details
Rewards:
+ 1 - Killing the monster
-0.0001 - 35 times per second - Kill the monster faster!
Goal: 0.5 point
Kill the monster
Hint: Missile launcher takes longer to load. You must wait a good second after the game starts
before trying to fire it.
Mode:
- env.mode can be 'fast', 'normal' or 'human' (e.g. env.mode = 'fast')
- 'fast' (default) will run as fast as possible (~75 fps) (best for simulation)
- 'normal' will run at roughly 35 fps (easier for human to watch)
- 'human' will let you play the game (keyboard only: Arrow Keys, '<', '>' and Ctrl)
Ends when:
- Monster is dead
- Out of missile (you only have one)
- Timeout (20 seconds - 700 frames)
Actions:
actions = [0] * 43
actions[0] = 0 # ATTACK
actions[14] = 1 # TURN_RIGHT
actions[15] = 0 # TURN_LEFT
-----------------------------------------------------
"""
def __init__(self):
super(DoomPredictPositionEnv, self).__init__(6)