MX Bikes Official Forum

Mods => Plugins => Topic started by: PiBoSo on April 21, 2014, 11:35:40 pm

Title: Output Plugins
Post by: PiBoSo on April 21, 2014, 11:35:40 pm

It is possible to write a DLL that receives data from the simulated bike in realtime.

Example source code can be downloaded at http://www.mx-bikes.com/?page=downloads

Please note that all function calls are blocking, so control should be returned to simulation as soon as possible to avoid framerate issues.

The DLL must be compiled for 64 bit.

The plugin must have the file extension renamed to DLO and it must be copied to the "plugins" directory in MX Bikes installation folder.

NOTE: a license is not needed to add plugins.
Title: Re: Output Plugins
Post by: PiBoSo on September 04, 2014, 12:05:27 am

Plugins interface updated.
Title: Re: Output Plugins
Post by: PiBoSo on September 17, 2014, 02:50:01 pm

Example source code updated to add info about track centerline data.
Title: Re: Output Plugins
Post by: Ruubs on September 17, 2014, 07:37:33 pm
Thanks for this Piboso.

For some reason I can't download the input_int.c file though. When I click on the link on the downloads page I get an error that the page couldn't be found, and when I try to save it, it tells me that there isn't any file to save.
Title: Re: Output Plugins
Post by: PiBoSo on September 17, 2014, 08:55:49 pm
Quote from: Sandbiter on September 17, 2014, 07:37:33 pm
Thanks for this Piboso.

For some reason I can't download the input_int.c file though. When I click on the link on the downloads page I get an error that the page couldn't be found, and when I try to save it, it tells me that there isn't any file to save.


Input plugin example uploaded. Thank you for the report.
Title: Re: Output Plugins
Post by: PiBoSo on February 29, 2016, 07:18:16 pm

Example source code updated to the latest interface.
Title: Re: Output Plugins
Post by: PiBoSo on December 22, 2016, 09:37:29 am

Example source code updated to the latest interface.
Title: Re: Output Plugins
Post by: PiBoSo on March 15, 2017, 11:00:01 pm

Example source code updated to the latest interface.
Title: Re: Output Plugins
Post by: HornetMaX on March 16, 2017, 07:39:20 pm
Hmmm ... GetModDataVersion() still returning 4 ?
Title: Re: Output Plugins
Post by: PiBoSo on March 16, 2017, 08:51:24 pm

Thank you for the report.
Updated again.
Title: Re: Output Plugins
Post by: Azazel on April 19, 2018, 08:23:49 am
Hi everyone,

I need to know when the wheels are in the air.
I searched in the plugin, but i don't found this information.
Is it possible to add this on the next version?

Thanks
Title: Re: Output Plugins
Post by: PiBoSo on June 14, 2018, 10:12:27 pm
Quote from: Azazel on April 19, 2018, 08:23:49 am
Hi everyone,

I need to know when the wheels are in the air.
I searched in the plugin, but i don't found this information.
Is it possible to add this on the next version?

Thanks


Example source code updated to the latest interface.
Title: Re: Output Plugins
Post by: PiBoSo on June 14, 2018, 10:30:50 pm

Please note that, starting with Beta8, output plugins must be compiled for 64 bit.
Title: Re: Output Plugins
Post by: HornetMaX on June 15, 2018, 01:28:01 am
Just compiled my MaxHUD for MXB x64: took me 2 hours to wrestle with Visual Studio configurations and platforms  ::)  ::)  ::) but code compiled fine without any change (*) and it runs just fine. Woot !!

(*) Well, of curse I have a bunch of size_t --> int warnings, no biggie.
Title: Re: Output Plugins
Post by: PiBoSo on August 29, 2018, 01:59:44 pm

Example source code updated to the latest interface.
Title: Re: Output Plugins
Post by: HornetMaX on September 05, 2018, 09:36:36 am
Quote from: PiBoSo on August 29, 2018, 01:59:44 pm

Example source code updated to the latest interface.

Minor: many fields (e.g. m_iSession, m_iSessionState, m_iReason)  lack the comment/descritpion in many race structures.
For some is no biggie, as the field is described elsewhere, others I just take them from GPB :)


Title: Re: Output Plugins
Post by: PiBoSo on September 05, 2018, 10:04:36 am

Thank you for the report.
Title: Re: Output Plugins
Post by: HornetMaX on September 06, 2018, 01:06:50 am
Another quirk I just noticed: in MXB m_iSessionNumLaps in SPluginsRaceSession_t dopesn't seem to be set, it's always zero.
Seems to work fine in GPB however.
Title: Re: Output Plugins
Post by: PiBoSo on September 08, 2018, 11:31:13 am
Quote from: HornetMaX on September 06, 2018, 01:06:50 am
Another quirk I just noticed: in MXB m_iSessionNumLaps in SPluginsRaceSession_t dopesn't seem to be set, it's always zero.
Seems to work fine in GPB however.


Thank you for the report.
The fix will be integrated in the next update.
Title: Re: Output Plugins
Post by: PiBoSo on September 09, 2018, 05:02:13 pm

Example source code updated to add more structure members descriptions.
Title: Re: Output Plugins
Post by: PiBoSo on February 15, 2019, 04:26:06 pm

Example source code updated with the latest structure members descriptions.
Title: Re: Output Plugins
Post by: PiBoSo on October 19, 2019, 06:15:42 pm

Example source code updated with the latest structure members descriptions, to add straight rhythm info.
Title: Re: Output Plugins
Post by: HornetMaX on January 13, 2020, 10:59:13 pm
One small request: could you document what exactly is in the argument _pRaceData of TrackCenterline ?

__declspec(dllexport) void TrackCenterline(int _iNumSegments,SPluginsTrackSegment_t *_pasSegment,void *_pRaceData)
My understanding is that you have some floats indicating the position along the centerline of the start/finish line, then the split points and the speed trap.

Is it correct to assume (as not documented) that:
Title: Re: Output Plugins
Post by: PiBoSo on January 14, 2020, 06:58:18 pm

The "_pRaceData" input is briefly documented in the TrackCenterline function comment:
"_pRaceData is a pointer to a float array with the longitudinal position of the start / finish line and splits."

There indeed are two split lines, with the only exception being GP Bikes with three.
Therefore, in the case of MX Bikes, "_pRaceData" is a pointer to an array of three float values.

Example source code updated to remove an incorrect reference to a "speed trap" line.