The online racing simulator
GteK - LFS Accelerometer
(56 posts, started )
GteK - LFS Accelerometer
I've wanted to make a simple app like this for a long time and
a recent thread has given me the push to give it another try
(the Gmeter version didnt give the results expected, mostly
due to refresh rate/latency).

Here is my first version, GteK P001. P is for LFS 0.5P which is
the version it is based on. I don'T garantee it'll work on the
test patches, but tell me if you try and it does/doesn't.

To use:

1- Make sure both 'lights' are green (LFScheck, CARcheck)
2- Click connect to update velocity in real-time (10ms updaterate)
3- Select the Acceleration test (Distance test is still being worked on)
4- Select the start and end speed for your test
5- Click Ready and read message, click OK.

Once test is finished:

1- Click OK on the popup, it hides behind the LFS window (ill fix it..)
2- Results appear in the LOG (you can only read the results for now)

UPDATE: GteK P02
- Added a Refresh Rate button
- Changed the message popup to work in LFS
(LFS displays error in chat when i make it the top window for some reason)
Attached images
GteK_ss01.jpg
Attached files
GteK_P02.zip - 18.3 KB - 2007 views
@Fonnybone

Nice and thanks
Looks good fonnybone! :up: Nice work, once again
#4 - _rod_
Thanks fonnybone, nice work!!!
Cheers Mr Bone
In P9 it detects LFS but it's doesn't detects the car
Heh, looks nice
Quote from hrtburnout :In P9 it detects LFS but it's doesn't detects the car

I have the same roblem, but I have P7 illepall
lucky me, i got lfs P2 and P9 (one for normal racing , one for slickmod and other stuff )
EDIT actually i found out that i doesnt work with P2....
Oh well, it was to be expected. Hopefully not all test patches are different
so maybe i could make a version for those, just not for now.

Thanks for the reports though guys
hmm

0-100 in:
XFGTI: 4.9
FXO GTR: 1.8
UF1000: 7.0

Either your program is wrong or these cars are too quick off the line.

FPVaaron did those cars in:
XFGTI: 8.23
FXO GTR: 2.87
UF1000: 10.74
I didn't go through all the cars yet, but it has no reason to be wrong
basically. GteK reads velocity directly from LFS (the SAME data you see
on your speedo) and then i have a counter running in the back. If you
followed the steps correctly, it should be fine.

One way to check is to record a replay and start a race, both LFS and
GteK counters will start together (if you start at the green light of
course..) and checking the replay you can look at the LFS time once
you reach 100kmh. A good place to test is the drag track of course
Do a few races and look at the replays to check the time @ 100kmh.
sorry mate your program is totally wrong when i run it. I did a drag run and i heard the ding at 11 seconds yet your program showed 6.
er silent how about you give some more info than saying
"it doesnt work" ...
It appears your timer doesnt run properly when it is receiving the data from LFS. It works fine if i focus on your program but as soon as i go back to LFS it slows right down.

Ok i capped the FPS to 60 (was around 90 on the drag strip) and the timer run much better but was still off the in game timer. It could just be my cpu cant keep up or something? Its an Athlon 2500+
XCNuse:
Im still testing it to figure out exactly what isnt working.
Actually, people before you seem to say it's fine, so i don't think my
"program is totally wrong". In fact i'm making tests right now and it
looks fine. The only thing i found is that it seems to stop at 96-97kmh for
some reason. I use m/s, like LFS, then convert to kmh or mph. so that
might be a small detail to fix, but the times are still realistic.

There COULD be something else making your results turn out so wrong.

After a few 0-100kmh tests and i get:

XF GTi
8.010
8.000
8.000

FXO GTR
3.290
2.960
3.340

UF1000
10.410
10.100
9.800

Seems fine to me. Maybe your PC is making the VB timers
over-active...what did you do to your PC ?! lol

Edit: Yeah, it could very well be the timer that's a problem on your PC. Short
of using the LFS time, which isn't as easy to do as it is to say, i'm not sure
how to fix this. What i COULD do is use your PC's time though I'll see what i can do.
That might mean that LFS is running slow/fast on some PCs though, mmmm
Perhaps the CPU usage is too high, to allow for the timer to function correctly. Timestamping the InSim data from start to finish is a good idea

Perhaps you could release a test version with both methods. I've not had any issues on my backup LFS version (P9 of LFS refuses to work though).
Quote from the_angry_angel :Perhaps the CPU usage is too high, to allow for the timer to function correctly. Timestamping the InSim data from start to finish is a good idea

Perhaps you could release a test version with both methods. I've not had any issues on my backup LFS version (P9 of LFS refuses to work though).

Hehe, interesting, this is where my l4m3r background rears it's ugly head...
The more experienced programmers out there might see what i did here.
Like mentionned in my first post, i'm trying to bypass all this InSim/OutSim
stuff since i couldn't get an acceptable refresh rate to have any useable data.
That was an issue with Gmeter, which is written in Delphi btw. I never managed
to make an InSim-OutSim app work myself in VB, else i'd be working on making
that more accurate first.

GteK just reads the velocity directly from LFS at a VERY FAST rate.
First thing i could try is to make that refresh rate user-adjustable, but
then again, this is where Gmeter started getting erratic in the results,
basically, there would be no way to get accurate results as all become
an approximation of an approximation and so on...it's still a very usefull
feature though so i'll just add it to test at least.

Reading about how changing the FPS cap affects GteK's timer, i think this is
really what's happening here. Perhaps being able to set it to match the FPS
is a better solution in getting accurate results that match those from LFS.
Whatever way i look at it, it HAS to be a timer issue.

So the basic problem here is that to be able to get the EXACT time at which
100kmh (example) is reached. There is no other need for a fast update rate really.
Short of this code being part of LFS, there is no easy way to get accurate time imo.

I just thought of something, you guys are using LFS in a window, right ?
FPS does affect the timer but only slightly. At 60fps i get around 6 seconds while at 10fps i get almost 8. Also at 60fps LFS is using 50% of the cpu.
Yes LFS was windowed but im sure i did it once in fullscreen as i thought that may have been the problem but it didnt change anything.

Just tried again and there is no difference.
Quote from Fonnybone :I never managed to make an InSim-OutSim app work myself in VB, else i'd be working on making that more accurate first.

Hmm, somebody else has asked me to make an app in VB to read OutSim values, I'll give it a go and see how far I can get.
Ok, i posted an updated version for testing.

Bob, thanks for trying I have a few links somewhere to do
it but if i remember VB doesn't work with UDP without some
extra code to get working. Peeps1980, the one who programmed
Gmeter tried but reverted to Delphi as he was more familiar with it
and it was much simpler to get it working.
im getting the same results in both of your programs as well as gmeter which still works with s2. So it must be a problem my end if everyone has it working fine.
Quote from Fonnybone :Like mentionned in my first post, i'm trying to bypass all this InSim/OutSim
stuff since i couldn't get an acceptable refresh rate to have any useable data.

:doh: Missed that completely
still wont work, not with P9 and not with P2.

GteK - LFS Accelerometer
(56 posts, started )
FGED GREDG RDFGDR GSFDG