The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: dummy | Created: 2016-12-07 10:39:51
Subject: Replicant
I had to change unitraceline.cpp:108 to this:

int Loops = 8;

The race was very competitive (at least in the part where my teams were involved) :)
Last Edited: 2016-12-07 10:41:19 by dummy
    Author: firechief | Created: 2016-12-07 11:05:41
    Subject: Re: Replicant
    Ok thanks, will make that change. It was one of the quieter races on the calendar from my viewpoint, probably because overtaking opportunities are limited on this track to the pit straight. Even then its not easy as the overtaker has to enter the straight about 5 car lengths behind its opponent, providing enough space to accelerate with a good slipstream but not too much ground to cover before the straight ends.

    Other than that, faster cars can be stuck behind slightly slower ones & have to wait and hope for them to make a mistake passing a backmarker.
    Last Edited: 2016-12-07 11:05:41 by firechief
      Author: jisham | Created: 2016-12-07 15:39:33
      Subject: Re: Replicant
      I'm glad I'm humble enough to not be offended by someone taking a very similar codebase to what I'm using, running the same car, and posting better times than me by quite a margin, all while maintaining 2-4 other bots in the championship to my one.

      EDIT: forgot to emphasize this was in a car named Dudu. Time for a simplix throwdown :-)

      Well done sir! And no, I absolutely am not trying to distract you from that hooded man dressed in black sneaking into the back of your garage to take a peek at your setup. Hey! Look over here.....
      Last Edited: 2016-12-07 16:04:40 by jisham
        Author: dummy | Created: 2016-12-07 17:00:36
        Subject: Re: Replicant
        You messed something up here. Dudu is my car and pure dandroid code ;)
        But indeed Replicant is looking very promising.
        Last Edited: 2016-12-07 17:02:13 by dummy
          Author: jisham | Created: 2016-12-07 17:41:59
          Subject: Re: Replicant
          My bad, too many new teams, all beating me, and too little space left in my brain for keep them all straight.
          Last Edited: 2016-12-07 17:41:59 by jisham
          Author: firechief | Created: 2016-12-07 17:44:42
          Subject: Re: Replicant
          TBH, Replicant is a bit of a hack at the moment - its fairly fast in this race but I rushed many changes in without thinking them through and I'm not at all happy with its behaviour in traffic. Its causing itself (and others) too much damage through braking too late and also steering too close to other cars. It will take a lot of work to bring it to the overall level of USR, Dandroid or Axiom.

          I'll see what I can do with it for next year though, got to challenge for that Simplix trophy :)
          Last Edited: 2016-12-07 17:44:42 by firechief
    Author: jisham | Created: 2016-12-07 14:09:36
    Subject: Re: Replicant
    g++ -I/home/racer/torcs/torcs-1.3.7/export/include -I/home/racer/torcs/torcs-1.3.7 -g -O2 -Wall -fPIC -fno-strict-aliasing -O2 -DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES -Wall -fPIC -fno-strict-aliasing -O2 -DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DHAVE_CONFIG_H -c unitoverride.cpp
    unitoverride.cpp:45:6: error: prototype for ‘void TOverrideList::loadFromHandle(void*, const char*, double, double)’ does not match any in class ‘TOverrideList’
    void TOverrideList::loadFromHandle(void *handle, const char *label, double SecLen, double TrackLen)
    ^
    In file included from unitoverride.cpp:27:0:
    unitoverride.h:46:14: error: candidate is: void TOverrideList::loadFromHandle(void*, const char*)
    void loadFromHandle(void *handle, const char *label);
    ^
    unitoverride.cpp:101:1: error: prototype for ‘TOverrides::TOverrides(void*, double, double)’ does not match any in class ‘TOverrides’
    TOverrides::TOverrides(void *handle, double SecLen, double TrackLen)
    ^
    In file included from unitoverride.cpp:27:0:
    unitoverride.h:54:7: error: candidates are: TOverrides::TOverrides(const TOverrides&)
    class TOverrides {
    ^
    unitoverride.h:56:9: error: TOverrides::TOverrides(void*)
    TOverrides(void *handle);
    ^
    In file included from unitoverride.cpp:28:0:
    unitglobal.h:93:13: warning: ‘void RfOut(const char*, ...)’ defined but not used [-Wunused-function]
    static void RfOut(const char *format, ...)
    ^
    /home/racer/torcs/torcs-1.3.7/Make-default.mk:240: recipe for target 'unitoverride.o' failed
    make: *** [unitoverride.o] Error 1


    RFOut() is just a non-fatal warning; I've seen these in other places.

    Am I missing a header file? Do I need to tweak the prototypes for TOverrides::TOverrides() ??
    Last Edited: 2016-12-07 14:09:36 by jisham
      Author: jisham | Created: 2016-12-07 14:30:31
      Subject: Re: Replicant
      This seems to work for me.

      $ diff -u unitoverride.h.orig unitoverride.h
      --- unitoverride.h.orig 2016-12-07 08:22:22.453957317 -0500
      +++ unitoverride.h 2016-12-07 08:26:12.834160509 -0500
      @@ -43,7 +43,7 @@
      TOverrideList();
      ~TOverrideList();

      - void loadFromHandle(void *handle, const char *label);
      + void loadFromHandle(void *handle, const char *label, double SecLen, double TrackLen);
      bool getOverrideValue(int segid, double *value);

      private:
      @@ -53,7 +53,7 @@

      class TOverrides {
      public:
      - TOverrides(void *handle);
      + TOverrides(void *handle, double SecLen, double TrackLen);
      ~TOverrides();

      bool getOverrideForLabel(char *label, int segID, double *value);
      Last Edited: 2016-12-07 14:30:31 by jisham
        Author: jisham | Created: 2016-12-07 14:42:52
        Subject: Re: Replicant
        and:

        cp README-replicant.txt tracks/README.txt

        Nice file. Has a few tricks I've learned over the years, and a few I just learned this morning. I'm thinking you omitted this on purpose to teach me something :-)
        Last Edited: 2016-12-07 14:42:52 by jisham
    Author: wdbee | Created: 2016-12-08 07:29:01
    Subject: Re: Replicant
    I cannot belive, that the code worked for you by simply changing one line!

    Here it did not build, there are files missing in the project. After adding them and finding the fixes for the issues with the not matching header file, it still raises warnings because of mixing the simplix way of defining symbols and adding the portability.h to the new file.

    After solving this issue too, the car drives and gets 5000 damage points in the first lap by steering against the barrier at the inner side of the first curve???

    For me it looks like mixing mouse and simplix into the wdbee code without checking the differences. Simplix never was just mouse and wdbee is not simplix.

    Cheers

    Wolf-Dieter
    Last Edited: 2016-12-08 07:29:01 by wdbee
      Author: firechief | Created: 2016-12-08 08:24:06
      Subject: Re: Replicant
      That sounds very wrong indeed. I may have submitted a very early version 2 weeks ago that was based on simplix, but what I uploaded a couple of days before the deadline was wdbee_robotics based - not simplix or mouse.

      I checked the tarball that I downloaded from the TRB site against my current sourcecode, and there's no differences at all - except for the older version of unitoverride.h which John pointed out.

      In short, I'm completely at a loss here - I don't understand what you're seeing or why. If the robot is screwed up that badly, just exclude it from the race.
      Last Edited: 2016-12-08 09:53:45 by firechief
        Author: wdbee | Created: 2016-12-08 12:00:49
        Subject: Re: Replicant
        Well, it is/was wdbee code, but some of the things you changed, is done in simplix way or mouse way, and does not work with the wdbee code. There are serious differences between that robots that result atleast in wrong avoiding racinglines (As visible in the plot I send you in the private mail).

        To classify a robot as simplix based, it should use the old iterative calculation of braking that was introduced by mouse and modified for simplix.

        The wdbee robots do not use iterative breaking calculations (and all the other calculations are not based on mouse or simplix, it is a complete redesign).

        There are a lot of differences, but the braking calculation should be seen as the main criteria for classification of simplix and wdbee robots.

        Another more visbile criteria is the use of the grouped private setup section, that was introduced with the wdbees.

        The simplix was designed to win the championships, the wdbees are planned to be the fastest robot driving with the default setup (means driving on unknown tracks), and AFAICS it is the only robot driving well at all tracks out of the box.

        If I find time to finish the job, I will put a download link to an "All TRB1 car types" version of the wdbee_robotics to my website.

        Wolf-Dieter


        Last Edited: 2016-12-08 12:00:49 by wdbee
          Author: firechief | Created: 2016-12-08 12:30:12
          Subject: Re: Replicant
          As I said in my email response, the racelines from your email don't match those I see in the car's behaviour on track (and yes I've tested it in L/R mode), nor does your description of it turning too sharply and doing 5000 damage at the first corner match up with how it behaved on my machine.

          And apart from that, you're raising coding style criticisms as well. I'm thinking that perhaps the best course of action would be for me not to field this robot next year. I'll just stick with USR/Axiom.
          Last Edited: 2016-12-08 12:30:12 by firechief
            Author: wdbee | Created: 2016-12-08 12:40:01
            Subject: Re: Replicant
            Sorry for what you call "coding style criticisms".

            All I was saying is, that the compiler shows warnings that lead to the point where the bug seems to start (if build with the project files on Windows, not the makefiles) (I'm out of office and cannot look into the code at the moment, so I thought, the warnings could help you to identify the issues).

            I only have the code from the tarball and do not know about the history of your changes.

            Cheers

            Wolf-Dieter
            Last Edited: 2016-12-08 12:40:01 by wdbee
              Author: firechief | Created: 2016-12-08 13:17:22
              Subject: Re: Replicant
              The problem is though that I can't replicate the issues you've described, which makes it very hard to resolve them.

              I increased the warning level to W3 in visual studio (it was W2) and am now seeing one warning relating to a bool, in line 4530 of unitvehicle.cpp where I explicitly cast a double to a bool. The value of the double is read from the XML file and should only be 0.0 or 1.0. The warning doesn't say anything about it working incorrectly, only that it might be a performance issue.
              Last Edited: 2016-12-08 13:17:22 by firechief
                Author: wdbee | Created: 2016-12-08 13:29:03
                Subject: Re: Replicant
                Hi Andrew,
                here the lines, my compiler gives a warning for:

                replicant\unitvehicle.cpp:
                // Calculate a smooth path as left racingline
                pCommonData->Racingline[cRL_L].MakeSmoothPath
                (this,&TrackDesc, Param, TRacingline::TOptions(BumpMod,true,4,999,AvoidWidth));

                // Calculate a smooth path as right racingline
                pCommonData->Racingline[cRL_R].MakeSmoothPath
                (this, &TrackDesc, Param, TRacingline::TOptions(BumpMod,true,4,AvoidWidth,999));

                replicant\unitracingline.h:
                TOptions(tdble BM, bool SI = false, tdble ML = FLT_MAX, tdble MR = FLT_MAX, bool SM = false):

                What I read here is:
                TOptions (tdble BM, bool SI = false, tdble ML = FLT_MAX, tdble MR = FLT_MAX, bool SM = false):
                TRacingline::TOptions( BumpMod, true, 4, 999, AvoidWidth));
                TRacingline::TOptions( BumpMod, true, 4, AvoidWidth, 999));
                For me that is a mismatch of the arguments.

                What I would expect here is
                TRacingline::TOptions( BumpMod, true, 999, AvoidWidth));
                TRacingline::TOptions( BumpMod, true, AvoidWidth, 999));

                Cheers

                Wolf-Dieter
                Last Edited: 2016-12-08 13:29:03 by wdbee
                  Author: firechief | Created: 2016-12-08 14:11:27
                  Subject: Re: Replicant
                  Ah, this explains things - its also why Danny had to make the change he mentioned early in this thread.

                  It looks like I mustn't have uploaded the very latest tarball to the TRB. That line in unitracingline.h should read:-

                  TOptions(tdble BM, bool SI = false, int Lps = 8, tdble ML = FLT_MAX, tdble MR = FLT_MAX, bool SM = false):
                  BumpMod(BM), MaxL(ML), Loops(Lps), MaxR(MR), Side(SI), Smooth(SM) {}

                  Last Edited: 2016-12-08 14:11:27 by firechief
                    Author: wdbee | Created: 2016-12-08 15:45:33
                    Subject: Re: Replicant
                    So could you send me the correct *.cpp and *.h files as zip via mail?
                    Last Edited: 2016-12-08 15:45:33 by wdbee
                      Author: firechief | Created: 2016-12-08 16:23:34
                      Subject: Re: Replicant
                      Make that one change to the .h file and it should all work. I'll send you a tarball anyway.
                      Last Edited: 2016-12-08 16:23:34 by firechief