Godot InSim
For anyone using the Godot game engine, I released an InSim library written in GDScript, which includes support for InSim, OutSim OutGauge and InSimRelay.

GitHub link to the library (MIT license)
GitHub link to a very simple demo



The library supports InSim version 9 as of LFS version 0.7F.

What is included:
  • All InSim packets are implemented.
  • All text input is done from UTF8 and converted to LFS format, all packets convert text back to UTF8.
  • OutSim can be used from the configuration file.
  • OutGauge can be used from the configuration file.
  • InSimRelay is available.
  • There are some utility functions in the GISUtils class for converting units.
Feel free to try it if you're interested, I will update with examples as I have time to work on them.
There are also a .pth file reader and a .smx file reader included, for 3D rendering.


Special thanks:
Flame CZE and his Node InSim library, where I found how to parse car names for mods and took inspiration for text conversion.
I found some time to work on text encoding, once again shamelessly adapting/stealing code from Flame CZE and adapting it to Godot.
I have released version 0.8.1 on GitHub containing this feature as well as fixes for several other issues with various packets.


I should now have everything I wanted to add (unless I'm forgetting something), so will bump the version to 1.0 after some more testing and bug fixing.

Some projects I am working on with this tool:
  • Telemetry recording and display
  • Live race stats (minimap with driver names, standings with tyre compounds, pit stops, time deltas, etc.)
  • PTH and SMX file parsers to display them in 3D
This is awesome, tnx very much man.
Quote from Bokujishin :
  • Live race stats (minimap with driver names, standings with tyre compounds, pit stops, time deltas, etc.)

That would be really cool! Big grin
Very cool man, great job!
I just released version 0.9, including a bunch of fixes for various packets, better color handling for text (including stripping and conversion to/from BBCode), and utility functions for unit conversion (kph to mph, rad to deg and various other units).

I will now work on adding InSimRelay support, and try to test host packets, as I haven't managed to connect to InSim with host/admin privileges yet.

Thanks for the kind words!
Tnx very much for you hard work. The code is very readable, great job !
GodotInSim v1.2 is now available on GitHub.
I forgot to announce v1.1 last weekend, which added the new IPB packet in LFS 0.7F.

v1.2 goes back to using the "standard" plid syntax instead of player_id, which is a breaking change. It also fixes MST packets not interpreting messages starting with a slash a commands.

I'm also working on a more advanced tool as a demo, which will display race standings and driver statistics as well as a minimap showing blue/yellow flags and coloring cars by car/category/lapped/etc.
The goal is to allow preparing a race by specifying categories (e.g. P2/GT3), separating safety car/rescue vehicles in a dedicated category, and showing standings by category.
GodotInSim v1.3 is now available on GitHub.
It introduces more format customization for GISUtils time strings, the default grey color for LFSText, as well as fixes for LFSText (some characters in the extended characters of the Latin code page were not being converted properly), and a few other minor additions or quality of life improvements.

Also, while I haven't had as much time as I would like to work on actual projects using this tool, here are a couple sneak peeks:
  • Multi-class standings and live gaps, each class can be configured with arbitrary cars, and a "hidden/ignored" class can be used for safety car and other utility vehicles if necessary.
  • Live delta, displaying the time delta to the best recorded lap of the session, and colored arrows showing the derivative (current improvement (or lack thereof) over the best lap, that's the rate of change of the delta). Also displays final deltas for each sector.
Attached images
lfs_multiclass_gaps.png
lfs_delta.png

FGED GREDG RDFGDR GSFDG