Author Topic: Output Plugins  (Read 12994 times)

HornetMaX

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Output Plugins
« Reply #30 on: January 04, 2018, 04:50:19 PM »
Trying to update some of my existing output plugins for V4. 

When using the new plugin example from the website the game is crashing when clicking ToTrack.  Even with no changes to example.

Anyone else?
All my plugins work fine with v4 (no change from v3, v2, v1 and beta16, if I recall correctly).
I'm tempted to say you're doing something wrong.
Two wheels, more than enough.

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1903
    • View Profile
    • Email
Re: Output Plugins
« Reply #31 on: January 04, 2018, 06:16:41 PM »
Trying to update some of my existing output plugins for V4. 

When using the new plugin example from the website the game is crashing when clicking ToTrack.  Even with no changes to example.

No changes have been made to the plugins interface, so all plugins for previous versions, down to Beta16, should still work.

Racer_S

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Output Plugins
« Reply #32 on: January 04, 2018, 06:50:22 PM »
Thanks for the quick reply guys.

The old plugin used to work with older version of KRP but it does not work anymore, hence the reason I am trying to update.

The only difference from my old source I can see is GetModDataVersion was changed to 6, and RPM was changed from float to integer?

I am using Visual Studio 2013 to compile, the project was created using the empty DLL template.

I've tried adding extern "C" and compiling as C code,  It still crashes when I click ToTrack.

Does KRP not like VS2013 compiler?


EDIT: I tried compiling the example with MinGW and its crashing still.






« Last Edit: January 04, 2018, 08:00:56 PM by Racer_S »

Racer_S

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Output Plugins
« Reply #33 on: January 09, 2018, 03:08:44 PM »
No solution?

The example does not work without crashing.

Steps to reproduce:

Compiling latest example as DLL with DLO extension and placing in plugin folder. 

Crashes when clicking ToTrack in KRP release 4.


HornetMaX

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Output Plugins
« Reply #34 on: January 09, 2018, 08:53:35 PM »
The only difference from my old source I can see is GetModDataVersion was changed to 6, and RPM was changed from float to integer?
No, I think there's also the extra field "int m_iInvalid;" in structures SPluginsKartLap_t and SPluginsRaceLap_t.
Two wheels, more than enough.

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1903
    • View Profile
    • Email
Re: Output Plugins
« Reply #35 on: January 09, 2018, 09:24:46 PM »
No solution?

The example does not work without crashing.

Steps to reproduce:

Compiling latest example as DLL with DLO extension and placing in plugin folder. 

Crashes when clicking ToTrack in KRP release 4.

No crash here with the compiled example.
What compiler are you using? Are you compiling as C? Is the integer size 32 bits? Is the struct member alignment 8 bytes?

Racer_S

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Output Plugins
« Reply #36 on: January 14, 2018, 01:07:02 AM »
I am indeed compiling as C.

If compiled as C++, the game does not recognize it and there is no crash.

I have tried with the new version of WRS and his example output plugin and same problem there.
Strange because I never had this problem with the older versions of KRP and WRS.

I have tried aligning the structs with #pragma pack ( 8 )
Tried turning off all optimizations, tried compiling with older visual studio toolset compilers, and intel compiler...

Always crashes when clicking ToTrack..  I am out of ideas.



Some other details:
I am testing with the DEMO

This is the order I am starting the race
Testing>Start >ToTrack *crash*


Here is a link to the visual studio project and compiled DLO plugin.

https://drive.google.com/file/d/1N5XgUaZ-iQeCGFYz0Nro2mZupXhfCXWc/view?usp=sharing


Thanks for any help, I think I will just recommend our clients use an older version of KRP for now.

Racer_S

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Output Plugins
« Reply #37 on: February 14, 2018, 05:46:31 PM »
FWIW, I've solved the crashing problem by commenting out this function:

Code: [Select]
__declspec(dllexport) void Draw(int _iState, int *_piNumQuads, void **_ppQuad, int *_piNumString, void **_ppString)
{

}

I didnt need it in my case anyway. Thanks!

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1903
    • View Profile
    • Email
Re: Output Plugins
« Reply #38 on: February 15, 2018, 11:17:31 AM »
FWIW, I've solved the crashing problem by commenting out this function:

Code: [Select]
__declspec(dllexport) void Draw(int _iState, int *_piNumQuads, void **_ppQuad, int *_piNumString, void **_ppString)
{

}

I didnt need it in my case anyway. Thanks!

Thank you for the report.