rFactor2 Plugins Development

Discussion in 'General Discussion' started by fazerbox, Oct 6, 2010.

  1. fazerbox

    fazerbox Registered

    Joined:
    Oct 6, 2010
    Messages:
    187
    Likes Received:
    8
    Hi,

    I have developed 2 Plugins for rFactor MapPlugin, G27Plugins and a new one is in development, I hope to release it soon :) before rFactor2 .

    I have some questione about future Plugin development:

    1) will you release some samples how to develop plugins for rFactor2 and a clear docs? will examples released at the same time of rFactor2?

    2) rFactor Plugin interface seems not thinked for graphical Plugins. Actually all rFactor Graphical plugins use a proxy DirectX d3d9.dll.
    This is a problem if you want to use more graphical plugins.
    Will you extend plugin interface to support native Graphical Plugins? And chain of plugins?

    3) I have noticed that UpdateScoring( const ScoringInfoV2 &info ) function is called about 2 times for seconds, and this cannot be changed.
    I understand that this is for performance reason. But when I use d3d9.dll I can insert poor performance even if telemetry infos are updated 2 times for second, because I intercept DirectX call and insert my code. So I think this limit should be removed.
    This 2 Hz rate causes me problems because cars move jumping, if I don't predict positions.
    Can you please insert frequency update in configuration file like Config.ini.
    I think it should be very nice to have a different update rate for differente plugins.

    4) TelemInfoBase.mTrackName[64] stores only track name. This is a problem in Track mod like Vallelunga where you have 5-6 different layout all with the same name "vallelunga"
    In my MapPlugin, I cannot retrieve correct layout from mTrackName. I read gdb full path name from memory. I don't like this but is my only chances.

    5) When on Car selection mSession = 0 . The same for Test Day. Can you please uses a different number ?

    6) About TelemInfoBase.mLapStartET.
    First time I press Race mLapStartET is 0 or -1 and this is correct. This indicates that is not a valid Lap.
    I have to pass starting line to starts a new Lap. This is OK.
    But after a Lap if I press ESC and jump to PitBox and Press Race again, mLapStartET is not resetted it stores previous value, so it seems that I'm on a valid Lap.
    Can you reset TelemInfoBase.mLapStartET when in Pit-Box? Not in Pit-Lane ?

    7) In MapPlugin I read AIW files to draw Track Map, Will AIW file present in rFactor2? It will be clear text as rFactor?
    It should be possible to retrieve Track Coordinates from rFactor2 Plugins Interface without decode AIW File?

    8) VehicleScoringInfo.mBestSector1, VehicleScoringInfo.mBestSector1, VehicleScoringInfo.mBestLap
    In Telemetry Interface these parameters may refers to different Laps.
    Ex Driver Fazer does these Laps
    Lap 8
    Sector1 20.00
    Sector2 50.00
    LapTime 1.20.00

    Lap 9
    Sector1 18.00
    Sector2 50.00
    LapTime 1.21.00

    Lap 10
    Sector1 21.00
    Sector2 49.00
    LapTime 1.25.00

    You have
    VehicleScoringInfo.mBestSector1 = 18.00 From Lap 9
    VehicleScoringInfo.mBestSector2 = 49.00 From Lap 10
    VehicleScoringInfo.mBestLap = 1.20.00 From Lap 8

    Should be usefull to have Sector1 and sector 2 time2 relative to Lap where BestLap was setted.
    T1 = 21.00 (Lap 10)
    T2 = 49.00 (Lap 10)
    LapTime = 1.25.00 (Lap 10 - Best Lap )

    9) ScoringInfoV2.mPlrFileName . This parameter actually stores PLR file without Extention and Path.
    Shoud be usefull to have ex. c:\rFactor\Userdata\Fazerbox\Fazerbox.plr , so you can Access ti plr directly.

    10) I have noticed, that sometimes if you enter/exit, re-enter to online race that:
    ScoringInfoBase.mNumVehicles report correct number of cars, but for a brief time ( less that 0.5 s ) One of these cars has mPlace > mNumVehicles .


    11) Will you insert voice command in rFactor2?

    12) Will you integrate some like TeamSpeak?


    I hope I haven't annoyed you with all these questions :)
    But Some points are important for people like me who likes to develop plugin for rFactor.

    rFactor is a fantastic game, a Great Game, and thanks to modders, it is not a simple game but more Games in one.

    Thanks ISI for this great Game.
    Max.
     
    Last edited by a moderator: Oct 6, 2010
  2. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    i've developed a few plugins including LiveViewlugin for my SLS and rF Admin Automation which add some functionality for server administrators (reverting grids, giving weights for just connected drivers, loging additional events like speeding in pits and so). Most of features are based on parsing &stream and sending admin commands to dedicated server window (as no other way is available). That's why I want to ask for some improvements:


    1. do not stop calling UpdateScoring() method while there is no drivers on server. Currently if the last driver leaves server, rF stops to call this method resulting impossibility to write new state of server (empty one) and the last state stay forever. It may be dodged by enabling rolling session out without drivers. But some times it is not meet requirements.

    2. provide to plugin all possible admin actions, for example kicking user, changing sessions and also writing into chat. Currently, it may be done (on server side) only by sending events to dedicated server window simulating writing admin commands on chat. Additionally not all commands works this way, for exaplme /vote kick doesn't work on dedicated server chat (other commands work).

    3. Make &stream available for all plugins. Currently only single plugin may use it (which one - is unpredictable)

    4. Make plugin to know about reloading track. In rF1, there is no difference between restart event and reload track from plugin point of view. In the second one, track is reloaded and drivers are going to reconnect - but plugin doesn't know that drivers has been disconnected or so. In that case some automated tasks like giving weight handicaps usually fail (because plugin trays to give penalty for driver who is out of server - loading track)

    5. Push into plugin all informations known by server. For example current rF's plugin doesn't know about Car veh file name. Other ones like Mod name must be read from files on disk (using PLR/GDB file entries). also other informations like ping to driver, weight handicaps and so

    btw: while rf server is run with oneclick mode, there is no gui window object created. It makes impossible to do the trick: send text into chat using plugin.

    best regards.
     
  3. Fernando Deutsch

    Fernando Deutsch Registered

    Joined:
    Oct 5, 2010
    Messages:
    40
    Likes Received:
    13
    Setting the "Pause While Zero Players" variable under the Multiplayer.ini file to "0" prevents the behavior you mention. I experienced the same situation with my own scoring plugin.
     
  4. Fernando Deutsch

    Fernando Deutsch Registered

    Joined:
    Oct 5, 2010
    Messages:
    40
    Likes Received:
    13
    Graphical plugins are a great idea. A chain or order of these kind of plugins may be required.
     
  5. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    yes. I mention it already as 'rolling session...'. thanks.
     
  6. Luka K.

    Luka K. Registered

    Joined:
    Oct 5, 2010
    Messages:
    10
    Likes Received:
    0
    u can have a structure like this:

    d3d9.dll
    d3d9_2.dll
    d3d9_3.dll
    ...
    it should work
     
  7. Siggs

    Siggs Registered

    Joined:
    Oct 6, 2010
    Messages:
    10
    Likes Received:
    0
    It does work.
     
  8. fazerbox

    fazerbox Registered

    Joined:
    Oct 6, 2010
    Messages:
    187
    Likes Received:
    8
    Yes but this works only if you have a Master Graphical Plugin that calls all functions inside d3d9_x.dll or if Plugins are collaborative Like HDR, MapPlugin and are able to call a second plugin, creating a chain of plugins.

    Ex. HDR calls MapPlugins calls Other Plugin call system d3d9.dll

    As far I know, XD and TVStyle are not able to call a second Plugin, so you cannot have XD and TVStyle together. Solution should be a third plugins that calls XD and TVStyle.

    I think is better having a framework managed by rFactor that calls Graphical Plugins, like rFactor does for plugins in Plugins Folder.

    Max.
     
  9. willynovi

    willynovi Registered

    Joined:
    Oct 4, 2010
    Messages:
    10
    Likes Received:
    0
    I have done some plugins for driving a tachometer, a gear digit indicator, and others sim display.
    I think that if rFactor2´s plugins are the same as rFactor´s plugins it is ok.
     
  10. Marvin Fröhlich

    Marvin Fröhlich Registered

    Joined:
    Oct 7, 2010
    Messages:
    1
    Likes Received:
    0
    All we need for this, is a user definable priority list for HUD plugins. HUD plugins should always be executed last and then this user defined order should be used. Everything else can be done internally.

    What worth does your statement have? You did a very simplistic plugin (no offense), which the current API serves well for. This doesn't mean, that others don't need an extended API. Hence it's definitely not ok, if the plugin API kept being untouched.

    I guess, I don't need to post my extensions which list here, since you should already have everything, jeremy, don't you?

    Marvin
     
  11. stevo.zilik

    stevo.zilik Registered

    Joined:
    Jan 27, 2013
    Messages:
    34
    Likes Received:
    0
    Plugin Evolution

    Hi,

    here is what I would love to see supported in rFactor2 UpdateScoring

    • Fuel information - relative to the tank size and absolute (litres)
    • Active mod information - full name, version, etc...
    • Tyre compound information (soft|medium|hard - front/rear)
    • Tyre wear information (percentage wise for each tyre). I understand that you've greatly improved the tyre model so a simple tyre wear percentage doesn't provide the full picture but I can't imagine how could you be reporting flat spots...
    • Tyre temperatures, brake temperatures, in general provide the UpdateTelemetry information into UpdateScoring.
    • Better Damage information (currently I can only hook into results stream and read information like "A hit B for 100% impact". But that doesn't really tell us whether "A" lost a wheel or engine and the impact strength is very inconsistent, sometimes 100% impact doesn't result in major damage in game... Improving on this would be great e.g. providing status of specific parts of a vehicle - wheels, sides, engine...
    • Basic engine information - oil and water temperatures, health status (green, yellow, red...)
    • Speed - as it is displayed in rFactor - there is a formula now that can be used to calculate the speed, however sometimes when the car crashes it yeilds results like 400km/h which spoils the stats.
    • Ability to run commands from plugin - that way admins would be able to watch after the race from a web interface, without the need of having rFactor installed. This would also allow for automatic penalties to be assigned if the plugin is in charge of watching the 'white line', but more about this further down...
    • Add an argument to "EndSession" call that informs the plugin about the results file location (name) that was produced. This would greatly help as now I have to have complicated logics in place trying to figure out what results file was populated. That results file is sent to my server and used for official race results.
    • Include all drivers with all the vehicles they used throughout the session. Currently if a driver joins a session and quits before the session and, he is not included in the results. Same as if he changed for a different vehicle, only the last used vehicle information is provided. It would be great if you just provided all the drivers with all vehicles that ever entered that session.
    • Include yellow flag information in results file (or alternatively in replay). Currently when admins examine results to resolve conflicts it's important to know whether a crash/overtaking happened under yellow flags or not, that is not possible now...
      > Information about vehicle groups. Some leagues take advantage of grouping vehicles into groups - GT1, GT2, GT3 and they race together (to mimic reality e.g. 24h LeMans you have plenty of groups), however the results are published separately for each group. Currently rFactor gives me the vehicle name and type but doesn't provide information about what groups it belongs to...
    • Provide Results Stream with chat/damage for each plugin, not just one...

    Also very important, do not make breaking changes to the existing API, it's just fine, but we need more information.
     

Share This Page