Jump to content

Universal Resource Transfer (Beamed Power Standalone for any resource)


Recommended Posts

I have an idea for correcting the same name ships issue. Basically, each WirelessSource/Receiver/Reflector will have a unique module id, assigned at the creation of the module. It would work by searching through all existing modules and getting the highest module id, then adding 1. 

Then, when connecting, the system won't search for vessels but module ids. Should work.

Link to comment
Share on other sites

@KspNoobUsernameTaken I was hoping for something like this. I'd like to think that a receiver craft having multiple receivers (in symmetry for CoM reasons) might contribute to the issue. On the transmitter, each receiver indeed shows up as a target and identifies with just the vessel's display name.

Link to comment
Share on other sites

55 minutes ago, JadeOfMaar said:

@KspNoobUsernameTaken I was hoping for something like this. I'd like to think that a receiver craft having multiple receivers (in symmetry for CoM reasons) might contribute to the issue. On the transmitter, each receiver indeed shows up as a target and identifies with just the vessel's display name.

That is the same behavior I've observed. The real problem is that the plugin barely distinguishes between different receivers on the same craft. It probably doesn't cause the issue, but it makes it harder to diagnose.

On a side note, how would you feel about a feature that allows combining multiple receivers on the same ship? I was inspired by radio telescopes working together to effectively create a hyper-giant dish.

Dev update: I have started planning more dish parameters. Stuff like focal point, collimation etc. I need to find the minimum number of variables to fully describe the behavior of a transmitter-receiver pair.

I hope this reply doesn't get merged, but for context, I'm 99% sure that it was plain luck on Anirrudhs part that the code doesn't treat all receivers on the same vessel as the same. It's a miracle the entire save-file parser works consistently at all.

Link to comment
Share on other sites

3 hours ago, KspNoobUsernameTaken said:

On a side note, how would you feel about a feature that allows combining multiple receivers on the same ship? I was inspired by radio telescopes working together to effectively create a hyper-giant dish.

I'd like that very much, actually. Get the sum of the areas of all receiver panels on the ship and present that as a single receiver. It's safe to assume the focal area of the transmitter's beam will never be sharp enough that one receiver will catch everything and the other(s) will completely lose out. But the logic needs to be in place that multiple transmitters can target that receiver and their energies can add up (in case anyone finds it very necessary to do that).

Link to comment
Share on other sites

7 hours ago, JadeOfMaar said:

It's safe to assume the focal area of the transmitter's beam will never be sharp enough that one receiver will catch everything and the other(s) will completely lose out.

I wouldn't be so sure about that. A well collimated laser could certainly remain in the 2-3 meter focal area for a LONG stretch. Even more so for gamma rays (I think?)

7 hours ago, JadeOfMaar said:

But the logic needs to be in place that multiple transmitters can target that receiver and their energies can add up (in case anyone finds it very necessary to do that).

Hmm, that should be just deleting the section for making receivers stop listening when they are being beamed to... Easy enough.

 

7 hours ago, JadeOfMaar said:

Get the sum of the areas of all receiver panels on the ship and present that as a single receiver.

Now, I could probably implement this by turning the receiver section into a vessel module and the part modules into basically just data storage (no scripts attached). 

Then I'd have to get the average wavelength and conversionRate via a weighted average with recvDiameter as the weight.

However, I somehow need to decide what the OutputResource will be. I could just add each OutputResource on the ship to a list and let the player cycle through.

 

Definitely a feature I want, but it'll have to be in V2.0.0, since it'll break compatibility.

Link to comment
Share on other sites

V1.0.1 is out. Features better error handling, corrections to multiple resource functionality, and renaming stuff from BeamedPowerStandalone to UniversalResourceTransfer... because I just realized everything was still named BeamedPowerStandalone... sometimes I'm not the brightest.

 

Upcoming in V1.1.0: n -> n resource transfer.

Link to comment
Share on other sites

I have started working on a rebuild of the save parser. Basically, rather than reading in the entire persistent.sfs, it will now use calls to FlightGlobals.Vessels and get the data from there. If successful, it should

  • Reduce the amount of I/O by skipping non-vessels
  • Avoid the same-name ship issue
  • Allow background processing  (because resource adding will be done in the background)
  • Let me basically rebuild the mod, this time in a way I can actually understand

This will make the backbone of V2 of the mod.

 

In other news, V1.1 - which will include n -> n resource transfer - should come out this week, along with the inevitable V1.1.1 to hotfix a bug.

Link to comment
Share on other sites

  • 2 months later...

Not sure if this is the right place for it but I keep getting this error upon trying to launch any vessel.

