RF2 frezze as soon as i change the weather via InternalPlugin

Discussion in 'Bug Reports' started by Gerald Jacobson, Apr 17, 2014.

  1. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Hello,
    As soon as i return "true" in the AccessWeather method, RF2 freeze. I try many code change but rf2 always freeze.

    Please find an example of the AccessWeather method.

    Code:
    bool ExampleInternalsPlugin::AccessWeather( double trackNodeSize, WeatherControlInfoV01 &info ) {
    	
    	if( !mEnabled || !inRealTime)
        return( false );
    	
    	if (!weatherUpdated) {
    		weatherUpdated = true;
    		info.mAmbientTempK = 290;
    		info.mCloudiness = 0;
    		info.mET = mET + 1;
    		info.mRaining[0][0] = 0;
    		info.mRaining[0][1] = 0;
    		info.mRaining[0][2] = 0;
    		info.mRaining[1][0] = 0;
    		info.mRaining[1][1] = 0;
    		info.mRaining[1][2] = 0;
    		info.mRaining[2][0] = 0;
    		info.mRaining[2][1] = 0;
    		info.mRaining[2][2] = 0;
    		info.mWindMaxSpeed=3;
    		//std::fill_n(info.mExpansion, 512, 0x00);
    		
    		return true;
    	}
    	return false;
    }
     
    Last edited by a moderator: Apr 18, 2014
  2. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Is someone succeed to use it ?
     
  3. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I will give it a go today and let you know what I find. I did notice something in the comments which was a little confusing:
    Code:
      // mRaining[1][1] is at the origin (2013.12.19 - and currently the only implemented node), while the others
      // are spaced at <trackNodeSize> meters where <trackNodeSize> is the maximum absolute value of a track vertex
      // coordinate (and is passed into the API call).
    
    If I am reading that comment correctly, he is saying that mRaining[1][1] is the only node you can change. Maybe because you are setting other nodes it causes it to crash?
     
  4. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    I tried it also in my many tests. No change, still freeze...
    Thanks to try and wainting your feedback. Launch RF2 in windowed mode, or you will be freezed if the freeze occurs (and you will need to hard shutdonw your PC).
     
  5. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Noel, did you try the weather in the a plugin ?
     
  6. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Sorry. I haven't had a chance. I have been messing with the replay controls. I will try to get to it this weekend.
     
  7. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Is it possible that an ISI dev look at this freeze, please ?

    Thanks
     
  8. palm3r

    palm3r Registered

    Joined:
    Jan 11, 2012
    Messages:
    37
    Likes Received:
    11
    Same xxxx happened to me.
    Regardless of whether change WeatherControlInfoV01 or not, returning true cause freeze every time.
     
  9. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    ISI, could you confirm there is a bug, and it is useless to continue testing ? (avoiding me wasting time on it)

    Thanks
     
  10. palm3r

    palm3r Registered

    Joined:
    Jan 11, 2012
    Messages:
    37
    Likes Received:
    11
    It solved...
    When plugin loaded by client (rFactor2.exe), returning true in AccessWeather causes freeze.
    When plugin loaded by server (rFactor2 Dedicated.exe), returning true in AccessWeather works fine.
    So, you should add some code to detect which executable running, and make your AccessWeather to runs on server only.

    This behavior is OK for my purpose (I'm going to develop server plugin), but it will not be OK for some people.
    Sorry for my bad english.
     
  11. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Great Thanks palm3r. Gonna finish my realtime plugin.

    Envoyé de mon GT-N7105 en utilisant Tapatalk
     
  12. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Great find!
     
  13. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    palm3r,
    Did you succeed see a visual impact when changing mCloudiness ?
    It seems that "mCloudiness" is never taken into account and only autocalculated using "mRaining"
    So i cannot have cloud without rain.

    Do you confirm ?
     
  14. palm3r

    palm3r Registered

    Joined:
    Jan 11, 2012
    Messages:
    37
    Likes Received:
    11
    When sunny weather, mCloudiness does not show changes.
    But when rain starts, suddenly clouds appears.
    Now mCloudiness and mRaining seems associated.
    I hope they works independently (for showing clouds as sign of rain).
     
    Last edited by a moderator: Apr 26, 2014
  15. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Normally, how it should work:
    - you have mCloudiness that represents the overall cloud coverage
    - mRaining (for now, only [1][1] is taken into account) is use to calculate a minimal cloud coverage corresponding to the rain intensity)
    --> then if the minimal cloud coverage is greater than mCloudiness, then the cloud coverage used is the computed minimal cloud coverage, else it is mCloudiness

    Actually,
    mCloudiness is not taken into account because it seems that thecomputed cloud coverage based on rain intensity is always used (so if there is no rain we have only a clear sky)

    Hope the new plugin weather feature will be enhanced and fixed at each build.
     

Share This Page