New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
24.0 - 24.2 Research are not transmitted correctly #136
Comments
From SSGFouts31 (KSP Forum)
We should have a look at this to putt it into 1.4.1 as well. |
So, i got the error! The WaitForSeconds-Method (ModuleRTDataTransmitter.cs:116) did not sleep very well on kspx64 with our x86 compiled dll. The sleeping interval are defined in the *.cfg files and all antennas have the value 0.3 seconds. This method doesn't work well with 0.x values on our compiled dll for kspx64.
As you can see, the time between 'Time' and 'Time check' isn't 0.3 seconds but on kspx86 are the times correct! I think the created 'RnDCommsStream' object. (ModuleRTDataTransmitter.cs:83), created with this defined sleep time, will look at the transmission and if the transmission ends not in the right time you will "lose" some science. We can fix this if we change the sleep time (PacketInterval) on all *.cfg files to min 1.0, but i tried these values and my transmission of 5 Science around Kerbin takes 3 seconds to transmit. I don't want to know how long this would take for 200 Science :/ Or we use the method WaitForFixedUpdate instead of WaitForSeconds, but this will be 0.02 seconds. The transmission will be really fast, maybe too fast. Or, ugly idea, we make a loop with WaitForFixedUpdate to get our 0.3 seconds. @RemoteTechnologiesGroup/owners what do you think? |
If you change the packet size to compensate for the packet interval, then the overall transmission time will be the same (and likewise with the electricity requirements). If you're absolutely sure that the problem is with intervals of <1 second, then that's probably the best approach. (Personally, I don't understand why this particular problem would come about from running a 32-bit library from a 64-bit program, so I'll defer to everybody else's expertise). An 0.02 second cycle will basically spam the game every time somebody transmits data, so it's probably not as good a solution. |
Some results of my research with a fresh copy of ksp-x86 and ksp-x64 (without any mods)
For our problem i developed a small ksp test addon ( dll ). This addon will open a small popup to trigger the sleep function. (You have to open the Debug-Log with ALT-F2 to see the results) If you click the button on the main menü you will get the right amount of delta time for both versions. Now load a save game, go to the tracking station and select a vessel. If you now click the button you can see that on the x64 version the delta time goes up to 1.3. Is this only on my computer? |
And i found it on the ksp forum:
|
Maybe i found a nice workaround: we do not change the PacketInterval, we change the RnDCommsStream-Timeout by a pre calculation of the time, based on our Packetinterval. // pre calculate the time interval - fix for x64 systems
// workaround for issue #136
float time1 = Time.time;
yield return new WaitForSeconds(PacketInterval);
// get the delta time
float x64PacketInterval = (Time.time - time1);
RTLog.Notify("Changing RnDCommsStream timeout from {0} to {1}", PacketInterval, x64PacketInterval);
commStream = new RnDCommsStream(subject, science_data.dataAmount, x64PacketInterval,
science_data.transmitValue, ResearchAndDevelopment.Instance); It seems to work, for both versions. |
I assume the How does this work if you don't have enough battery capacity to transmit full packets, and/or you're using time warp to artificially lower the packet rate? |
yes the RnDCommsStream is a class from stock. public RnDCommsStream(ScienceSubject subject, float fileSize, float timeout,
float xmitValue, ResearchAndDevelopment RDInstance); Everthing sould work as it is intended to be. In KSP stock, if you can't send your packet on the specified time, it's intend that you will lose some science. As i wrote, i've sent some data to kerbin in x64 without any mods and it takes 3 times longer as in x86. I've only adjusted the timeout 😊 |
I can't find a other way to fix this issue. I think we should give it a try (Peppie84@33fb48e ) |
Hello.
First of all sorry if this bug report is not correctly written, since this is my first time trying to report issues this way. ( im aware remote tech are currently not official updated to work on 24.0 or 24.2 ).
I tried Remote tech 2 on version 24.0 - 24.1 - 24.2 and I have the following bug on all versions.
bug..: When transmitting research data from example the mum to kerbin, then the data are not send correctly.. For example if i send 100 science to kerbin from the mum, and it have a 100% integretiy then I only recieve example 10 science in the mission report.
So the transmitted science are not calculated correctly.
Thank you all of making remote tech 2 better and compatible with ksp ;-) good job guys.
The text was updated successfully, but these errors were encountered: