The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: dummy | Created: 2017-07-12 21:06:43
Subject: Klin for Linux
First of all, it was a nice to see, how much more dynamic the race has become with Klin in it. It adds some desperately needed spice to it.

To make Klin work, I had to remove all rgb files. The error message when starting the race looked like this:
FATAL: drivers/klin/logo.rgb: Unrecognised magic number 0x0000

The other errors are all below:

pit.cpp:32:36: fatal error: learning\MathFunctions.h: No such file or directory
#include <learning\MathFunctions.h>
Same in path.cpp:23, replaced with:
#include <learning/MathFunctions.h>

klin.cpp:65:34: error: ‘>>’ should be ‘> >’ within a nested template argument list
static vector<pair<char *, char *>> DriversNameDesc;
Same in klin.cpp:222:33.

pit.cpp:431:40: error: ‘tCarPitCmd::TireChange’ is not a class or namespace
car->pitcmd.tireChange = tCarPitCmd::TireChange::NONE;
Same in pit.cpp:438 and 439, replaced with:
car->pitcmd.tireChange = tCarPitCmd::TireChange(0);
Last Edited: 2017-07-12 21:14:11 by dummy
    Author: firechief | Created: 2017-07-13 06:28:46
    Subject: Re: Klin for Linux
    > First of all, it was a nice to see, how much more dynamic the race has become with Klin in it. It adds some desperately needed spice to it.

    I can't wait (unfortunately I have to though) to see Klin in a race, but I don't think I'm giving anything away by saying that the Klin-less race I ran had plenty of spice in it. PLENTY of spice :)
    Last Edited: 2017-07-13 06:28:46 by firechief
      Author: dummy | Created: 2017-07-13 07:48:11
      Subject: Re: Klin for Linux
      Looking forward to this review ;)
      Last Edited: 2017-07-13 07:48:11 by dummy
    Author: phi | Created: 2017-07-13 14:10:33
    Subject: Re: Klin for Linux
    Hi Daniel & Andrew

    I agree that Klin is a special spice, and even more so with what Daniel said: in my words, there is indeed a certain despair in him, a great need that he can not satisfy. I must admit that I finished my race a little sad for that reason, along with some joy for certain situations. But overall I was satisfied.

    On the other hand, Daniel, this RGB problem is... well, this is not fun. I used GIMP 2.8.16 and XCF models from TORCS, and besides that I can't tell you anymore else at this moment.

    The rule is clear, and Klin does not work very well on Linux, does it? I start to feel myself as a exceptions to that rule, and I don't like very much stay in this feelings. Maybe my desire to participate in the TRB has outgrown my common sense, and I really am not prepared for it. So, if I can not resolve these issues in this next days, I will have to suspend my activity here.

    Regards
    Last Edited: 2017-07-13 14:10:33 by phi
      Author: firechief | Created: 2017-07-13 15:33:41
      Subject: Re: Klin for Linux
      One question on the rgb file(s) - did you save them with the RLE Compression option ticked? You should definitely do so, I'm guessing that could break it under linux if you've saved with no compression.
      Last Edited: 2017-07-13 15:33:41 by firechief
        Author: phi | Created: 2017-07-13 16:07:54
        Subject: Re: Klin for Linux
        Yes, I accept all Standards of GIMP, and the RGB exports are RLE compression. The logo, however, has an alpha channel that I remove when copying and creating a new image from the XCF, but, still here, the export to RGB is RLE compression; this alpha channel causes the sides of the image to appear transparent in the TORCS.
        Last Edited: 2017-07-13 16:07:54 by phi
          Author: firechief | Created: 2017-07-13 16:09:52
          Subject: Re: Klin for Linux
          Ah I think that's the problem then. Better to use a few pixels of darkish grey around the edges of the pit-door image, as that's what TORCS uses for the surrounding colour, and dispense with the alpha channel.
          Last Edited: 2017-07-13 16:09:52 by firechief
            Author: phi | Created: 2017-07-13 16:13:58
            Subject: Re: Klin for Linux
            Thanks Andrew, I'll try this.
            Last Edited: 2017-07-13 16:13:58 by phi
      Author: dummy | Created: 2017-07-13 18:01:36
      Subject: Re: Klin for Linux
      > Klin does not work very well on Linux, does it?

      In contrary, Klin works very well on Linux. Those are all minor issues, which in itself is amazing. I expected much more problems with a new team participating the first time. If you can't resolve the rgb issue, don't worry, maybe someone like Bernhard will read this and have an idea. He's usually an expert in those matters.

      I love the Klin project. Keep it in the championship please ;)

      Danny
      Last Edited: 2017-07-13 18:01:36 by dummy
        Author: phi | Created: 2017-07-13 19:27:00
        Subject: Re: Klin for Linux
        Thanks Danny

        Andrew came up with an idea, and I think he's right. I just created a logo.rgb with a gray frame, to which I then removed the alpha channel. Works well with my TORCS, and I hope this solves the issue.

        In 'tCarPitCmd::TireChange::NONE' error, can I write 'tCarPitCmd::NONE'? Does it work on Linux?
        Last Edited: 2017-07-13 19:27:00 by phi
          Author: dummy | Created: 2017-07-13 20:40:22
          Subject: Re: Klin for Linux
          Yep!
          tCarPitCmd::NONE works. Well done :)
          Last Edited: 2017-07-13 20:40:22 by dummy
    Author: timfoden | Created: 2017-07-13 14:54:27
    Subject: Re: Klin for Linux
    > klin.cpp:65:34: error: ‘>>’ should be ‘> >’ within ...

    This (the >> form) has been supported in the language since C++03. This brings up a question I've been meaning to ask about compiler versions... What version of Compilers and/or the C++ standard should we be writing to these days?

    A lot of the code in Mouse is from the MS VC6 days, and I'm unsure whether to drop compatibility with it (mainly the {for(int x...){}} nonsense). I suppose a similar question applies to gcc on linux... do we still have to target C++98 (and thus have to write > > instead of >>) or can we move on? :)

    Cheers, Tim.
    Last Edited: 2017-07-13 14:54:27 by timfoden
      Author: dummy | Created: 2017-07-13 18:05:57
      Subject: Re: Klin for Linux
      You're so right. I would love to be able to code the robots in C++11, but it remains only a dream. I'm no expert with the compiler and will investigate. I'm sure there is a possibility to tell him to use C++03, but I don't know how at the moment. :)

      EDIT: I will switch from Debian Jessie to Stretch hopefully soon, because I still have an issue with my installation of KDE freezing and don't know why. Then I will have C++11 as the standard with the gcc 6 series. I think at least.
      Last Edited: 2017-07-13 18:21:54 by dummy
      Author: wdbee | Created: 2017-07-15 08:30:13
      Subject: Re: Klin for Linux
      AFAIK TORCS is using VC2008 for the Windows version.
      The klin.cpp:65:34 error does not happen with VC2008 (here Express).

      The only warnings are
      1>.\pit.cpp(431) : warning C4482: nonstandard extension used: enum 'tCarPitCmd::TireChange' used in qualified name
      1>.\pit.cpp(438) : warning C4482: nonstandard extension used: enum 'tCarPitCmd::TireChange' used in qualified name
      1>.\pit.cpp(439) : warning C4482: nonstandard extension used: enum 'tCarPitCmd::TireChange' used in qualified nam

      AFAICS there is no car or track configuration contained in the archive, means the klins are running the default setup of the car at an "unknown" track. Let the leading teams drive without these configuration files and klin will win the race ;)

      Such a robot would be a great part of TORCS as game!

      Chapeau

      Wolf-Dieter
      Last Edited: 2017-07-15 08:30:13 by wdbee
        Author: firechief | Created: 2017-07-15 08:49:02
        Subject: Re: Klin for Linux
        > the klins are running the default setup of the car at an "unknown" track. Let the leading teams drive without these configuration files and klin will win the race ;)

        > Such a robot would be a great part of TORCS as game!

        I'm not so sure. TORCS would be better off with faster robots rather than slow ones - there's plenty of skilled drivers out there who'd prefer to have decent AI opposition to race against.

        Last Edited: 2017-07-15 08:49:02 by firechief
          Author: wdbee | Created: 2017-07-15 09:22:09
          Subject: Re: Klin for Linux
          As I wrote, the klin robot is driving fast out of the box on an unknown track, compared to other robots driving very slow without explicit instructions how to drive at which part of a known track. As we know a good racer can make it drive much faster, but we are talking about the robot, not the racer ;)
          Last Edited: 2017-07-15 09:22:09 by wdbee
            Author: firechief | Created: 2017-07-15 13:28:18
            Subject: Re: Klin for Linux
            I still don't understand the point you're trying to make, but ok.

            Edit: Just out of interest, I setup Tiger to run a car7 without any setup (it needs a "car7-trb1.xml" to be present, but I just copied the one from the cars directory). In three laps it set a 1:19.63 which is significantly faster - I'd expect the other mouse-derivatives would also have this kind of pace "out of the box".
            Last Edited: 2017-07-15 14:49:31 by firechief