program to measure Length (in pixel) and Speed of a track

Discussion related to Turbo Sliders and beta version feedback.

Moderator: Forum Moderators

User avatar
benzinfurz
Community User Level: 2
Community User Level: 2
Posts: 195
Joined: Tue Mar 01, 2005 3:12 pm
Contact:

program to measure Length (in pixel) and Speed of a track

Post by benzinfurz » Fri Aug 04, 2006 11:49 am

Hey guys,

after discussing about track description in TS centralized webpage, i've developed a little tool to measure the length of a track in pixels.

You have to click the way a TS car would drive on the track and so the pixels are measured.

Through this measurement you can also measure the speed of a track by dividing Length with the record in seconds, so you will have a speed of
pixels per second

Program is free to download here

PLS READ THE README FILE BEFORE USING THE PROGRAM!

Any other questions or suggestions could be posted here.
dies irae, dies illa
solvet saeclum in favilla
www.benzinfurz-ts.de.vu/

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Fri Aug 04, 2006 11:56 am

Great, this will be very useful for track classifications.

User avatar
Mouse
Community User Level: 5
Community User Level: 5
Posts: 1358
Joined: Fri May 20, 2005 1:56 am

Post by Mouse » Fri Aug 04, 2006 6:15 pm

Nice! This will be a nice tool to use in the GPOR pack, to give a little more info on each track. Nice job!
Image

User avatar
-wolf-
Community User Level: 4
Community User Level: 4
Posts: 614
Joined: Sat Nov 05, 2005 10:07 pm
Contact:

Post by -wolf- » Fri Aug 04, 2006 8:28 pm

yeah thats good! 8)

PS how do u and jazzy and mike make programms anyway? :shock: :?:
Image
Image

User avatar
Mouse
Community User Level: 5
Community User Level: 5
Posts: 1358
Joined: Fri May 20, 2005 1:56 am

Post by Mouse » Fri Aug 04, 2006 8:48 pm

Forestry is 4864 Pixels long. :P
Image

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Fri Aug 04, 2006 9:25 pm

mouse wrote:Forestry is 4864 Pixels long. :P
For which car? How did you measure it? I was thinking that maybe the lengths should be generally measured as the shortest length of the track, otherwise the lengths would vary depending on the car.

User avatar
Hengari
Community User Level: 3
Community User Level: 3
Posts: 462
Joined: Thu Nov 18, 2004 5:14 pm
Contact:

Post by Hengari » Fri Aug 04, 2006 10:25 pm

Slider wrote:yeah thats good! 8)
PS how do u and jazzy and mike make programms anyway? :shock: :?:
I think that jazzy with Visual Basic (which is relatively easy) or such and I haven't tested benzin's tool yet.
oldschool slider <3 | Hengari @ Quakenet/IRCnet
sliderpoint

User avatar
Mouse
Community User Level: 5
Community User Level: 5
Posts: 1358
Joined: Fri May 20, 2005 1:56 am

Post by Mouse » Fri Aug 04, 2006 10:28 pm

mikko wrote:
mouse wrote:Forestry is 4864 Pixels long. :P
For which car? How did you measure it? I was thinking that maybe the lengths should be generally measured as the shortest length of the track, otherwise the lengths would vary depending on the car.
Im confused....how can distance of a track be changed by a car? I read his README file and did what it said, and it gave me the track length of Forestry.

BTW in this program, i have a problem. I can't see the buttons, they are invisible. I got lucky to find them.
Image

User avatar
Hengari
Community User Level: 3
Community User Level: 3
Posts: 462
Joined: Thu Nov 18, 2004 5:14 pm
Contact:

Post by Hengari » Fri Aug 04, 2006 10:31 pm

mikko wrote:
mouse wrote:Forestry is 4864 Pixels long. :P
For which car? How did you measure it? I was thinking that maybe the lengths should be generally measured as the shortest length of the track, otherwise the lengths would vary depending on the car.
What is the shortest length? Measured from center of the track with drivin lines (for which car) or average lenght measured whole track from the center of the track. (After I go back home, I have to test this)
oldschool slider <3 | Hengari @ Quakenet/IRCnet
sliderpoint

User avatar
Mouse
Community User Level: 5
Community User Level: 5
Posts: 1358
Joined: Fri May 20, 2005 1:56 am

Post by Mouse » Sat Aug 05, 2006 2:32 am

When i measured, i clicked along the middle of the track, not the racing line of the track.
Image

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Sat Aug 05, 2006 5:57 am

Perhaps it would be easiest to just use the middle of the track as mouse did. But on second thought, that would produce quite absurd average speeds for some tracks/cars. Consider arena with antislider, for example. If the length of the track is measured from the middle of the track, then average speed obtained for antislider would greatly exceed its maximum speed.
Last edited by mikko on Sat Aug 05, 2006 6:22 am, edited 1 time in total.

Ahsen
Community User Level: 1
Community User Level: 1
Posts: 48
Joined: Mon Jul 18, 2005 6:53 am

Post by Ahsen » Sat Aug 05, 2006 6:20 am

Question: how accurate is this?
Perhaps it could be automated, using the pattern file. I wouldn't know if this is possible, but it'd make it much more accurate.
So here goes: You know that the normal track width is 74 pixels. So if you could make a program that measures all the asphalt pixels, you know everything which uses the asphalt pattern colour. Then the program would divide that asphalt pixel count by 74 and we would get the track length. It's like.. it automatically makes a straight line, using the parameters given (asphalt pixel count and track width). This line would be 74 pixels wide and then we see how far it goes. And that would give us the track length. Does any of this make sense?

User avatar
benzinfurz
Community User Level: 2
Community User Level: 2
Posts: 195
Joined: Tue Mar 01, 2005 3:12 pm
Contact:

Post by benzinfurz » Sat Aug 05, 2006 10:22 am

PS how do u and jazzy and mike make programms anyway? Shocked Question
my program is made with delphi pascal dont know if someone knows this ;)
BTW in this program, i have a problem. I can't see the buttons, they are invisible
Do you see the white letters that says "load""choose..." and so on mouse ?

I think the right measuring method with this prog is to use the exactly best lin e a car could drive although this line is not possible
To make a good measuring i think you have to do about 5-10 measurings and then use the middle length so you might have an exact result

i measured arena and sausatoo for example
arena results: 2595,2586,2587 middle: 2589 record: speeder 9,8
sausatoo : 1652,1647,1649 middle: 1649 record: speeder 11,0


with dividing by records(best default car) i got a speed of
arena : 264/s
sausatoo: 150/s

so i think there is a good result here, because the speed on arena is very higher than speed on sausatoo
dies irae, dies illa
solvet saeclum in favilla
www.benzinfurz-ts.de.vu/

User avatar
benzinfurz
Community User Level: 2
Community User Level: 2
Posts: 195
Joined: Tue Mar 01, 2005 3:12 pm
Contact:

Post by benzinfurz » Sat Aug 05, 2006 10:27 am

forgot something ;)

about ahsen's post:

it would probably be a bit more accurate to use an automatic measuring but it would take much more developement time so maybe in a few weeks such a program would be possible.
i wouldve to think about it ;)
dies irae, dies illa
solvet saeclum in favilla
www.benzinfurz-ts.de.vu/

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Sat Aug 05, 2006 1:13 pm

Yes benzinfurz, using the best lines of each car would produce the most accurate lengths and speeds. I see two problems here, however. (1) Each track would have several lengths and (2) one would need to know the best driving lines of each car. For standard cars this might be acceptable. There would just be the five car-specific lengths for the track and for obtaining the best driving lines, help could be asked from the pro drivers. But how about all the other cars? There is a danger of the measurements becoming one big mess.

User avatar
benzinfurz
Community User Level: 2
Community User Level: 2
Posts: 195
Joined: Tue Mar 01, 2005 3:12 pm
Contact:

Post by benzinfurz » Sat Aug 05, 2006 6:05 pm

i didnt use the fastest line for each car,
i use the SHORTEST line not depending on a car,
which is not the fastest line in nearly all cases.
here is a picture of it :
Image

this maybe differs from time to time but only up to 10 pixels so if you measure 5-10 times you could get a very exact length
dies irae, dies illa
solvet saeclum in favilla
www.benzinfurz-ts.de.vu/

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Sat Aug 05, 2006 6:12 pm

OK, good. This is exactly what I requested above, and I think it is the most practical solution.

User avatar
u9
Community User Level: 1
Community User Level: 1
Posts: 65
Joined: Thu Aug 24, 2006 9:04 pm
Contact:

Post by u9 » Fri Aug 25, 2006 12:01 pm

mikko wrote:Yes benzinfurz, using the best lines of each car would produce the most accurate lengths and speeds. [...]
You must be joking?

Why do you guys want to bring the car into the measurement? A track has one length, the middle of the track all the way round (just as I have the same amount of Km to work whether I walk on the left side of the road or the right side). How fast a car can complete a lap relies on how curvy and straight it is as well as the handling, grip, acceleration and top speed of the given car. Why on earth do you guys want the length of the track to be dependant on the car? :)
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Fri Aug 25, 2006 12:48 pm

u9 wrote:
mikko wrote:Yes benzinfurz, using the best lines of each car would produce the most accurate lengths and speeds. [...]
You must be joking?
:shock: I don't think that was a joke, but if it was, it wasn't a very funny one.
Actually, the mathematics involved here is quite simple. I'll explain.
(1) length = distance travelled. In average, a car travels approximately its optimal driving line. Thus, the length of a track for a given car is its optimal driving line.
(2) speed = velocity = distance the car travels in a certain time divided by that time (v = d/t). Here, the actual distance = the driving line of the car through the lap and the certain time = the time it takes to complete exactly one lap.

However, instead of mathematical treatment I'd rather use the shortest line due to practical reason. Exactly the way benzinfurz illustrated above.

u9 wrote:A track has one length, the middle of the track all the way round (just as I have the same amount of Km to work whether I walk on the left side of the road or the right side).

Please, give this sentence a second thought. This is the case only if your way from home to work is exactly a straight line. And even then it slightly varies depending on where your home door and work door are exactly located. If there are any curves, the situation changes. Just consider arena, for example. Wouldn't the distance travelled be longer if you use the right side (inner circle) or left side (outer circle) of the track?

User avatar
u9
Community User Level: 1
Community User Level: 1
Posts: 65
Joined: Thu Aug 24, 2006 9:04 pm
Contact:

Post by u9 » Fri Aug 25, 2006 1:56 pm

mikko wrote:[...]
u9 wrote:A track has one length, the middle of the track all the way round (just as I have the same amount of Km to work whether I walk on the left side of the road or the right side).

Please, give this sentence a second thought. [...] Just consider arena, for example. Wouldn't the distance travelled be longer if you use the right side (inner circle) or left side (outer circle) of the track?
Not considering the curvature of space-time, the shortest distance between two points is a straight line, I know :) I know that walking on the left side vs. the right side to work is not the exact same distance. My point was that it is classified as the same distance (route maps etc.) and I think the tracks should too.

Different Cars - Same Distance?
Imaging I had two cars, and one had a wider wheel-base then the other. The wider car would have a longer distance to travel because it's center (center of mass if you will) would not get as close to the inside of the corners as the more narrow car. But I would still say they had the same distance to travel.

Mathematically Correct?
Finding a mathematically correct average speed of a car around the track would require calculating the exact distance traveled by that car, and that is impossible (or impractical at the very least and useless for classification to anyone but oneself). Different cars use different lines, but what is worse, is that different players use different lines.

With a mathematically correct calculation of average speed you would actually find that a car with lower average speed could win a race over a car with higher average speed. This is because the one with higher average speed could actually have so much more distance to travel that it would still loose the race. That to me is a wrong representation of average speed (in a race or racing game only of course ;) )

My point is I don't think the small nuances should be considered. I think the length of a track should be measured from the center of the track as the (my) government measures its roads.

I wouldn't take the shortest possible distance because it would make the average speed more off from the real average speed. No car can take that distance unless it defies the laws of physics (as stated by our great Sir. Newton) and therefore the center of the track is a better choice.

(I hope I'm right about this. Of course using center of track could be too much on the other side of the real distance traveled by any given car in which case I'm wrong. But it seems very unlikely to me.)

Testing
If you calculate the average distance all the different cars have around the track at their ideal line, I think the distance measured at the middle of the track would be closer to that average than the distance measured at the shortest possible distance. One could actually try it out, right?

Improvements to the Program
benzinfurz, you could semi-automate the program by letting the user place points around the track, and then the program adjusts the points a random small amount and based on your criteria (shortest distance / middle of track) you could keep or discard the change. Repeating this process for all points placed by the player would have the points converge to the line you like.

If you want shortest distance around the track, your criteria for keeping/discarding a change is based on whether the two lines the point is connecting become shorter or not. If they become shorter you keep the change, if they become longer you discard the change.

If you want a point to converge to the middle of the track, you have the point calculate the distance to the edge in all 4 (or 8 or even 16) evenly spaced directions and based on those distances decide whether to keep the change or not.

Go figure...
I didn't even intend to write this much hehehe... I actually deleted half of my previous post because I thought it would be too much nonsense to read :oops:
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com

mikko
Community User Level: 2
Community User Level: 2
Posts: 217
Joined: Fri Jan 13, 2006 8:38 pm

Post by mikko » Fri Aug 25, 2006 2:25 pm

u9, I understand and acknowledge your point of view of the use of the middle of the track. Unfortunately, it gives rise to an annoying problem, which I descibed previously:
mikko wrote:Perhaps it would be easiest to just use the middle of the track as mouse did. But on second thought, that would produce quite absurd average speeds for some tracks/cars. Consider arena with antislider, for example. If the length of the track is measured from the middle of the track, then average speed obtained for antislider would greatly exceed its maximum speed.

User avatar
-wolf-
Community User Level: 4
Community User Level: 4
Posts: 614
Joined: Sat Nov 05, 2005 10:07 pm
Contact:

Post by -wolf- » Fri Aug 25, 2006 3:51 pm

i though this program was on how to measure seconds.... :lol: anyway, wats the point of measuring pixels of a track? :shock:
Image
Image

User avatar
u9
Community User Level: 1
Community User Level: 1
Posts: 65
Joined: Thu Aug 24, 2006 9:04 pm
Contact:

Post by u9 » Fri Aug 25, 2006 6:22 pm

Slider wrote:i though this program was on how to measure seconds.... :lol: anyway, wats the point of measuring pixels of a track? :shock:
hmm... that's interesting. I just noticed the topic name :) But what's the point of measuring the speed? There are many questions.

I guess you could use both average speed around a track and the length of a track for classification. You know, what type of track are we talking about, short, long (length), slow, fast (avg. speed).

Don't worry, you probably won't become a better racer for it ;)
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com

User avatar
-wolf-
Community User Level: 4
Community User Level: 4
Posts: 614
Joined: Sat Nov 05, 2005 10:07 pm
Contact:

Post by -wolf- » Fri Aug 25, 2006 6:38 pm

im not bad anyway. who needs to measure trk in pixels? i dont get it. it would be nice to have a program taht allows you to choose a track and car and it'll tell you wats the average of secs of the car's speed on this trk per lap or tell you the secs of the line you would draw :shock: :D
Image
Image

User avatar
u9
Community User Level: 1
Community User Level: 1
Posts: 65
Joined: Thu Aug 24, 2006 9:04 pm
Contact:

Post by u9 » Fri Aug 25, 2006 8:46 pm

Slider wrote:[...] who needs to measure trk in pixels? i dont get it [...]
Well benzinfurz does apparently. Personally I like the idea. The usability is crap, but it works. If you only want the average speed (pixels per second) for a track then that is probably fine too, but then you need to know the length of the track as well as your race/lap time :shock:
Slider wrote:[...] it would be nice to have a program taht allows you to choose a track and car and it'll tell you wats the average of secs of the car's speed on this trk per lap or tell you the secs of the line you would draw :shock: :D
Sorry, I didn't understand this.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com

Post Reply