The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: jspenn | Created: 2016-09-29 17:19:19
Subject: Robot skin change
Hello.
I was just wondering how you could change the default skin of a car if you change the car in the code of the robot.
Thanks,
Jacob.
Last Edited: 2016-09-29 17:19:19 by jspenn
    Author: jisham | Created: 2016-10-03 20:54:07
    Subject: Re: Robot skin change
    There is a bitmap file that can be edited. For example, using car2-trb1 I have two files:

    0/car2-trb1.rgb
    and
    1/car2-trb1.rgb

    for the skins for car 0 and car 1. There is also a boilerplate Makefile in each directory to install them. Just look at anyone's source and you'll see examples.

    Now knowing where to edit in the files is tricky. I've never found a method better than copying other's outlines or using trial and error to see if an image maps to the right place. Not terribly efficient, but it can be made to work. There's probably a way to tease coordinates out of the source code, but the few times I tried I was unsuccessful before I got impatient and tried something else.

    Years ago, I tried photoshop'ing/gimp'ing up pictures of real-world "car2-trb1"'s and trying to map them into photo-realistic panels for the car. It was a pretty amateurish job, but I was proud of it at the time, and a little bit goes a long way to making the car look nice. Some of the people here are real 3-D artists, and would laugh at what I did, but I liked it.

    If you dig a bit deeper, I think there are also bitmaps for the car's shadow. There used to be a way to do the wheels as well, but that changed when they went to a 3-d wheel model, and I haven't been able to figure out how to change that from within the car sources. I've only been able to do it by directly overwriting files in the installation target tree, but car sources aren't (and shouldn't be) allowed to do that.
    Last Edited: 2016-10-03 20:54:07 by jisham
    Author: dummy | Created: 2016-10-04 11:12:22
    Subject: Re: Robot skin change
    There is also the original car2-trb1.xcf file for example in the torcs/data/cars/models/car2-trb1/ directory.

    This is much better to work with, because of layers and such.
    Last Edited: 2016-10-04 11:12:22 by dummy
      Author: jisham | Created: 2016-10-04 14:40:26
      Subject: Re: Robot skin change
      Wow. I wish I had discovered that years ago... would have saved me a lot of time.
      That texture map layer alone is great for figuring out which portions go where.

      Thanks for the link!

      .... and nice try to distract me from tuning the car before the race!

      -jdi
      Last Edited: 2016-10-04 14:40:26 by jisham
        Author: dummy | Created: 2016-10-04 15:43:32
        Subject: Re: Robot skin change
        Eh.. you caught me red handed :)
        Last Edited: 2016-10-04 15:43:32 by dummy
          Author: firechief | Created: 2016-10-04 16:10:57
          Subject: Re: Robot skin change
          Been putting more red paint on your cars eh Danny?

          I've always heard it said that red cars go faster...
          Last Edited: 2016-10-04 16:10:57 by firechief
            Author: dummy | Created: 2016-10-04 17:40:57
            Subject: Re: Robot skin change
            Look at this John. Andrew is trying to distract me from making some real progress, but I'm not falling for it. (Well apart from posting here)

            BTW Andrew, I've heard more blue colors on USR could make it faster. If you look at Wolf-Dieter's blue cars, they are faster than the red'ish ones ;)
            Last Edited: 2016-10-04 17:44:50 by dummy
              Author: firechief | Created: 2016-10-04 17:55:04
              Subject: Re: Robot skin change
              Except Axiom is blue with red stripes ... and not particularly quick.

              No Danny, thinking about it, what you need is a mix of red AND blue together - purple! Just copy the color Bernhard uses on his robots - I believe berniw_2004 even won the TRB one year, so it must be fast!
              Last Edited: 2016-10-04 17:55:48 by firechief
                Author: dummy | Created: 2016-10-04 18:07:47
                Subject: Re: Robot skin change
                Thanks a lot Andrew, I will do so and profit from your vast experience you're willing to share publicly ;)
                Last Edited: 2016-10-04 18:07:47 by dummy
                  Author: firechief | Created: 2016-10-04 18:12:09
                  Subject: Re: Robot skin change
                  That's what open source is all about :D
                  Last Edited: 2016-10-04 18:12:09 by firechief
                    Author: dummy | Created: 2016-10-04 18:30:42
                    Subject: Re: Robot skin change
                    Yes, you've got to love open source.

                    I'll do only one car first. This way we can see without a doubt, if you're right. I hope I'll get the color right though :)
                    Last Edited: 2016-10-04 18:33:53 by dummy
                Author: jisham | Created: 2016-10-04 22:55:36
                Subject: Re: Robot skin change
                Naw, blue with green stripes is the fastest.... but only in odd numbered years :-)
                Last Edited: 2016-10-04 22:55:36 by jisham
                Author: jspenn | Created: 2016-10-06 13:44:54
                Subject: Re: Robot skin change
                "I believe berniw_2004 even won the TRB one year, so it must be fast!"

                Twice! '04 and '05.
                Last Edited: 2016-10-06 13:45:21 by jspenn
            Author: jspenn | Created: 2016-10-06 17:34:28
            Subject: Re: Robot skin change
            I'd have thought that white cars were faster (air cooled down, air becomes denser, power increases).
            Last Edited: 2016-10-06 17:34:28 by jspenn
              Author: firechief | Created: 2016-10-06 17:42:50
              Subject: Re: Robot skin change
              Hmm, but black cars would have more downforce, with the radiant heat increasing the pressure of the air moving over its wings.
              Last Edited: 2016-10-07 02:13:26 by firechief
                Author: jisham | Created: 2016-10-06 19:42:48
                Subject: Re: Robot skin change
                "It's so ... black!" said Ford Prefect, "you can hardly make out its shape ... light just seems to fall into it!"

                Zaphod said nothing. He had simply fallen in love.

                The blackness of it was so extreme that it was almost impossible to tell how close you were standing to it.

                "Your eyes just slide off it ..." said Ford in wonder. It was an emotional moment. He bit his lip.

                Zaphod moved forward to it, slowly, like a man possessed - or more accurately like a man who wanted to possess. His hand reached out to stroke it. His hand stopped. His hand reached out to stroke it again. His hand stopped again.

                "Come and feel the surface," he said in a hushed voice.

                Ford put his hand out to feel it. His hand stopped.

                "You ... you can't ..." he said.

                "See?" said Zaphod, "it's just totally frictionless. This must be one mother of a mover ..."
                Last Edited: 2016-10-06 19:42:48 by jisham
                  Author: dummy | Created: 2016-10-06 19:54:56
                  Subject: Re: Robot skin change
                  Haha.. this thread is the funniest I've seen on TRB so far. And amazingly it's all on topic.
                  Last Edited: 2016-10-06 19:55:13 by dummy
                    Author: jspenn | Created: 2016-10-08 11:34:43
                    Subject: Re: Robot skin change
                    Actually this was originally about changing the default skin, but a discussion about the fastest car colour isn't far off.
                    EDIT: At least it hasn't descended into a discussion between you and Andrew about your robots' abilities on whatever seems to be the current round of the championship.
                    Last Edited: 2016-10-08 12:41:46 by jspenn
                  Author: jspenn | Created: 2017-01-16 13:39:20
                  Subject: Re: Robot skin change
                  Ah, but while it's frictionless, looks like a fish and goes like a fish, it steers like a cow.
                  Last Edited: 2017-01-16 13:39:20 by jspenn
                Author: jspenn | Created: 2016-10-08 12:45:48
                Subject: Re: Robot skin change
                "Hmm, but black cars would have more downforce, with the radiant heat increasing the pressure of the air moving over its wings."
                Correct me if I'm wrong, but the white would cool the air down, thereby increasing air density, thereby increasing pressure on the wings.
                Last Edited: 2016-10-08 12:45:48 by jspenn
                  Author: firechief | Created: 2016-10-08 14:22:55
                  Subject: Re: Robot skin change
                  Well, cold air is indeed more dense, but its also at a lower pressure - pressure and density have an inverse relationship.

                  Which then begs the question of which would increase the effectiveness of wings - low-pressure dense air, or air at a higher pressure?

                  Edit: A bit of googling found me this quote (from an Indycar article): "Since cooler temperatures result in higher air density, the cars produce more downforce and drag with cooler temperature by increasing the amount of air passing over the car."

                  Hence you're right, white cars will produce more downforce - but also more drag. So its the opposite way around to what we thought. A black car will be more slippery with less drag and a higher top speed, but a white car will stick to the track better. So it comes down to the nature of the circuit as to which would be better. For TORCS you want a white car for alpine-1, and a black car for Forza :)
                  Last Edited: 2016-10-10 01:20:07 by firechief
                    Author: jspenn | Created: 2016-10-09 21:41:47
                    Subject: Re: Robot skin change
                    See my earlier post about the power of white cars.
                    Last Edited: 2016-10-09 21:41:47 by jspenn