[WRN 11:02:59.893] File 'C:/KSP (Modded)/KSP_x64_Data/../GameData/BeamedPowerStandalone/Settings.cfg' does not exist
[EXC 11:02:59.896] NullReferenceException: Object reference not set to an instance of an object
    UniversalResourceTransfer.BackgroundProcessing.OnLoadVessel () (at <369aef9a959c42cdaac1db8c82752e18>:0)
    Vessel.Initialize (System.Boolean fromShipAssembly, System.Boolean preCreate, System.Boolean orbiting, System.Boolean setActiveVessel) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    ShipConstruction.AssembleForLaunch (ShipConstruct ship, System.String landedAt, System.String displaylandedAt, System.String flagURL, Game sceneState, VesselCrewManifest crewManifest, System.Boolean fromShipAssembly, System.Boolean setActiveVessel, System.Boolean isLanded, System.Boolean preCreate, Orbit orbit, System.Boolean orbiting, System.Boolean isSplashed) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    ShipConstruction.AssembleForLaunch (ShipConstruct ship, System.String landedAt, System.String displaylandedAt, System.String flagURL, Game sceneState, VesselCrewManifest crewManifest) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    FlightDriver.setStartupNewVessel () (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    (wrapper dynamic-method) FlightDriver.FlightDriver.Start_Patch0(FlightDriver)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Link to comment
Share on other sites

On 11/4/2024 at 12:12 AM, MagicKarpson said:

Not sure if this is the right place for it but I keep getting this error upon trying to launch any vessel.

[WRN 11:02:59.893] File 'C:/KSP (Modded)/KSP_x64_Data/../GameData/BeamedPowerStandalone/Settings.cfg' does not exist
[EXC 11:02:59.896] NullReferenceException: Object reference not set to an instance of an object
    UniversalResourceTransfer.BackgroundProcessing.OnLoadVessel () (at <369aef9a959c42cdaac1db8c82752e18>:0)
    Vessel.Initialize (System.Boolean fromShipAssembly, System.Boolean preCreate, System.Boolean orbiting, System.Boolean setActiveVessel) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    ShipConstruction.AssembleForLaunch (ShipConstruct ship, System.String landedAt, System.String displaylandedAt, System.String flagURL, Game sceneState, VesselCrewManifest crewManifest, System.Boolean fromShipAssembly, System.Boolean setActiveVessel, System.Boolean isLanded, System.Boolean preCreate, Orbit orbit, System.Boolean orbiting, System.Boolean isSplashed) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    ShipConstruction.AssembleForLaunch (ShipConstruct ship, System.String landedAt, System.String displaylandedAt, System.String flagURL, Game sceneState, VesselCrewManifest crewManifest) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    FlightDriver.setStartupNewVessel () (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    (wrapper dynamic-method) FlightDriver.FlightDriver.Start_Patch0(FlightDriver)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Ah, sorry, I'll push  a fix in a few minutes

Link to comment
Share on other sites

On 11/4/2024 at 12:12 AM, MagicKarpson said:

Not sure if this is the right place for it but I keep getting this error upon trying to launch any vessel.

[WRN 11:02:59.893] File 'C:/KSP (Modded)/KSP_x64_Data/../GameData/BeamedPowerStandalone/Settings.cfg' does not exist
[EXC 11:02:59.896] NullReferenceException: Object reference not set to an instance of an object
    UniversalResourceTransfer.BackgroundProcessing.OnLoadVessel () (at <369aef9a959c42cdaac1db8c82752e18>:0)
    Vessel.Initialize (System.Boolean fromShipAssembly, System.Boolean preCreate, System.Boolean orbiting, System.Boolean setActiveVessel) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    ShipConstruction.AssembleForLaunch (ShipConstruct ship, System.String landedAt, System.String displaylandedAt, System.String flagURL, Game sceneState, VesselCrewManifest crewManifest, System.Boolean fromShipAssembly, System.Boolean setActiveVessel, System.Boolean isLanded, System.Boolean preCreate, Orbit orbit, System.Boolean orbiting, System.Boolean isSplashed) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    ShipConstruction.AssembleForLaunch (ShipConstruct ship, System.String landedAt, System.String displaylandedAt, System.String flagURL, Game sceneState, VesselCrewManifest crewManifest) (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    FlightDriver.setStartupNewVessel () (at <a1ca58b5ca7140639de29a81de5e3f32>:0)
    (wrapper dynamic-method) FlightDriver.FlightDriver.Start_Patch0(FlightDriver)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Try it with v1.0.4 now, hopefully fixed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...