[REL] rF2 Spotter Plugin

Discussion in 'Other' started by Gerald Jacobson, Oct 17, 2014.

  1. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    For the time being forget about Crew Chief. It's still being implemented for other racing games. We already have something very good in my opinion. Let's test and improve what we have.

    So lets focus on the MINORDAMAGE EVENT.

    In readme.rtf i wrote this information:

    3. EVENT DAMAGE MINOR

    Event=DamageMinor
    (This event works when you hit wall/car and have minor or no damage and can continue race)
    Event is disabled by default. This event is to be used only when driving with DAMAGE OFF; which means have the game setting in Options/Difficulty in rFactor2 INVULNERABILITY set to ON.
    By default this event is disabled. To enable this event all you need to do is delete the word 'DISABLED' from the Event Name in DefaultEvents.ini


    The idea behind this event was that when playing with damage off and hit object the spotter says that no damage was done. In fact if playing with damage off and this event in enabled, even if the car turns upside down 1000 times the spotter will say 'minor damage'. Which seems unrealistic right? I that what you mean LEADWOLF?

    what do you mean by 'mayor is suffered'?

    Jeffrey
     
    Last edited by a moderator: Oct 26, 2016
  2. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    Firstly, regarding Crew Chief. Honestly, I am beginning to wonder if port of rF1 plugin is really a way to go forward. I’ll have a look at that plugin at some point, but for now let’s focus on rule below as you suggest.

    I am aware that you intended MinorDamage for Damage=off case (thanks for your helpful comments). However, I have been wondering what will happen if I enable it, and most often this event is useful even with damage=on. There’s no need for repairs after a slight scratch or a touch. The problem is that if you are in a major crash (you lost wing or wheel), you will also have many minor impacts, but they no longer matter. So we get conflicting messages from spotter. One way to fix this would be to disable MinorDamage event as soon as any major damage is suffered (part loss, suspension etc), and re-enable if user visited pits and repaired the car completely.

    If I understand you correctly, you are suggesting that ImpactMinor trigger does not mean minor damage amount, it means any impact? In that case probably, this event should better stay disabled.

    Probably, what we need instead is accumulated damage to car, some sort of index that says if car is still ok to drive or not. I cannot see yet how this could possibly be done with Spotter.

    Another thought, is that rF2 MFD shows damage visually, so game knows what exactly is damaged. So, if there’s contact and nothing is damaged, we could announce MinorDamage. But if there’s suspension damage, we announce exactly that (preferably as detailed as possible, this is rF2 after all :) ) and from there cease announcing minor damage since car is damaged already.
     
    Last edited by a moderator: Oct 26, 2016
  3. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    Yes 'ImpactMinor' is a boolean. Which means only 1 or o. 1 = impact with object, 0 is no impact. When car hits wall this event is triggered. There is no defenition/scale of the severity of the impact

    There are other triggers for when wheel is lost or body part lost.

    Maybe the event can have two inputs -
    input1 = impact 1 or 0
    input2 = bodypart/wheel lost

    if input 1 is true and input 2 is false then spotter says example 'no serious damage/minor damage)
    if input 1 is true and input 2 is true then spotter says nothing and other events for body lost or wheel lost are triggered.

    Do you get what i mean. In this way impactminor can be used with damage on and not damage off.


    Another idea would be to use ImpactMinor to say soemthing different like 'hope you are ok!', 'easy boy' (don't know!)



    In the internal plugins thers is this (look below). I think i discussed it with Jacobson but he said not yet implemented. In fact i think even i game it does not work yet. (it worked with rf1)

    unsigned char mDentSeverity[8];// dent severity at 8 locations around the car (0=none, 1=some, 2=more)

    You said: Another thought, is that rF2 MFD shows damage visually, so game knows what exactly is damaged. Has this been implemeted in rfactor2?
     
    Last edited by a moderator: Oct 26, 2016
  4. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    Thanks Jeff, I like your idea of 2 inputs, will give it a try.
    Is there a way to make Spotter output diagnostic information, like detailed log, like Crew Chief does? debugMode log is very minimal and doesn't help understanding what is happening at run time.

    Can you clarify where did you find this line?
    unsigned char mDentSeverity[8];// dent severity at 8 locations around the car (0=none, 1=some, 2=more)
    And, how could we benefit/access that from Gerald's plugin?
     
  5. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108

    I will re-write the event 'impactminor' and see if it works as well.

    Can you elaborate more on diagnostic information as I never saw Crew Chief?

    That line as found from here: http://www.mediafire.com/download/pgwo5988ui7d6p5/rF2_Example_Plugin_#7.7z (its the internal plugins for rf2, but not everything is implemented).

    Gerald's plugin is limited in what we can do unless he works out new triggers/inputs from this document above.

    Jef
     
  6. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    I've no desire to even launch anything but rF2 anymore, so no detailed answer here. CC basically runs as a separate program reading shared memory of a game. It has output window where it prints what events it evaluated etc, at runtime, so it gives at least a bit of insight on what it is doing internally.

    If you get ImpactMinor working as we discussed, let me know, so that we don't do double work.
    I am testing passing GamePhase to multiple events, to only do certain things during Green Flag (for example, don't congratulate driver on passing car during full course yellow :D). Will let you know how it goes, but it takes a while to understand if something works or fails without any logging.
    Thanks!
     
  7. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    I think as things stand this event 'minordamage' cant be used with damage on. As you can see in link below trigger MinorDamageImpact has no inputs, but just a trigger. That is why i had to work it that way with damage off; as only that way made sense. http://rf2-spotter-plugin.wikia.com/wiki/RF2_Spotter_Plugin_Wiki

    For now these are the solutions I see:

    1. I contact Gerald Jacobson and see if any input can be worked out so that we can use with DAMAGE ON and makes sense.

    2. Change the idea of the event. Instead of spotter saying about minor damage, spotter says soemthing different which makes sense when hit wall/object. Ezamples:

    Hope you're fine!, Unlucky!, That was hard, are you ok?

    Jef


    are you getting my point?
     
  8. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    I think you are right, Wheel/PartDetached are only set on new instances, so there's nothing we can do other than "ouch/cr*p/are you ok?" which I am not sure how helpful will it be, might be annoying, but needs to try (or, just stop resisting and port rF1 shared memory plugin: http://forum.reizastudios.com/threads/crew-chief-v4-spotter-for-automobilista.1094/#post-6756)
     
  9. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    I will as Gerald about any possibility of new inputs. Hope he replies as its been we've been in contact together.

    What is this rf1 shared memory plugin?

    jef
     
  10. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    If I understand correctly, unlike older ISI spin off based games, rF1 doesn't have usual shared memory block containing info about game state, like GTR2/pCars/R3E has. But Crew Chief works exactly by reading this block. So, looks like plugin is called by rF1 API, and transfers info from API to memory block that CC will read. The code looks simple, and might be straightforward for people who know how to develop rF2 plugins.
     
  11. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    Jeff,
    Have you used Spacing parameter? SafetyCar Event, sometimes, triggers way too often. But so far, I noticed that adding Spacing makes it trigger too infrequently. I even tried using small value, like 5 seconds (with TTL 10), it doesn't work too well. Thoughts? Now as I type it I thought maybe SectorFlagChanged is very briefly valid.

    I had success with passing GamePhase input to more events, to disable events that make no sense during Yellow. Also, started to look into shared memory plugin, doable but will take me a while. So I think I'll release extra rules/sounds in 1-2 weeks and move on to that.
     
  12. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    BTW Jeff, idea of event to do on MinorImpact played out pretty well, thanks! I am hoping to push pack out next week, For SafetyCar event, I increased Break break instead of messing with Spacing, that seem to help.
     
  13. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    Hi LeadWolf, how did you implement the MinorImpact event. The way we spoke changing it to damageON and spotter say other phrases.

    Regarding the 'break' event property if not mistaken that is the time when another event can play. Yesterday I was testing a mod for our championship and it seems that 'safety car out' was repeated very close. right? SO in that way maybe the 'break' property can solve the issue.


    Yes I realised that the 'safety car' event plays more than once. Not sure if ever used the gamePhase input. Will check later on today.

    But an input which can be of good use is: FullYellowFlagState

    it offers these inputs:

    Yellow flag states (applies to full-course only)
    ◾-1 Invalid
    ◾0 None
    ◾1 Pending
    ◾2 Pits closed
    ◾3 Pit lead lap
    ◾4 Pits open
    ◾5 Last lap
    ◾6 Resume
    ◾7 Race halt (not currently used)



    Also keep a log of the changes you're doing so that I can change my version as well. If you create/update something let me know so that I can test like you. Then once we're happy with something we can release to public.

    Jeff
     
    Last edited by a moderator: Oct 31, 2016
  14. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    Hi Jeff,

    I implemented Contact event exactly the way we discussed. It can be further improved by, for example taking Speed into account (saying different things if user is stuck with bunch of cars etc) but basic event is working. I'll paste code in a bit.

    You are right with Safety car state flags, I realized that yesterday and extended the event. The problem is that there's a bug (either rF2 or Spotter), only Pending, and Last Lap are triggered. On top of that, Last Lap is triggered many times, so I had to use EventTag to shut it up.

    Keeping log is difficult, because I changed many things. I added ~250 sounds, and adjusted many events. Adjustments are pretty basic though (you did a good job with getting them nice). The best way to understand changes is to compare files using tool like winmergeu

    I will upload my extra sounds pack for you when I get a chance.

    I have idea for two more events that I lack with spotter: I'd like it to announce distance to car behind/in front even if it is large, without faster/slower statements, just time gap. But, I would like to release without those events and look into Crew Chief instead. Coding rules in C# might be easier.
     
  15. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    Contact Event:

    //
    // Expresses concern if user hits something.
    // Future thoughts, we might want take speed into consideration about what
    // to say.
    // Note: if you don't like silly or cursing sounds, just comment them out.
    //
    // 10/27/16 Created - TheIronWolf
    //
    Event=Contact
    {
    Detail=1
    Spacing=10
    Priority=0.5
    Probability=0.5
    //TTL=10.0
    TTL=0.5
    Break=0.25

    Repeat=Off
    Duration=0.0
    Volume=1.0

    Variable=Session {
    Value=0,13 {
    Variable=Random {
    Value=(>=0;<0.11) { File=contact1.wav }
    Value=(>=0.11;<0.22) { File=contact2.wav }
    Value=(>=0.22;<0.33) { File=contact3.wav }
    Value=(>=0.33;<0.44) { File=contact4.wav }
    Value=(>=0.44;<0.56) { File=contact5.wav }
    Value=(>=0.56;<0.67) { File=contact6.wav }
    Value=(>=0.67;<0.78) { File=contact_silly7.wav }
    Value=(>=0.78;<0.89) { File=contact_silly8.wav }
    Value=(>=0.89;<=1.0) { File=contact_silly9.wav }
    }
    }
    }
    }

    SC modified

    // Tell player there is a full course yellow - RACE ONLY - NEW BY JEFFREY
    // 10/26/16 - Increased Break after the event. Added last lap state handling - TheIronWolf
    Event=SafetyCar
    {
    Detail=1

    Spacing=0.0
    Priority=1 // set to max priority as it is triggered manually
    Probability=1.0
    TTL=10.0
    //Break=0.25
    Break=2.0

    // Repeat until duration ends
    Repeat=Off
    Duration=0.0

    // Volume can be set before individual Files if necessary
    Volume=1.0

    Variable=Session {
    Value=10,13 {
    Variable=Input1 {
    Value=5 { // Green Flag phase:
    EventTag=0 // Reset state to initial.
    }
    Value=6 { // Full Course Yellow phase
    // NOTE: Does only Pending and Last Lap gets triggered currently
    Variable=Input2 {
    Value=1 { // Pending
    EventTag=1
    Variable=Random {
    Value=(>=0;<0.2) { File=safetycar1.wav }
    Value=(>=0.2;<0.4) { File=safetycar2.wav }
    Value=(>=0.4;<0.6) { File=safetycar3.wav }
    Value=(>=0.6;<0.8) { File=safetycar4.wav }
    Value=(>=0.8;<=1.0){ File=safetycar4.wav }
    }
    }
    Value=2 { // Pits closed
    Variable=Random {
    Value=(>=0;<0.5) { File=safetycar_pits_closed1.wav }
    Value=(>=0.5;<=1.0) { File=safetycar_pits_closed2.wav }
    }
    }
    Value=3 { // Pits lead lap
    Variable=Random {
    Value=(>=0;<0.5) { File=safetycar_pit_lead_lap1.wav }
    Value=(>=0.5;<=1.0) { File=safetycar_pit_lead_lap2.wav }
    }
    }
    Value=4 { // Pits open
    Variable=Random {
    Value=(>=0;<0.5) { File=safetycar_pits_opened1.wav }
    Value=(>=0.5;<=1.0) { File=safetycar_pits_opened2.wav }
    }
    }
    Value=5 { // Last lap
    Variable=EventTag { // Prevent this event from triggering more than two times.
    Value=1 {
    EventTag=2
    Variable=Random {
    Value=(>=0;<0.2) { File=safetycar_last_lap1.wav }
    Value=(>=0.2;<0.4) { File=safetycar_last_lap2.wav }
    Value=(>=0.4;<0.6) { File=safetycar_last_lap3.wav }
    Value=(>=0.6;<0.8) { File=safetycar_last_lap4.wav }
    Value=(>=0.8;<=1.0) { File=safetycar_last_lap5.wav }
    }
    }
    Value=2 {
    EventTag=3
    Variable=Random {
    Value=(>=0;<0.2) { File=safetycar_last_lap1.wav }
    Value=(>=0.2;<0.4) { File=safetycar_last_lap2.wav }
    Value=(>=0.4;<0.6) { File=safetycar_last_lap3.wav }
    Value=(>=0.6;<0.8) { File=safetycar_last_lap4.wav }
    Value=(>=0.8;<=1.0) { File=safetycar_last_lap5.wav }
    }
    }
    }
    }
    Value=6 { // Resume
    Variable=Random {
    Value=(>=0;<0.5) { File=safetycar_resume1.wav }
    Value=(>=0.5;<=1.0) { File=safetycar_resume2.wav }
    }
    }
    }
    }
    }
    }
    }
    }
     
  16. Wiggin

    Wiggin Registered

    Joined:
    Mar 15, 2016
    Messages:
    132
    Likes Received:
    4
    I'm beyond excited for what this could mean! Thanks guys, very much appreciated.

    Sent from my BlackBerry PRIV
     
  17. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    Hi Leadwolf if you can give me the sounds needed I can test both events above. Maybe email on jefcam@gmail.com

    Jeffrey
     
  18. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
  19. jefcam

    jefcam Registered

    Joined:
    Feb 10, 2011
    Messages:
    261
    Likes Received:
    108
    TO THE COMMUNITY: Me and TheLeadWolf are testing privately some events.
     
  20. TheLeadWolf

    TheLeadWolf Registered

    Joined:
    Apr 13, 2016
    Messages:
    100
    Likes Received:
    6
    I also re-trimmed all the sounds and will be releasing refresh and driver name pack for enduracers mod.
     

Share This Page