DynHUD source code and plugin SDK?

Discussion in 'Automobilista - Links & Resources' started by gongo, Mar 21, 2016.

  1. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  2. Dave Stephenson

    Dave Stephenson Administrator Staff Member AMS2 Club Member

    Joined:
    Feb 13, 2016
    Messages:
    858
    Likes Received:
    1,064
    With regard to to internals plugin data/stuff I've been using the rF Data Acquisition Plugin to get Motec logs out of AMS throughout beta and there haven't been any issues. The data is logged correctly which leads me to believe that they remain the same.

    I'll have to check on DynHUD but I believe that would only be the case if the source was licensed to Reiza under GPL. The authors are of course free to license the work to Reiza under an alternative license if they choose. I'll look into the licensing and whether any changes have been made.
     
  3. Pedro Ramada

    Pedro Ramada New Member AMS2 Club Member

    Joined:
    Mar 24, 2016
    Messages:
    20
    Likes Received:
    8
    It would be great if we can customize the DynHUD position on screen info inside the car!! It would be a step forward for AMS! :) ;)
     
    • Agree Agree x 1
  4. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
    • Like Like x 1
  5. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  6. Marcel Offermans

    Marcel Offermans New Member

    Joined:
    Feb 14, 2016
    Messages:
    9
    Likes Received:
    21
    I can give you an update on this, as one of the two original authors of rFDynHUD. Marvin (the other author) and I did license the code to Reiza using a different license. This is similar to the dual licensing that quite a few other products do, providing it under and open source license (GPL) that can be used for free and as a basis for other open source derivative works (in this case GPL ensures that those will also be open source) and under a commercial license (which is what we did for Reiza).

    As far as providing an SDK for the Plugin API, that is up to Renato. We did add some data but tried to keep it backward compatible. So plugins should still work. If not, we will probably have to look on a case by case basis what is going wrong. For that it helps us to get detailed reports on which plugins do and don't work (which is what you're providing in the posts above). We'll have to investigate.
     
    • Like Like x 2
  7. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  8. keith windsor

    keith windsor Active Member AMS2 Club Member

    Joined:
    Mar 9, 2016
    Messages:
    495
    Likes Received:
    206
    If it helps, I reported a change in the spotter plugin behaviour a few months back, just before AMS was released. Although it appears at first glance to still be working normally, there is definitely something wrong.
    The most noticeable change was in the outlap, where the spotter used to say 'I'm looking at your lap times compared to pole, you are one tenth slower in the first sector, you're faster in the second sector, etc....'.
    Now, on the outlap, the spotter is confused, and reports an incorrect first sector time, as if he is not aware it is an outlap.
    There also seems to be a permanent yellow flag problem somewhere near pit exit.
    Since this bug appeared, it has felt to me as if the pit triggers are not being recognised by the spotter.
    I would be over the moon Marcel/gongo, if someone could solve this. For me it really added to the reality of a race event & rounded off my GSC experience, but I have stopped using it since the bug crept in.
     
  9. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  10. Marcel Offermans

    Marcel Offermans New Member

    Joined:
    Feb 14, 2016
    Messages:
    9
    Likes Received:
    21
    Thanks for reporting.
     
  11. DAU Racer

    DAU Racer New Member AMS2 Club Member

    Joined:
    Mar 17, 2016
    Messages:
    9
    Likes Received:
    0
    Is there actually a performance impact by adding more and more plugins? AMS itself akready has a couple, if people add more.... The way how I imagine this works is that all the plugin functions are called after each other, so when you have 10 of them, by when the last one e.g. for telemetry update gets called the vallues might have already changed.

    Would it maybe better for the game and its stability to provide one plugin that actually writes the data into a shared memory segment. (I also started experimenting with plugins and because I am a beginner, very often my plugin kill AMS, which should not be the case, but as I just read data, I would achieve teh same with reading a shared memory segment).
     
  12. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  13. Marcel Offermans

    Marcel Offermans New Member

    Joined:
    Feb 14, 2016
    Messages:
    9
    Likes Received:
    21
    AMS invokes the plugin methods "in process" and effectively such code becomes part of the real-time loop. This means you should be very careful what you do in your plugin. Anything that does I/O or other operations that might block should be avoided. If you have time consuming tasks, don't do that in those plugin methods, but use shared memory or some other way to pass the data quickly from the plugin to other code.

    The real-time loop as a whole must always complete within its assigned time slice. As long as that happens, everything is fine. If not, the whole simulation will fall "out of real-time" which is fatal (especially in an on-line race). Due to the fact that we did increase the frequencies at which we run the simulation and the plugins, they have become more time critical so plugin authors please make sure you test your plugins well.
     
    • Like Like x 1
  14. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  15. Marcel Offermans

    Marcel Offermans New Member

    Joined:
    Feb 14, 2016
    Messages:
    9
    Likes Received:
    21
    If we were starting from scratch, we could argue about the benefits and disadvantages of both approaches. Right now I would not want to break backward compatibility of existing plugins. Furthermore, the API currently does more than just provide data. You can generate all kinds of feedback as well (buttons, force feedback, spotter messages, etc.). Doing that in a more asychronous, memory mapped interaction would be harder.

    The memory map you've found is internal to DynHUD. It is used to communicate between the plugin and the JVM that is embedded in the D3D9.DLL. You could use that as an example of how to create such a setup and create a memory map yourself. If you open source that and provide ways to access it from different languages, that might be of benefit to others.
     
    • Like Like x 2
  16. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
    • Like Like x 3
  17. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
    • Like Like x 4
  18. Will Mazeo

    Will Mazeo Active Member AMS2 Club Member

    Joined:
    Mar 8, 2016
    Messages:
    674
    Likes Received:
    194
    quick question: does DynHUD support gif?
     
  19. gongo

    gongo Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    370
    Likes Received:
    351
    -
     
    Last edited: Jan 16, 2021
  20. Will Mazeo

    Will Mazeo Active Member AMS2 Club Member

    Joined:
    Mar 8, 2016
    Messages:
    674
    Likes Received:
    194
    Thanks, does not work. If save on MSPaint it loses transparency, if save on GIMP it becomes just an image. No problems tho. :)
     

Share This Page