masakifujiwara1 / gym_torcs

MIT License
0 stars 1 forks source link

visualize #1

Open masakifujiwara1 opened 3 months ago

masakifujiwara1 commented 3 months ago

Hi,

The car body and dashboards are usually omitted in experiments in deep (vision) reinforcement learning papers by Schmidhuber's team and Deepmind team. That's why I removed them from the screen.

Anyway, you can recover the car body by modifying 280th line of grscreen.cpp

    for (i = 1; i < s->_ncars; i++) {
        grDrawCar(cars[i], curCar, dispCam->getDrawCurrent(), dispCam->getDrawDriver(), s->currentTime, dispCam);
    }

You should modify i =1 to i = 0. After the compile, you will be able to see the car body. i=0 represent the first car, that is the agent. And other numbers are opponent cars.

For car mirrors, you should uncomment 361-366 lines in grscreen.cpp

    /* MIRROR */
  /*
    if (mirrorFlag && curCam->isMirrorAllowed ()) {
        mirrorCam->display ();
        glViewport (scrx, scry, scrw, scrh);
    }
  */

To show the map, tachometers etc. I remember that we should uncomment appropriate methods in 841-845 lines of cGrBoard::refreshBoard in grboard.cpp.

void cGrBoard::refreshBoard(tSituation *s, float Fps, int forceArcade, tCarElt *curr)
{
    if (arcadeFlag || forceArcade) {
        grDispArcade(curr, s);
    } else {
        //if (debugFlag) grDispDebug(Fps, curr);
        if (GFlag) grDispGGraph(curr);
        //if (boardFlag) grDispCarBoard(curr, s);
        //if (leaderFlag)   grDispLeaderBoard(curr, s);
        //if (counterFlag) grDispCounterBoard2(curr);
    }

    //trackMap->display(curr, s, Winx, Winy, Winw, Winh);
}