Created
March 23, 2026 15:03
-
-
Save evanthebouncy/aa6a0f0ff89ffd98d6c6237915a8753d to your computer and use it in GitHub Desktop.
speedup
This file contains hidden or 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
| from mlagents_envs.environment import UnityEnvironment | |
| from mlagents_envs.envs.unity_gym_env import UnityToGymWrapper | |
| from mlagents_envs.side_channel.engine_configuration_channel import EngineConfigurationChannel | |
| engine_channel = EngineConfigurationChannel() | |
| unity_env = UnityEnvironment( | |
| file_name=r"Simple/Assignment2", # use the path to your built game here | |
| side_channels=[engine_channel], | |
| no_graphics=False, # set to True to disable rendering, which can speed up training | |
| ) | |
| engine_channel.set_configuration_parameters(time_scale=20.0) | |
| env = UnityToGymWrapper(unity_env) | |
| while True: | |
| obs = env.reset() | |
| done = False | |
| while not done: | |
| action = env.action_space.sample() | |
| obs, reward, done, info = env.step(action) | |
| print(obs, reward, done, info) | |
| env.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment