The online racing simulator
OutSim With Dirt2 and Grid?
1
(39 posts, started )
OutSim With Dirt2 and Grid?
Hello,

As I mentioned before, I am developing an app that utilizes InSim/OutSim. I've learned that Codemasters uses an OutSim similar mechanism to export Dirt2 and Grid info. It would be nice to get a couple of extra supported games with minimal additional effort.

Does anyone know what differences exist between the two or any gotchas I should be aware of?
I had no idea they had anything like that, but if you could post the documentation I'll be happy to read over it.
Turns out it's F1 2010, Dirt2 and Grid that have an OutSim similar output.

I was posting here in hopes that someone had more infor about the subtle differences because I can't find an docs for this.

However, for each of the games mentioned, a line starting with "<motion enabled" exists in the hardware_settings_config.xml file (which is usually located in My Docs\Codemasters or MyDocs\My Games\(Dirt2 or FormulaOne).

Changing this line to:

<motion enabled="false" ip="127.0.0.1" port="20777" delay="1" extradata="0" />

-OR-

<motion enabled="false" ip="127.0.0.1" port="20777" delay="1" extradata="1" />

will suposedly output in an OutSim similar fashion.
It is indeed LFS compatible per the following (and only related info btw) from the Cody site:

If your system has a motion platform, then GRID™ should be able to control it. This feature is completely untested beyond checking that the basic data output is correct, and as such should be used entirely at your own risk. The output format is designed to be compatible with the "Live for Speed" outsim motion platform format. To enable, just open the hardware_settings_config.XML file and edit the motion attributes:
< motion enabled="true" ip="192.168.0.10" port="20777" delay="1" extradata="0" />
  • enabled – Set “true” or “false” to enable or disable the motion platform
  • ip - The IP address of the motion platform
  • port - The port of the motion platform
  • delay - the time between data updates from the game (1/100ths second).
  • extradata - This should always be set to “0”
You have to find more about the packet format, Codemasters most likely have it documented somewhere.
No luck locating any docs, but I think it's safe to assume that since they claim OutSim compatibility, that there will at least be that much.

I'll let you know after a few trials in case anyone else is building software that can benefit from additional suported titles.
OK, Here's the story.

Grid, Dirt2 and F1 2010 are all OutSim compatible and are working with InSim.Net.

However, just to muddy the water I guess, they chose to use only one UDP port and have a config option ExtraData = 0 or 1

ExtraData carries some derivative of the OutGague stuff. It may even be in the precise format, I'm not sure yet.

That said, whatever format it is in, when ExtraData=1 is enabled, it will be a different struct so unless DarkTImes has an interest in having this as part of InSim.Net, I'm looking at a derivative work, which I'm not wildly ehthused about.

Nontheless, it would seem foolish to ignore the similarities for the sake of not parsing a few extra bytes. Actually, it looks like it will be 1 byte (8 floats)
If you can show me an example of the struct, then I will compile a special version of InSim.NET for you with support for those games. I would need to know exactly what data the packet is to contain however, as without that I can't do anything. If you provide the specification, it's no problem to create a new build.

I'm not sure I'll add this to the main trunk, I may create a separate fork for it. It depends what data the struct contains really. You could create a fork for it yourself, if you're so inclined.
I'll try to get ahold of CM, but I'm not certain I will be able to get an answer. I can say that I've scoured the net for this struct with no luck.

I believe its 8 bits of additional data as follows:

public float exd1;
public float exd2;
public float exd3;
public float exd4;
public float exd5;
public float exd6;
public float exd7;
public float exd8;

I would have to see the data to determine what it is. I'm more than happy to sort out the proper filed labels.

What method would you recommend for viewing the raw data so I can begin to sort it out?

Thanks for all your help btw! I really hope I can return the favor.
So all I need to do is add eight floats onto the end of the OutSimPack struct? If so, that's very easy.

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

Vector AngVel; // 3 floats, angular velocity vector
float Heading; // anticlockwise from above (Z)
float Pitch; // anticlockwise from right (X)
float Roll; // anticlockwise from front (Y)
Vector Accel; // 3 floats X, Y, Z
Vector Vel; // 3 floats X, Y, Z
Vec Pos; // 3 ints X, Y, Z (1m = 65536)

int ID; // optional - only if OutSim ID is specified

float Ext1;
float Ext2;
float Ext3;
float Ext4;
float Ext5;
float Ext6;
float Ext7;
float Ext8;
};

If that's all I need to do, then I can create a new built with those floats added on the end, then you can figure them out in your own time. Once you've figured out what they mean, I can update the field names.
I'm looking into this now, testing it with GRID. So far I've observed:
  • GRID does not provide angular velocity (always zero)
  • GRID will always send an ID, meaning the packet will never be 64 bytes (as it is when sent by LFS without an ID).
  • The ID sent is 1094938452, which spells ToCa when interpreted as C string, which suggests that earlier CM titles (the ToCa series, obviously) already implemented OutSim.
  • ExtraData 1 will increase the size to 148 bytes, however the 80 additional bytes are not a simple extension but change the structure entirely. So no, Alex, that won't do unfortunately
€: Also, it's not OutGauge but OutSim
Is there no documentation anywhere that shows what this OutSim derived packet is supposed to contain?

As I said, I'm happy to add it, but without knowing what the actual struct contains I can't do anything. I don't personally own any of those games, so I can't test them myself.

Edit: Whoops, it's OutSim, shows how much attention I'm paying.
The few lines bvillersjr quoted in the 4th post are all you get in terms of documentation. I guess they intentionally keep the ExtraData proprietary to use with their own motion simulators exclusively, or they consider the entire feature to be too exotic for anyone to really get into (it says it's untested after all).

At first I thought they probably packed a modified form of the OutGauge packet into it, it would fit size-wise if all the redundant info is omitted. I'm still investigating in that direction, but I don't think that's it.
€: Seems I wasn't that far off, sirnoname from x-sim seems to have obtained the necessary information from CM directly. Surprisingly, by calling the their customer support, which I guess makes them just about the only useful customer support people anywhere?
I guess one could simply do the same, or ask sirnoname, but I'll keep on sniffing and apply deductive reasoning just for the fun of it.

€²: bvillersjr, you're apparently on the X-Sim² BETA crew, you even posted in the plugin release thread for this about a year ago. Memory loss?

€³: Meh, apparently the ExtraData struct differs between products, the x-sim one I found is for DiRT2.
No memory loss. I helped test his plugin, but the source for the plugin was never published, nor was any additional information about the ExtraData extension.

SirNoNames project is closed source and it's plugin architecture is limited to C++ only.

A friend of mine in Germany has been trying to reach him for months with no success.

Glad to hear that someone has fun with this sniffing!
Well I've made progress with the GRID extra data, the entire structure is made of floats, which made things easier once I realised it. So far I've got:
offset type description
-------------------------------
0 float time elapsed in seconds (since sending these packets started, not the race)
4 float laptime in seconds
8 float position on track in metres from the start/finish line
12 float race progress, this - laps = lap progress
16 float world-Y position in metres
20 float world-Z position in metres
24 float world-X position in metres
28 float indicated velocity in m/s (= actual speed, there is no differential or wheel speed based reading)
32 float world-Y velocity in m/s
36 float world-Z velocity in m/s
40 float world-X velocity in m/s

44 float ?
48 float roll ?
52 float ?

56 float ?
60 float pitch counter-clockwise from right ?
64 float ?

68 float ?
72 float ?
76 float ?
80 float ?

84 float ?
88 float ?
92 float ?
96 float ?

100 float velocity rear left wheel in m/s
104 float velocity rear right wheel in m/s
108 float velocity front left wheel in m/s
112 float velocity front right wheel in m/s
116 float throttle 0 to 1
120 float steering in quarter turns (90°), -1.0 = 90° to the left, 1.0 = 90° to the right (GRID's wheels only turn 60° in either direction though)
124 float brakes 0 to 1
128 float handbrake, always digital, thus quasi-boolean (1 on / 0 off)
132 float gear 0 Neutral, 9 Reverse, forwards speeds counting from 1
136 float lateral acceleration in g
140 float longitudinal acceleration in g
144 float lap counting from 0 (first lap = 0)

I'm reasonably sure about everything labeled, except for the X & Y velocity and position, which could be the other way round. Unfortunately the map cannot be fixed to align with north and lacks an "N" indicator, so it's difficult to know which world axis you're actually moving on. verified via ExtraData 0 comparison.
@Morpha - You're the man! If I'm ever in Austria, I owe you a beer!

If DarkSide puts this struct into the app as he mentioned above, I'll be able to see it and can try to help determine what the other data is as well.

What do you use to sniff these packets with?

I'm happy to buy you guys copies of F1 2010, Grid and Dirt2 for your tsting efforts. If you don't already have em, let me know and I'll PM or email them to you.
Quote from bvillersjr :What do you use to sniff these packets with?

What I use for everything hacky & simple, Python

Quote from bvillersjr :I'm happy to buy you guys copies of F1 2010, Grid and Dirt2 for your tsting efforts. If you don't already have em, let me know and I'll PM or email them to you.

Well that's very generous, might take you up on that offer
Not a problem. You have saved me alot of time. It would have taken me weeks to sort that out to the extent you already have. Please send me an email address to send the Steam unlock codes to.
I'm gonna stop with GRID for now, had it running for 21 hours non-stop and the PC just let me know that it's enough by crashing on me

The remaining unknown data are cryptic, I believe the first 6 floats (with presumably roll and pitch in them) also contain the heading, in some overly complicated way. The 2x4 floats are probably some per-wheel force information, but without a way to reliably apply force to one wheel only, it's very difficult to confirm.
Email sent. Thanks again!

21 hours just might be a record!

I would think that Engine RPM is almost certainly there somewhere since they now directly support the SLI-Pro hardware gauge but perhaps this integrates in some other way.

I believe that X-Sim had a Yaw value for this game if I'm not mistaken.

Maybe these are pieces to the puzzle.
Weirdly, the engine RPM aren't included. Everything X-Sim has, based on the screenshot in the plugin thread for GRiD, is there. The yaw is within the 2 3-float groups, I just don't know how to interpret it correctly.

BTW DiRT2 and F1 2010 are on the way, thanks mate
New post because this concerns DiRT2 now.

The DiRT2 packet is 4 bytes larger than GRIDs, the additional float is - drumroll - the engine RPM

# offset type description
-----------------------------------
0 0 float time elapsed in seconds (since sending these packets started, not the race!)
1 4 float laptime in seconds
2 8 float position on track in metres from the start/finish line
3 12 float race progress, this - laps = lap progress
4 16 float world-Y position in metres
5 20 float world-Z position in metres
6 24 float world-X position in metres
7 28 float actual velocity in m/s
8 32 float world-Y velocity in m/s
9 36 float world-Z velocity in m/s
10 40 float world-X velocity in m/s

11 44 float ?
12 48 float ? roll *
13 52 float ?

14 56 float ?
15 60 float ? pitch *
16 64 float ?

17 68 float ? suspension travel front left?? *
18 72 float ? suspension travel front right?? *
19 76 float ? suspension travel rear left?? *
20 80 float ? suspension travel rear right?? *

21 84 float ?
22 88 float ?
23 92 float ?
24 96 float ?

25 100 float velocity rear left wheel in m/s
26 104 float velocity rear right wheel in m/s
27 108 float velocity front left wheel in m/s
28 112 float velocity front right wheel in m/s
29 116 float throttle 0 to 1
30 120 float steering in quarter turns (90°), -1.0 = 90° to the left, 1.0 = 90° to the right
31 124 float brakes 0 to 1
32 128 float clutch
33 132 float gear 0 Neutral, 9 Reverse, forwards speeds counting from 1
34 136 float lateral acceleration in g
35 140 float longitudinal acceleration in g
36 144 float lap counting from 0 (first lap = 0)
37 148 float Revolutions per 6 seconds, multiply by 10.0 to get RPM

* wild guess

Since I'll actually be playing the game (as opposed to running it solely for sniffing purposes, as I did with GRID), finding the remaining ones might take a little time
Triple post

F1 2010's extra data is the same size as DiRT2's, the differences are minor:
# offset type description
-----------------------------------
0 0 float time elapsed in seconds (since sending these packets started)
1 4 float laptime in seconds
2 8 float position on track in metres from the start/finish line
3 12 float race progress, this - laps = lap progress
4 16 float world-Y position in metres
5 20 float world-Z position in metres
6 24 float world-X position in metres
7 28 float actual velocity in m/s
8 32 float world-Y velocity in m/s
9 36 float world-Z velocity in m/s
10 40 float world-X velocity in m/s

11 44 float ?
12 48 float ? roll *
13 52 float ?

14 56 float ?
15 60 float ? pitch *
16 64 float ?

17 68 float ? suspension travel front left?? *
18 72 float ? suspension travel front right?? *
19 76 float ? suspension travel rear left?? *
20 80 float ? suspension travel rear right?? *

21 84 float ?
22 88 float ?
23 92 float ?
24 96 float ?

25 100 float velocity rear left wheel in m/s *
26 104 float velocity rear right wheel in m/s *
27 108 float velocity front left wheel in m/s *
28 112 float velocity front right wheel in m/s *
29 116 float throttle 0 to 1
30 120 float steering in quarter turns (90°), negative = left, positive = right
31 124 float brakes 0 to 1
32 128 float anti-stall / clutch
33 132 float gear 0 = Neutral, 10 = Reverse, forwards speeds counting from 1
34 136 float lateral acceleration in g
35 140 float longitudinal acceleration in g
36 144 float lap counting from 0 (first lap = 0) *
37 148 float Revolutions per 6 seconds, multiply by 10.0 to get RPM

float 33 (#32) is the only content change, representing the anti-stall or clutch in F1 instead of the handbrake (GRID/DiRT2) for obvious reasons. Other than that there is only a minor change to #33, where reverse is now 10 instead of 9. Finally, GRID and DiRT2 reset the first float (time elapsed) on restarts, F1 does not.

I haven't fully verified everything yet, but I'm reasonably sure that's all the differences.

I've updated the other two definitions with a more accurate interpretation of the steering value.
Awesome! That was an amazingly quick reverse engineering time!

Now to sort out the best way to integrate this into InSim.

Since the ExtraData =1 outputs entirely different structs, I'm gusssing that DarkTimes has lost interest in this?

If so, I'll look at maintaining some kind of derived work that supports all of the above. 99.5% of the plumbing for this is already in the InSim project.

Also, who do I have to talk to about commercial use of LFS? A friend of mine wants to make a Sim Center and is interested in LFS as a basis for this.
1

OutSim With Dirt2 and Grid?
(39 posts, started )
FGED GREDG RDFGDR GSFDG