Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Malfunctions randomizer

    Hello,

    I think the PSX auto malfunctions randomize function not accurate enough for flying without instructor. This is because this software was designed by Hardy with professional training in mind. For professional purposes, there is always an instructor who can setup the malfunctions manually. I would like to be able to set a probability for each malfunction close to reality. Unfortunately, with the "sofistically random" option of PSX it is not possible to setup a probability lower than 1 event per mouth, which is very far from reality for many severe malfunctions. For example, if the real 744 had 1 engine fire per mounth, it would have stop flying long time ago...

    I see 3 solutions :

    - Write a C++ script myself. I started writing it but very slowly because I am a beginner. Socket created, connection OK, dialog read/write Q vars OK. Actually writing the randomize and timer classes.

    - Create a randomizer with SIOC and toggle the malfunctions via PSXSeecon malfunctions variables (are these variables already created) ? I do not see randomize functions within SIOC.

    - Ask Nico to allow PSXSeecon, for each malfunction, via a specific probability variable, to set malfunctions according to this probability. Example :

    Variable X (PSXSeecon linked with associated PSX Q var) : Engine 1 fire.
    Variable X' (User defined via SIOC) : Probability of events per flight hours. Example 0,001 event per hour of flight.

    And so on for each malfunction...

    Any idea or comments appreciated.

  2. #2
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Hi JP,
    Quote Originally Posted by Jean-philippe View Post
    .. via PSXSeecon malfunctions variables (are thes variables already created) ? I do not see randomize functions within SIOC.
    I have just implemented Qs137 up to Qs320 and am in the process of testing and documenting... I noticed something strange and have asked Hardy for clarification . As soon as I have more experience with it it will be time to think about your request. Do note that SIOC has a RANDOM function built in (and a DELAY) so all ingredients available.

    Nico

  3. #3
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Quote Originally Posted by kiek View Post
    ...Do note that SIOC has a RANDOM function built in (and a DELAY) so all ingredients available.
    Nico
    Hi Nico,

    Great to listen. I'll see if I find something about the RANDOM function. Thanks a lot.

  4. #4
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    I found the RANDOM function. I hadn't the good SIOC manual version. Thank you Nico. Here is a piece of code I wrote quickly. The probability ranges are not accurate. I'll have to get documentation to have the real values.

    The subroutine is called at each flight when I set the BEACON.

    L0 gives the malfunction random happening DELAY within a 12 hours limit (average B744 flight time).

    L1 gives a random number within the probability range. If there is, say, 15 events within the family, there is in my example 15 chances / 500000 for an event of this family to happen for this flight.

    Code:
    Var 3000, name Switch, Link IOCARD_SW, Input 0, Type I     // BEACON BOTH SWITCH
    {
      CALL &Malfunctions
    }
    
    
    Var 9000, name Malfunctions, Link SUBRUTINE     // MALFUNCTIONS SUBROUTINE
    {
      L0 = RANDOM 1 ,432000     // DELAY RANDOMIZER (12 HOURS 1/10 SEC)
      L1 = RANDOM 1 ,500000     // EXCESSIVE EVENT PROBABILITY RANGE
      IF L1 = 1     // 1 CHANCE / 500000
      {
        &Mal1 = DELAY  1 ,L0     // MAL1 = 1 AFTER L0 DELAY
      }
      IF L1 = 2     // 1 CHANCE / 500000
      {
        &Mal2 = DELAY 1 ,L0     // MAL2 = 1 AFTER L0 DELAY
      }
      L1 = RANDOM 1 ,300000     // CRITICAL EVENT PROBABILITY RANGE
      IF L1 = 1
      {
        &Mal3 = DELAY 1 ,L0
      }
    
    // ...and so on for each malfunction family...
    
    }
    
    
    Var 4300, name Mal1, static     // MALFUNCTION 1 (EXCESSIVE) PSX SEECON VARIABLES...
    
    
    Var 4301, name Mal2, static     // MALFUNCTION 2 (EXCESSIVE)
    
    
    Var 4302, name Mal3, static     // MALFUNCTION 3 (CRITICAL)
    
    // ... and so on for each malfunction...
    Malfunctions variables numbers are not accurate while Nico didn't release the malfunctions variables at this time. I have a question about the SIOC philisophy for this code. Does the process stop here...

    Code:
     &Mal1 = DELAY  1 ,L0     // MAL1 = 1 AFTER L0 DELAY
    ... until the DELAY is over, or does the process continues ? In the first case, it would be only 1 event per flight session. In the 2nd case, it will be possible to have 1 event per family per flight session.

  5. #5
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Hi JP,
    About SIOC "philosophy"
    No the process does not stop/hold at a DELAY statement , the delayed assignment is "put away/postponed" for later execution and SIOC continues immediately with the line after the DELAY statement.

    Nico

  6. #6
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Great !

    It would be possible to get one event per family per flight, which is quite realistic I think. I plan to create 4 families of failures, like PSX does. Undemanding, Moderate, Critical and Excessive. The code above is an example made in 5 minutes. I'll optimize it after the release of the malfunctions PSXSeecon variables. I'm very excited to be able to generate true random failures, and don't know if something will happen during a flight. It makes the flight experience much more interesting I guess. I follow the thread at PSX forum. Congrats for the great job.

  7. #7
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Hi Jean-Philippe,

    Version 1.3.0 supports all MalFunction variables (Qs137 .. Qs320). Please study section 3.16 of the Manual and have a look at and/or play a little with my example in 0_MalFunction.txt (from cockpit744.zip).

    Note that you have the option of either setting the severity for each Malfunction in the instructor panel or define the severity in SIOC at each trigger.

    Below your code slightly modified.
    Code:
    
    ///////////////////////////////////////////////////////////////////////////
    //
    //   Title:    PSX Malfunction control  
    //
    //   psxseecon
    //   version:  1.3.0
    //
    //   Date:     25 Dec 2014
    //
    //   Author:   Nico Kaan / Jean-Philippe 
    //             The Netherlands / France
    //             www.lekseecon.nl
    // *************************************************************************
    
    
    Var 0 Value 0
    {
      CALL &Malfunctions
    }
    
    
    Var 9000 name Excessive Value 500000  // Chance range for Excessive Malfunctions: 1 out of ...
    Var 9001 name Duration Value 432000   // Delay randomizer (out of 12 HOURS 1/10 SEC)
    
    
    Var 9002 name Malfunctions Link SUBRUTINE     
    {
      L1 = RANDOM 1 &Excessive     
      IF L1 = 1      
      {
        L0 = RANDOM 1 &Duration     
        &MfFlameout1 = DELAY 6 L0    // trigger severe MF 
      }
      L1 = RANDOM 1 &Excessive     
      IF L1 = 1     
      {
        L0 = RANDOM 1 &Duration     
        &MfFlameout2 = DELAY 6 L0    // trigger severe MF
      }
      L1 = RANDOM 1 &Excessive     
      IF L1 = 1     
      {
        L0 = RANDOM 1 &Duration     
        &MfFlameout3 = DELAY 6 L0    // trigger severe MF 
      }
      L1 = RANDOM 1 &Excessive     
      IF L1 = 1     
      {
        L0 = RANDOM 1 &Duration     
        &MfFlameout4 = DELAY 6 L0    // trigger severe MF
      }
    }
    
    
    Var 5313 Static name MfFlameout1
    Var 5314 Static name MfFlameout2
    Var 5315 Static name MfFlameout3
    Var 5316 Static name MfFlameout4
    
    
    //eof
    ///////////////////////////////////////////////////////////////////////////
    Don't you think the excessive range of 500000 is not way to big?
    Well, with the way I have coded it it's easy to experiment with it by scaling down var 9000.

    Regards,
    Nico
    Last edited by kiek; 12-25-2014 at 02:49 PM.

  8. #8
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Excellent Nico. Thank you very much for these new features. You're absolutely right. Only need to test if random result = 1 because the random function is re-called every time. No need to test 1, then 2,... like in my example above.

    I am actually looking for accurate values of probabilities for each family of failure. Not very easy to find because I think Boeing doesn't like to give such critical informations and statistics. The 9000 variable is a good idea and makes the modification of the probability range very easy. 1 excessive failure every 500000 flights looks like a little bit high I guess also. Maybe 1 excessive event every airplane life would be a more accurate value. Just have to find how many flights a 747-400 does in its life...

    Very quick example : if a 747-400 does 1,5 flights every day which I think is realistic for long range airplane, it's life is 25 years, it will do 1,5 x 365 x 25 = 13687 flights within its life. So variable 9000 for excessive failures should be 13687.

    And so on for critical, moderate and undemanding failures with higher probabilities of course.

  9. #9
    75+ Posting Member
    Join Date
    Jun 2011
    Location
    FRANCE
    Posts
    121
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Hi,

    The examples above give a probability for each flight, but only take a 12 hours flight duration to trigger the malfunction. The problem is that if you do a 3 hours flight and the randomizer creates a malfunction after 6h57 of flight, you'll never see the malfunction. It makes the probability of happening much lower than expected.

    I found a solution by adding an encoder and 4 displays. When you get into the cockpit for a new flight, you first set your schedulded block time with the encoder, according to your flight plan. Then, when you start your flight out to the gate, you set the BEACON swith to BOTH. Then, the chrono starts and you'll get the malfunctions during your block time, if such a malfunction has been randomized.

    Here is the above code enhanced with these new functionalities tested with IOCP console.

    Code:
    ///////////////////////////////////////////////////////////////////////////
    //
    //   Title:    PSX Malfunction randomizer example with block time
    //           encoder and display.
    //
    //   psxseecon
    //   version:  1.3.0
    //
    //   Date:     27 Dec 2014
    //
    //   Author:   Nico Kaan / Jean-Philippe LEPINE
    //             The Netherlands / France
    //             www.lekseecon.nl
    //
    //   Note :    You first set the scheduled block time with the encoder and
    //           displays. Then, the randomizer starts when you set the 
    //             BEACON switch to BOTH position.
    // *************************************************************************
    
    
    
    
    
    
    Var 3754, name LtBeaconOnR, static, Link IOCARD_SW, Device 11, Input 66, Type I     // BEACON LTS 3 POS TOGGLE (BOTH)
    {
      CALL &Malfunctions
    }
    
    
    Var 7800, name BlkTimeEnc, static, Link IOCARD_ENCODER, Device 1, Input 0, Aceleration 3, Type 2     // BLOCK TIME ENCODER
    {
      L0 = &BlkTimeEnc    
      &BlkTime = ROTATE 0 ,1439 ,L0     // 1439 MINUTES = 23H59
    }
    
    
    Var 8621, name BlkTime, static     // BLOCK TIME
    {
      &BlkTime10 = &BlkTime * 600
      L0 = &BlkTime / 60
      IF L0 >= 1
      {
        L1 = TRUNC L0
        &BlkTimeHrsDp = L1    
        L2 = L0 - L1
        L2 = L2 * 60
        L2 = ROUND L2
        &BlkTimeMinDp = L2    
      }
      ELSE
      {
        &BlkTimeHrsDp = 0    
        L0 = L0 * 60
        L0 = ROUND L0
        &BlkTimeMinDp = L0    
      }
    }
    
    
    Var 8622, name BlkTime10, static     // BLOCK TIME 1/10 SEC
    
    
    Var 8623, name MfExcessive, static, Value 13500     // EXCESSIVE MALFUNCTION PROB RANGE
    
    
    Var 8624, name MfCritical, static, Value 8500     // CRITICAL MALFUNCTION PROB RANGE
    
    
    Var 8625, name MfModerate, static, Value 2000     // MODERATE MALFUNCTION PROB RANGE
    
    
    Var 8626, name MfUndemanding, static, Value 500     // UNDEMANDING MALFUNCTION PROB RANGE
    
    
    Var 5265, name MfCabExplo, static     // CABIN EXPLOSIVE DECOMPRESSION
    
    
    Var 5333, name MfOilTemp1, static     // ENGINE 1 OIL TEMP
    
    
    Var 5334, name MfOilTemp2, static     // ENGINE 2 OIL TEMP
    
    
    Var 8620, name Malfunctions, static, Link SUBRUTINE     // MALFUNCTIONS SUBROUTINE
    {
      L1 = RANDOM 1 ,&MfExcessive     // EXCESSIVE EVENTS...
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10     // DELAY RANDOMIZER    
        &MfCabExplo = DELAY 6 ,L0
      }
      L1 = RANDOM 1 ,&MfCritical     // CRITICAL EVENTS...
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfCabExplo = DELAY 5 ,L0
      }
      L1 = RANDOM 1 ,&MfCritical
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp1 = DELAY 6 ,L0
      }
      L1 = RANDOM 1 ,&MfCritical
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp2 = DELAY 6 ,L0
      }
      L1 = RANDOM 1 ,&MfModerate     // MODERATE EVENTS...
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp1 = DELAY 5 ,L0
      }
      L1 = RANDOM 1 ,&MfModerate
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp2 = DELAY 5 ,L0
      }
    }
    
    
    Var 8040, name BlkTimeHrsDp, static, Link IOCARD_DISPLAY, Device 1, Digit 0, Numbers 2     // BLOCK TIME HOURS DP
    
    
    Var 8041, name BlkTimeMinDp, static, Link IOCARD_DISPLAY, Device 1, Digit 2, Numbers 2     // BLOCK TIME MINUTES DP

  10. #10
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Malfunctions randomizer

    Hello Jean-Philippe,
    An improvement indeed.

    I have made a few changes to your code:
    - I have add the test IF &LtBeaconOnR = 1 to var 3754, otherwise the Malfunction subroutine will be called again if the value becomes 0.
    - I removed the keyword static for non-PSXseecon vars. There is no need to make all these vars static, its better to let SIOC give these vars unique numbers while compiling several scripts.

    Regards,
    Nico

    Code:
    ///////////////////////////////////////////////////////////////////////////
    //
    //   Title:    PSX Malfunction randomizer example with block time
    //           encoder and display.
    //
    //   psxseecon
    //   version:  1.3.0
    //
    //   Date:     27 Dec 2014
    //
    //   Author:   Nico Kaan / Jean-Philippe LEPINE
    //             The Netherlands / France
    //             www.lekseecon.nl
    //
    //   Note :    You first set the scheduled block time with the encoder and
    //           displays. Then, the randomizer starts when you set the 
    //             BEACON switch to BOTH position.
    // *************************************************************************
    
    
    
    
    Var 3754, name LtBeaconOnR, static, Link IOCARD_SW, Device 11, Input 66, Type I     // BEACON LTS 3 POS TOGGLE (BOTH)
    {
      IF &LtBeaconOnR = 1
      {
        CALL &Malfunctions
      }
    }
    
    
    
    
    Var 7800, name BlkTimeEnc, Link IOCARD_ENCODER, Device 1, Input 0, Aceleration 3, Type 2     // BLOCK TIME ENCODER
    {
      L0 = &BlkTimeEnc    
      &BlkTime = ROTATE 0 ,1439 ,L0     // 1439 MINUTES = 23H59
    }
    
    
    
    
    Var 8621, name BlkTime     // BLOCK TIME
    {
      &BlkTime10 = &BlkTime * 600
      L0 = &BlkTime / 60
      IF L0 >= 1
      {
        L1 = TRUNC L0
        &BlkTimeHrsDp = L1    
        L2 = L0 - L1
        L2 = L2 * 60
        L2 = ROUND L2
        &BlkTimeMinDp = L2    
      }
      ELSE
      {
        &BlkTimeHrsDp = 0    
        L0 = L0 * 60
        L0 = ROUND L0
        &BlkTimeMinDp = L0    
      }
    }
    
    
    
    
    Var 8622, name BlkTime10     // BLOCK TIME 1/10 SEC
    
    
    
    
    Var 8623, name MfExcessive, Value 13500     // EXCESSIVE MALFUNCTION PROB RANGE
    
    
    
    
    Var 8624, name MfCritical, Value 8500     // CRITICAL MALFUNCTION PROB RANGE
    
    
    
    
    Var 8625, name MfModerate, Value 2000     // MODERATE MALFUNCTION PROB RANGE
    
    
    
    
    Var 8626, name MfUndemanding, Value 500     // UNDEMANDING MALFUNCTION PROB RANGE
    
    
    
    
    Var 5265, name MfCabExplo, static     // CABIN EXPLOSIVE DECOMPRESSION
    
    
    
    
    Var 5333, name MfOilTemp1, static     // ENGINE 1 OIL TEMP
    
    
    
    
    Var 5334, name MfOilTemp2, static     // ENGINE 2 OIL TEMP
    
    
    
    
    Var 8620, name Malfunctions, Link SUBRUTINE     // MALFUNCTIONS SUBROUTINE
    {
      L1 = RANDOM 1 ,&MfExcessive     // EXCESSIVE EVENTS...
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10     // DELAY RANDOMIZER    
        &MfCabExplo = DELAY 6 ,L0
      }
      L1 = RANDOM 1 ,&MfCritical     // CRITICAL EVENTS...
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfCabExplo = DELAY 5 ,L0
      }
      L1 = RANDOM 1 ,&MfCritical
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp1 = DELAY 6 ,L0
      }
      L1 = RANDOM 1 ,&MfCritical
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp2 = DELAY 6 ,L0
      }
      L1 = RANDOM 1 ,&MfModerate     // MODERATE EVENTS...
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp1 = DELAY 5 ,L0
      }
      L1 = RANDOM 1 ,&MfModerate
      IF L1 = 1
      {
        L0 = RANDOM 1 ,&BlkTime10
        &MfOilTemp2 = DELAY 5 ,L0
      }
    }
    
    
    
    
    Var 8040, name BlkTimeHrsDp, Link IOCARD_DISPLAY, Device 1, Digit 0, Numbers 2     // BLOCK TIME HOURS DP
    
    
    
    
    Var 8041, name BlkTimeMinDp, Link IOCARD_DISPLAY, Device 1, Digit 2, Numbers 2     // BLOCK TIME MINUTES DP

Page 1 of 2 12 LastLast