Skip to content

Gym Torcs that supports multi instances training and text mode

Notifications You must be signed in to change notification settings

lewisKit/txt_torcs

Repository files navigation

txt_torcs

This repository incorporates serval common issues in the original gym_torcs repository, including:

  • Support Text Mode training in practice mode #48;
  • Support running multiple gym_torcs experiments on the same machine #27;
  • Upgrade torcs to the latest version;
  • Display the car in the screen #7;
  • Support training different tracks. The supported tracks can be found in TORCS.

Examples of PPO

A simple example of using PPO to train torcs:

python run_torcs.py --road_type g-track-1*road

Examples of gym_torcs

from multigym_torcs import TorcsEnv

# each TorcsEnv object should be associated with a different port in the same machine
# text_model=False will require a window to display
env = TorcsEnv(vision=False, throttle=True, gear_change=False, \
               trackname='street-1*road', port=3102, text_mode=True) 
env.reset()
env.step(env.action_space.sample())

road_type or trackname in TorcsEnv consists of road_name and category name which are concatenated by *.

For exmaple:

g-speedway*oval

Road and category names can be found in TORCS.

DISPLAY VISION on the remote server

If you want to run experiments and use vision mode on a remote server, personally I recommend to use VirtualGL and TurboVNC. The setup files can be find here.

Issue

Currently I only test for sensor based training, not on image-based training like original gym_torcs.

Please raise a issue if there is any bug or problem.

About

Gym Torcs that supports multi instances training and text mode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published