dosssman / GymTorcs

A Gym wrapper for the Torcs Racing car simulator
30 stars 7 forks source link

Is it possible to change track without need to restart TORCS process? #5

Open tperka opened 1 month ago

tperka commented 1 month ago

Hi, I've managed to expand randomise method of TORCS Env to include changing the track via dynamically generated XML. But when reset() is called without hard reset, the selected track is the same (as well as agent's position). The behavior changes when I set hard_reset_interval to 1, then track is randomised every episode, but there is a huge performance overhead. Is it possible to achieve the same without resetting torcs over and over again?

dosssman commented 1 month ago

Hello there. Thanks a lot for the interest !

It's been a while, but as far as I remember, the Torcs simulator binary that is used along with this wrapper loads the track based an XML file. Theoretically, it would be possible to change track configuration after it is started, but I don't think I have seen that feature implemented in TORCS. This would have to be implemented both at the Torcs level, as well as adjust the wrapper unfortunately.

Hope this can be of some help. Best regards.