The online racing simulator
OutSim and OutGauge
(8 posts, started )
OutSim and OutGauge
Hello all

I am trying to write application in C++ to read packets from UDP port. I am receiving bytes on desired port successfuly. My question is, what is difference between OutSim and OutGauge? Do I need to set OutSim port or OutGauge to get all telemetry i want?

Another question: I am receiving bytes, but i am having problems finding out which bytes are for speed, laps, position, fuel, time, etc... Is there any raw data structure that could help me?

I have this so far:
- Speed: 4 bytes (12, 13, 14, 15)
- Gear: 1 byte (10)
- RPM: 4 bytes (16, 17, 18, 19)
#2 - amp88
Read the OutSim and OutGauge sections of the InSim.txt file in your LFS/docs directory. This explains the differences between the two and the formats of the data for each.
This is the whole structure? I am sorry but i am not experienced C++ programmer and never worked with structures like that. Any help or C++ example would help me a lot

// OutGauge - EXTERNAL DASHBOARD SUPPORT
// ========

// The user's car in multiplayer or the viewed car in single player or
// single player replay can output information to a dashboard system
// while viewed from an internal view.

// This can be controlled by 5 lines in the cfg.txt file :

// OutGauge Mode 0 :0-off 1-driving 2-driving+replay
// OutGauge Delay 1 :minimum delay between packets (100ths of a sec)
// OutGauge IP 0.0.0.0 :IP address to send the UDP packet
// OutGauge Port 0 :IP port
// OutGauge ID 0 :if not zero, adds an identifier to the packet

// Each update sends the following UDP packet :

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

char Car[4]; // Car name
word Flags; // Info (see OG_x below)
byte Gear; // Reverse:0, Neutral:1, First:2...
byte PLID; // Unique ID of viewed player (0 = none)
float Speed; // M/S
float RPM; // RPM
float Turbo; // BAR
float EngTemp; // C
float Fuel; // 0 to 1
float OilPressure; // BAR
float OilTemp; // C
unsigned DashLights; // Dash lights available (see DL_x below)
unsigned ShowLights; // Dash lights currently switched on
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 OutGauge ID is specified
};

// OG_x - bits for OutGaugePack Flags

#define OG_SHIFT 1 // key
#define OG_CTRL 2 // key

#define OG_TURBO 8192 // show turbo gauge
#define OG_KM 16384 // if not set - user prefers MILES
#define OG_BAR 32768 // if not set - user prefers PSI

// DL_x - bits for OutGaugePack DashLights and ShowLights

enum
{
DL_SHIFT, // bit 0 - shift light
DL_FULLBEAM, // bit 1 - full beam
DL_HANDBRAKE, // bit 2 - handbrake
DL_PITSPEED, // bit 3 - pit speed limiter
DL_TC, // bit 4 - TC active or switched off
DL_SIGNAL_L, // bit 5 - left turn signal
DL_SIGNAL_R, // bit 6 - right turn signal
DL_SIGNAL_ANY, // bit 7 - shared turn signal
DL_OILWARN, // bit 8 - oil pressure warning
DL_BATTERY, // bit 9 - battery warning
DL_ABS, // bit 10 - ABS active or switched off
DL_SPARE, // bit 11
DL_NUM
};

//////
#endif

You can also find InSim.txt on the wiki at http://en.lfsmanual.net/wiki/InSim.txt

Very handy if you're developing on a computer with LFS installed

OutSim and Outgauge are at the bottom of the file.

OutSim - MOTION SIMULATOR SUPPORT
OutGauge - EXTERNAL DASHBOARD SUPPORT

Edit: Yes it's that whole struct you'll be working with. You don't have to use C++, any programming langauge that's capable of networking can be used.
thank you. so i guess i will need outGauge packets bu i cant find data like best time, last time, current position, lap count in documentation
Lap count, lap time and position are in the InSim docs.

ISP_LAP, // 24 - info : lap time
ISP_SPX, // 25 - info : split x time

and ISP_NLP, ISP_MCI.
You can't get lap times, etc. through Outgauge, you can only get that via InSim. Outgauge is literally just what the dials in-game show

It's possible to use InSim and Outgauge at the same time, though. However it's a bit more complex as using InSim you get information about every vehicle in-game, not just your own.

To use InSim+Outgauge at the same time you'd setup an InSim connection, and in the IS_ISI packet you'd set udpport to your UDP listener, and then send a IS_SMALL with subt set to SMALL_SSG (2). You'd then use the plid in the outgauge pack to know what IS_LAP, etc. packets to look for (since you'd get them for any player).

That might sound a little confusing if you're familiar with InSim... It might be worth checking out InSim.txt which explains each packet, and possibly checking out various libraries for InSim - since they remove some complexity for maintaining InSim connections and how to deal with packets. There are a whole bunch of libraries in http://www.lfsforum.net/forumdisplay.php?f=179 for PHP, Python, .Net, etc.

I've gotta head back to work now, so I probably won't be able to look at this thread until later today, but I'm sure other guys here can help out
Thank you guys for helping me. I think i got what i need. I will try again and report back when im done.

OutSim and OutGauge
(8 posts, started )
FGED GREDG RDFGDR GSFDG