The online racing simulator
OutGauge - now available in T6
(165 posts, started )
What I am talking about is a way to do this with zero user intervention. Where the ranges of the gauges are always and instantly identical to those in the ingame dashboard, and don't fluctuate as you drive (or, say, switch around in spectator mode) while the program tries to figure out how the car is performing. Hence the "as soon as you get in the car." I suggest you read more carefully before replying in the future if you are going to patronize me.
Forgive me for not understanding, but if you've making physical gauges, why do they have to match exactly in the real world?

With regards to a "solution" - considering that you can init Outgauge over InSim, and considering that you can use InSim to detect what vehicle you are currently sitting in, you can then use a simple lookup database from which you can check to see what the max you should setup to go to. If the LFS vehicles change spec all you need to do is update and distribute that database to your users. That fills all your boxes.

I can't see Outgauge getting the additional information you want (i.e. max revs) though, as it would wipe out the few remaining spare bytes (which I'm sure are reserved for other things), which would mean that Outgauge would need to be altered, which in turn would break any existing tools - which is something Scawen has shown in the past a great dislike for doing.
#128 - gru
Quote from Almadiel :What I am talking about is a way to do this with zero user intervention

i get Your point, but i dont think its really important to have this values in OG
is that really a problem to check gauges range during development?
we dont have new cars every month, so U could just release patch when its needed

as for revs, there is no realistic max rpm at this point of LFS development
there are OG_SHIFTLIGHT and OG_REDLINE flags, but if U shift down to 1st gear at high speed, your XFG will reach 15k rpm
Here's my RPM-range data, should be pretty accurate:
uf1 = 6983
xfg = 7978
xrg = 6980
lx4 = 8974
lx6 = 8975
rb4 = 7480
fxo = 7482
xrt = 7480
rac = 6985
fz5 = 7971
ufr = 8978
xfr = 7979
fxr = 7492
xrr = 7492
fzr = 8474
mrt = 12917
fbm = 9179
fox = 7481
fo8 = 9476
bf1 = 19912

€: and the turbo pressure:
rb4 = 0.731382
fxo = 0.733507
xrt = 0.830510
rac = 0.482715
fxr = 1.759917
xrr = 1.759917
mrt = 0.138831

I suppose the lookup table approach would work, and I see your point about the fixed data structure size. And if this information were to be reported I suppose InSim would be a more logical place to put it, since max rpm isn't something that changes continuously. I still think there should be some way to get this information directly from the sim, however. After all there will be an S3 eventually, and there could always be balance tweaks.
#131 - gru
Quote from Almadiel :I still think there should be some way to get this information directly from the sim, however.

yes, but not by OG
since this is constant data, it would be waste to send it several times per second


I still don't understand why the sims has to bother givin you that information. Just throw those max rpm values in a few #define's and you're set. And for recording the amount of rpm's for each individual gear when you hit the shiftpoint, you just make a program that figures it out. I can even post the c# code i have for it.

Please don't make outgauge more complicated because it wasn't supposed to be.
You don't even need to find the car through InSim. OutGuage has the car name

struct OutGaugePack
{
unsigned Time; // time in milliseconds (to check order)

[B] char Car[4]; // Car name[/B]
word Flags; // OG_FLAGS (see below)
byte Gear; // Reverse:0, Neutral:1, First:2...
byte SpareB;
float Speed; // M/S
float RPM; // RPM
float Turbo; // BAR
float EngTemp; // C
float Fuel; // 0 to 1
float OilPress; // BAR
float Spare1;
float Spare2;
float Spare3;
float Throttle; // 0 to 1
float Brake; // 0 to 1
float Clutch; // 0 to 1
char Display1[16]; // Usually Fuel
char Display2[16]; // Usually Settings

int ID; // optional - only if GameID is specified
};

It's very easy to find the max RPM for each car. Just get in and floor it. The max RPM won't change no matter what gear you're in. If someone downshifts too early and overrevs, then let it spin off the gauge, like it does in LFS. You can then (very easily) make a switch that changes the max RPM depending on what car is being used. Easy-peasy

What I'd like to see in OutGauge is wheel angle. There's a few situations where it would be very useful to have. Or maybe have it in OutSim. It would be very handy to have it there, even if it's rarely used Oh, and I'm also waiting (patiently ) for engine temp and oil pressure to be hooked up
Quote from dougie-lampkin :You don't even need to find the car through InSim. OutGuage has the car name

Touché Shows last time I used OG was some time ago
I have a (stupid) question about OutGauge.. I'm kinda first day writing C# (.NET). I got it receiving LFS OutGauge UDP packets but now I don't know how to read the needed values (speed/RPM etc). I saved one packet into a text file - here it is:
d XRG Ą !ĖmD ? g˛I= Fuel 50.0% Brake Bal Fr 74%

There aren't examples for C#, that's why I'm askin.
I normally hate seeing these kinds of responses but I know feel compelled to finally write one.

If it is your first day with C# and you do not understand the LFS examples shown so far... then you have more lessons to study before trying any Outgauge coding.

Even generic C examples, such as those by Vladimir Kadlec with his Gear Indicator will show you how to read the packet in way that you should understand and apply to C#.

Maybe by studying the Gear Indicator project code you will gain the skills you need. Until then, you are the Grasshopper that cannot yet snatch the pebble from the Master's hand.

Basically, at this stage, anything we say in trying to assist you will likely come out in SIMLISH.

http://en.wikipedia.org/wiki/Simlish
RC1 of my app, LFSTach. It's kinda useless just wanted to do something with outgauge. Anyway, I hope It's ok to use AnalogGauges graphics. Half of the credit goes to the author of these bad-ass gauges.

PS: PWILLARD, managed to read the data byte-by-byte. No libraries or anything. Just System.Net.Sockets.

WARNING: App is *completely* untested. Crashes if LFS isn't running or no race/replay isn't running at the moment - reason: UDP packets aren't coming but I use timer control (1ms delay) to receive data. If no data is sent by LFS, app crashes..
Attached images
lfstach.png
Attached files
LFSTach.rar - 116.6 KB - 422 views
Very nice , and i like you other videos , too
WOW!!! Very nice man!

Good job!
Nice job! Looks really slick and smooth!
the sound is a bit delayed in the video
Hi, i'm new in VB6, but i'm making a simple program to recieve data from outgauge.

I see Speed, RPM, turbo.. etc. But I don't know how to use "flags". I want to make visible or invisilbe an image when shiftlight goes on. The code that I use is..

If OG_SHIFTLIGHT = 1 Then LEDShiftLigth.Visible = True
If OG_SHIFTLIGHT = 0 Then LEDShiftLigth.Visible = False

The problem is OG_Shiftlight is a constant not a variable and ever is 1. ¿How I can do?
You need to use an AND operator. I don't know how it look in VB6 but in C it would be like this :

if (Flags & OG_SHIFTLIGHT)
{
// shift light is on - do something
}

The OG_ numbers represent individual bits in the flags value. The AND operator is used to detect if that bit is set.
Here's a site I found where you can read up on bit flags in VB6, in case you are interested how they work. But yeah, as Scawen said, to read it you'd have to write:

If (Flags And OG_SHIFTLIGHT) > 0 Then
...
I'm trying but i can't to do I don't have sufficient skills in programming

If I put the line:

If (Packet.Flags And OG_SHIFTLIGHT) > 0 Then LEDShiftLigth.Visible = True

I have an error. "compile error: Type mismatch"

and VB6 underlines the word AND, if I put & I have the same error

OutGauge - now available in T6
(165 posts, started )
FGED GREDG RDFGDR GSFDG