Jump to content

linuxgurugamer

Bug Hunter
  • Posts

    24,966
  • Joined

  • Last visited

Everything posted by linuxgurugamer

  1. An FPS drop is much more noticeable when you have a very fast framerate, simply because anything which takes time is multiplied that many more times. Interestingly enough, while you said that it dropped TO 100fps, you didn't mention what it was before. You mentioned the limit was set to 180, but that is meaningless without knowing what it exactly was before. Let me give you an example: A framerate of 120 fps means that each frame is 8.3333 milliseconds. If something were to increase that to 9 milliseconds, the FPS would drop to 111. If something were to increase it to 10ms, the FPS would drop to 100 Now, the same thing with an FPS of 60, means that each frame is 16.6666 milliseconds. Increasing it by .66666 to 17.333333 gives an FPS of 57.69. A drop of only 2.3 fps. Increasing it by 1.666666 would lead to an fps of 54.54, a drop of 5.46 fps. As you see, the exact same overhead has different impact depending on the initial FPS. With an extremely high initial framerate, the drop is (using measurements), much more noticable than with a lower initial framerate. Frankly, I'm not concerned about anything in the editor with an FPS of 100. It is more than fast enough, and considering what is being done, the drop you observed is perfectly acceptable, and frankly is expected. The heap info was interesting, but I'm not sure it's related to this mod directly. There are some minor optimizations I can to to address this, mainly moving variable allocation out of methods and into the main class. But it is most likely having to do with the fact that there is an extra layer of calls between mods and Unity, as well as having to check the mouse position constantly.
  2. Oops. Wasn't in a significant place, but I'll get it fixed Thanks
  3. Right click on kerbel space program, go to properties, select browse local files. It will open up the folder then delete everything in that folder it opens.
  4. No need to be insulting. Again, the fact that you don't like it doesn't mean that others don't find it useful.
  5. It provides more information to players, especially new players
  6. It's no wonder I haven't bothered to play KSP for quite a long time now. Every single update contains some useless feature change. It's like you are purposely trying to irritate your player base. I don't consider this to be useless. Many other people also don't consider this to be useless.
  7. Would be best to contact the TCA thread, since it's overriding the inputs here
  8. Let me know when you've released it. This isn't something that I use, so I won't really be aware of the release.
  9. Ummm, would be helpful to know your OS. I know that on a Mac, I had a similar problem until I rebooted, turned out some OS updates were waiting to be fully installed and were causing the game to fail. Other than that, look in my sig for a link to a post which describes where the log files are and how to make them available. Regarding Steam, I'd suggest deleting KSP, then going into the folder where Steam installs KSP and deleting the entire directory, then reinstall
  10. I've submitted a PR to add a module so that StateFunding won't consider these parts as vessels. Until @cmheisel merges and releases it, you can get it from here: https://github.com/linuxgurugamer/ksp-decouple-with-control License is same as original (MIT) Once it is merged and released, i'll delete my repo
  11. New release, 0.6.16 Added recording of completed and failed contracts Added new field to indicate whether part is a disposable part, if it is, does not get counted in the destroyed vessels list Added MM script to add new module to all command parts Added code to remove callbacks when leaving scene or reverting Note: The mod now REQUIRES ModuleManager
  12. It would have to be a patch to his mod. It's a MM script, so I may just fork his repo, make the change and push it back to him for inclusion. @cmheisel Would you be willing to accept a PR with these changes?
  13. I've been doing some testing, and have been getting inconsistent results. I've created simple vessels (command pod + srb), launched them and let them crash, but the onCrash event isn't triggering. So, two questions: What triggers the onCrash event? Is there another way to identify when a vessel has been destroyed? Thanks in advance
  14. Actually, there IS another way which I'm implementing. I'm adding a module to StateFunding which is used to indicate whether the command part is disposable or not. It's being added to all parts via a MM script. The default is that parts are NOT disposable. This mod could easily add my module (or I could) so that all the parts modified by this are listed as disposable.
  15. Here you go. What this is doing is coordinating a hidden resource with a visible resource, so that when one is changed, the other will be updated. using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace IFILifeSupport { [KSPAddon(KSPAddon.Startup.Flight, false)] public class AddTransferListener : MonoBehaviour { public static EventData<UIPartActionResourceTransfer> onTransferSpawn = new EventData<UIPartActionResourceTransfer>("onTransferSpawn"); UIPartActionResourceTransfer t; private void Start() { Log.Info("Transfer.Start"); onTransferSpawn.Add(OnTransferSpawned); //This probably only needs to be attached once, but using AddOrGetComponent insures that you don't //end up with multiple copies of your listener UIPartActionController.Instance.resourceTransferItemPrefab.gameObject.AddOrGetComponent<TransferListener>(); } void OnDestroy() { Log.Info("Transfer.OnDestroy"); } void DisplayTransferInfo(UIPartActionResourceTransfer t, bool descend = false) { #if false Log.Info("\r\n\r\n DisplayTransferInfo, descend: " + descend); Log.Info("Transfer.OnTransferSpawned, transfer.lastUT: " + t.lastUT); Part p = t.Part; PartResource r = t.Resource; List<UIPartActionResourceTransfer> targets = t.Targets; if (t.Part != null) Log.Info("transfer.Part: " + t.Part.partInfo.title); if (t.Resource != null) Log.Info("Transfer.Resource: " + t.Resource.resourceName); Log.Info("Transfer.state: " + t.state); if (t.Part != null) { double m = r.maxAmount; Log.Info("Transfer rate: " + m + " per second"); } foreach (UIPartActionResourceTransfer t1 in targets) { Log.Info("t: " + t1); Log.Info("Transfer.Destination transfer.Part: " + t1.Part.partInfo.title); Log.Info("Transfer.Destination transfer.Resource: " + t1.Resource.resourceName); if (descend) DisplayTransferInfo(t1); } #endif } Part source; double maxRequested; string hiddenResource; bool transferInProgress = false; double lastUT; void GetTransferValues(UIPartActionResourceTransfer transfer) { maxRequested = 0; if (t.state == UIPartActionResourceTransfer.FlowState.In) { var r = t.Part.Resources[hiddenResource]; maxRequested += r.maxAmount; } if (t.state == UIPartActionResourceTransfer.FlowState.Out) source = t.Part; List<UIPartActionResourceTransfer> targets = t.Targets; foreach (UIPartActionResourceTransfer t1 in targets) { if (t1.state == UIPartActionResourceTransfer.FlowState.In) { var r = t1.Part.Resources[hiddenResource]; maxRequested += r.maxAmount; } if (t1.state == UIPartActionResourceTransfer.FlowState.Out) source = t1.Part; } lastUT = transfer.lastUT; maxRequested = maxRequested / 20; Log.Info("GetTransferValues, maxRequested/sec: " + maxRequested); Log.Info("GetTransferValues, source: " + source.partInfo.title); } private void OnTransferSpawned(UIPartActionResourceTransfer transfer) { Log.Info("OnTransferSpawned"); t = transfer; DisplayTransferInfo(t, true); //Add your own listeners to the in, out, and stop buttons transfer.flowInBtn.onClick.AddListener(OnInClick); transfer.flowOutBtn.onClick.AddListener(OnOutClick); transfer.flowStopBtn.onClick.AddListener(OnStopClick); } bool LifeSupportResource(string resource) { var b = IFI_Resources.DISPLAY_RESOURCES.Contains(resource); Log.Info("Transfer.LifesupportResource, res: " + resource); if (b) { hiddenResource = IFI_Resources.RESOURCES[IFI_Resources.DISPLAY_RESOURCES.IndexOf(resource)]; Log.Info("Transfer.LifeSupportResource, hiddenResource: " + hiddenResource); GetTransferValues(t); } return b; } private void OnInClick() { Log.Info("Transfer.OnInClick, transfer.lastUT: " + t.lastUT); DisplayTransferInfo(t, true); transferInProgress = LifeSupportResource(t.Resource.resourceName); } private void OnStopClick() { Log.Info("Transfer.OnStopClick, transfer.lastUT: " + t.lastUT); DisplayTransferInfo(t, true); transferInProgress = false; t.FlowStop(); } private void OnOutClick() { Log.Info("Transfer.OnOutClick, transfer.lastUT: " + t.lastUT); DisplayTransferInfo(t, true); transferInProgress = LifeSupportResource(t.Resource.resourceName); } void FixedUpdate() { if (transferInProgress && t != null && t.Resource != null && lastUT != t.lastUT && t.state != UIPartActionResourceTransfer.FlowState.None) { double timeSlice = t.lastUT - lastUT; Log.Info("timeSlice: " + timeSlice); double requestAmt = maxRequested * timeSlice; double totalTransferred = 0; // Get the available resources for transfer double availResForTransfer = source.RequestResource(hiddenResource, requestAmt, ResourceFlowMode.NO_FLOW); // now transfer the resources into the new parts. if (t.state == UIPartActionResourceTransfer.FlowState.In) { double percentageOfTotal = t.Part.Resources[hiddenResource].maxAmount / 20f * timeSlice / requestAmt; var amtToTransfer = -1 * availResForTransfer * percentageOfTotal; var transferredAmt = t.Part.RequestResource(hiddenResource, amtToTransfer, ResourceFlowMode.NO_FLOW); totalTransferred += transferredAmt; //Log.Info("Transfer 1, after: Part: " + t.Part.partInfo.title + ", amount: " + t.Part.Resources[hiddenResource].amount + ", transferred: " + totalTransferred); } List<UIPartActionResourceTransfer> targets = t.Targets; foreach (UIPartActionResourceTransfer t1 in targets) { if (t1.state == UIPartActionResourceTransfer.FlowState.In) { double percentageOfTotal = t1.Part.Resources[hiddenResource].maxAmount / 20f * timeSlice / requestAmt; var amtToTransfer = -1 * availResForTransfer * percentageOfTotal; var beforeAmt = t1.Part.Resources[hiddenResource].amount; Log.Info("Transfer 2, before, amount: " + t1.Part.Resources[hiddenResource].amount + ", transferred: " + totalTransferred); var transferredAmt = t1.Part.RequestResource(hiddenResource, amtToTransfer, ResourceFlowMode.NO_FLOW); totalTransferred += transferredAmt; //Log.Info("Transfer 2, after: amount: " + t1.Part.Resources[hiddenResource].amount + ", transferred: " + totalTransferred); var afterAmt = t1.Part.Resources[hiddenResource].amount; Log.Info("Transfer 2, after: amount: " + afterAmt + ", Logged transfer amt: " + transferredAmt + ", actual diff (after - before): " + (afterAmt - beforeAmt)); IFI_Resources.UpdatePartInfo(t1.Part); } } // Now return the unused resources Log.Info("Transfer Returning, availResources: " + availResForTransfer + ", total transferred: " + totalTransferred + ", returning: " + (availResForTransfer + totalTransferred).ToString()); Log.Info("Transfer, before returning avail resources, amount: " + source.Resources[hiddenResource].amount); source.RequestResource(hiddenResource, -1 * (availResForTransfer + totalTransferred), ResourceFlowMode.NO_FLOW); Log.Info("Transfer, after returning avail resources, amount: " + source.Resources[hiddenResource].amount); lastUT = t.lastUT; if (totalTransferred == 0) OnStopClick(); IFI_Resources.UpdatePartInfo(t.Part); foreach (UIPartActionResourceTransfer t1 in targets) IFI_Resources.UpdatePartInfo(t1.Part); Log.Info("Transfer --------------------------------------------------------------------------------------"); } else if (transferInProgress) { if (t != null) { if (t.Resource == null) Log.Info("Transfer t.Resource is null"); if (lastUT == t.lastUT) Log.Info("Transfer lastUT unchanged, Planetarium.GetUniversalTime: " + Planetarium.GetUniversalTime()); if (t.state == UIPartActionResourceTransfer.FlowState.None) Log.Info("Transfer t.state == UIPartActionResourceTransfer.FlowState.None"); } else Log.Info("t is null"); Log.Info("Transfer --------------------------------------------------------------------------------------"); } } } public class TransferListener : MonoBehaviour { private void Awake() { AddTransferListener.onTransferSpawn.Fire(gameObject.GetComponentInParent<UIPartActionResourceTransfer>()); } } }
  16. How about a way to flag a probecore as expendable? I'm not sure yet the best way to do this, but it should be doable. I can think of at least two ways to do it
  17. Just an FYI, the mod currently isn't recording anything about the contracts, I'll have to fix that
  18. First, the craft which kept remembering the lost missions, was that launched BEFORE or AFTER you installed the mod? Second, the contracts, were they accepted before or after you installed the mod?
×
×
  • Create New...