Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sleep statement from DoomEnv render #168

Closed
gdb opened this issue Jun 10, 2016 · 5 comments
Closed

Remove sleep statement from DoomEnv render #168

gdb opened this issue Jun 10, 2016 · 5 comments

Comments

@gdb
Copy link
Collaborator

gdb commented Jun 10, 2016

See: https://github.com/openai/gym/blob/master/gym/envs/doom/doom_env.py#L62

I think we can just remove it without thinking hard, but it's a fair point that the game will be at ridiculous speed otherwise. Maybe we should add an option for a fixed FPS run as a Gym feature. @jietang what do you think?

@jietang
Copy link
Contributor

jietang commented Jun 10, 2016

I'm okay with removing it. The game runs at say 75fps instead of 30fps if you don't sleep elsewhere, but you can always do that in agent-land or in the video encoder when writing out a movie.

@ppaquette
Copy link
Contributor

I'll take care of this in PR #157

@olegklimov
Copy link
Contributor

Shouldn't it be the same vsync=True thing? In classic control rendering.py, FPS is equal to monitor refresh rate.

Sure game pace depends on your monitor, but as long as you don't play (as opposed to watch) yourself, it looks pretty natural.

@ppaquette
Copy link
Contributor

VizDoom calls freedoom with '+cl_capfps 1 +vid_vsync 0'. The first parameter caps the FPS at 35 to have a constant 35 frames per second (which was the FPS in the original Doom game).

VizDoom C++ line here

I've fixed this bug by adding a property 'mode' to the environment which can take 3 values: 'fast', 'normal', 'human'

  • 'fast' (default) removes the sleep statement and runs the simulation at roughly 70 fps
  • 'normal' keeps the sleep statement and maintains 35 fps
  • 'human' launches the environment so a human can try the map (hard to achieve without this setting)

I've also set metadata.video.frames_per_second at 35.

The property would be set as follow:

import gym
env = gym.make('DoomBasic-v0')
env.mode = 'human'
env.reset()

This should fix this bug.

jietang pushed a commit that referenced this issue Jun 14, 2016
* 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
@jietang
Copy link
Contributor

jietang commented Jun 16, 2016

This was addressed in #157

@jietang jietang closed this as completed Jun 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants