Race Spectator

You can make one if the language has a TCP connection. Haven't done much PHP programming lately. Sure its possible, but how would you keep the connection alive? Create an Ajax script that executes every 30 seconds a php file? How would a disconnect be?
 
Updated the GUI a bit :) and fixed some bugs.
  • Fixed driver swap. RS did hang when a driver swap took place in a populated server.
  • Race info, column now sorted on position
  • Give total time to the next driver in a driver swap action

Click the image for fullscreen.
Todo: Add the new South City (SO6) pth file,
 
Righ, I need some Math help :), as you can see in the image above, the track is displayed with a single line. The track exist out of few hundererd 'nodes', and i'm drawing a line through the x and y positions of each node. Simple and effective.
Now the more advanced bit: Each node has more information about how wide the track is, and where you can drive.
Visual aid:
http://img225.imageshack.**/img225/7379/lfsnodeig7.gif
Code:
Console.WriteLine(n.CenterX + "," + n.CenterY); 
Console.WriteLine(n.LimitLeft + " " + n.DriveLeft); 
Console.WriteLine(n.DirectionX + " " + n.DirectionY); 
  
-2513179 -32655587 
-10.10002 -2.349999 
-0.9909657 0.1341159
I'm drawing the black x and y position values atm. The yellow/red arrows are the distance values for LimitLeft & DriveLeft.
How can I get an X and Y position of "LimitLeft" and "DriveLeft"? So i can draw the outline of the track.
 
I'm drawing the black x and y position values atm. The yellow/red arrows are the distance values for LimitLeft & DriveLeft.
How can I get an X and Y position of "LimitLeft" and "DriveLeft"? So i can draw the outline of the track.

You need to find the direction angle. I'm not sure what exactly DirectionX and DirectionY is. Is that the angle from 0,0 (x,y)?

Once you have the angle, you can use that to find out how much to add to centerX and centerY using Trigonometry:
http://www.visualtrig.com/Default.aspx

But given that that is high school stuff (and I haven't done that in close to 20 years), did I misunderstand your question?
 
Can't you have a look at those replay analyser applications that use the raf (?) files for comparing & analysing driving lines speed etc?

I mean either look at the code of those if possible or maybe PM the guys who made those applications?
 
I've almost got it... kinda. Not sure why the lines are intersecting. :mad:
Green line should be the DriveLeft and the blue line should be DriveRight.
https://pic.armedcats.net/2007/12/17/rsimage.jpg
I've tried this approach, look at solution number 3.
Tried all kind of different stuff. Why is such an 'easy' math question so difficult to solve <_<
 
I've almost got it... kinda. Not sure why the lines are intersecting. :mad:
The "direction angle" is the angle of the track right, and not the direction of the car?
If it's the direction of the car then that might explain why it's intersecting.
The other possibility is that the angle is wrong (it should be 90 degrees from the direction of the track).

I've tried this approach, look at solution number 3.
Tried all kind of different stuff. Why is such an 'easy' math question so difficult to solve <_<
That is the correct approach I think.
 
Code:
Console.WriteLine(n.CenterX + "," + n.CenterY); 
Console.WriteLine(n.LimitLeft + " " + n.DriveLeft); 
Console.WriteLine(n.DirectionX + " " + n.DirectionY); 
  
-2513179 -32655587 
-10.10002 -2.349999 
-0.9909657 0.1341159
Wait, I think I see what they're doing with DirectionX and DirectionY.
Is it possible that it's as simple as this (not sure if I have the plus or minus correct):

Code:
DriveLeftX = CenterX - (DirectionX * DriveLeft)
DirveLeftY = CenterY - (DirectionY * DriveLeft)

DriveRightX = CenterX + (DirectionX * DriveLeft)
DriveRightY = CenterY + (DirectionY * DriveLeft)
 
Last edited:
The beta version, LFSForum post.
Some feedback would be nice :)
Espn, I'm not sure how to calculate the angle, or what the directionx/directiony values mean. I'll leave it like this now.
With the info above, someone could calculate the position for DriveLeft, then i can check if the solution is ok by putting it in RS.
oh and vote here :mrgreen:
 
Already voted for you ;).
 
Top