Jump to content

[1.8-1.11.x] Beamed Power Standalone (and Propulsion), v1.1.0


Wavelength setting  

46 members have voted

  1. 1. How realistic do you want the wavelength setting

    • Full realism (eg. "Far Ultraviolet")
      10
    • Some realism (eg. "Ultraviolet")
      15
    • Simple (and vague), (eg. "Short"/"Long"), option currently implemented
      19
    • No wavelength mechanic (wavelength preset by the code itself)
      2

This poll is closed to new votes


Recommended Posts

Introduction:

This is an add-on that adds beamed power parts and modules to the stock game. In this case 'beamed power' just means the wireless transfer of electric-charge  between two vessels over a long range. This is achieved by converting the electrical energy into electromagnetic waves (photons) which can travel through a vacuum. These waves are picked up at the other end by a receiver which converts the waves back into electric-charge. The mod also provides engines that can pick up the waves and convert their energy into thermal energy, which can heat the propellant and expel it to produce thrust. This is the idea behind beamed power propulsion.

Some background on this mod's development:

A while back I wanted a standalone version of beamed power in a mod as I was hesitant in using KSP Interstellar extended. I asked on the forums for help on learning KSPIE as I was told it was the only option. Some great people on the forums helped me learn it and I got the hang of it. All this effort was wasted by the fact that I couldn't use it in my existing save file using NFT and FFT. It does work with those mods, but changes gameplay drastically so most of my vessels were useless. 7 months later, I decided to write a plugin myself and this is that.

This is a mod that adds Beamed Power code to the stock game, the plugin is written from scratch, as I wanted to learn how to write plugins in ksp and this was a great learning experience. 4 weeks after the initial release, I also started to learn modelling and texturing in Blender, and now (22nd Sept) the parts I made have reached a state I'm satisfied with, and are now part of the mod. Treat these parts as examples, they aren't perfect yet.

How it works:

There are currently three part modules this adds that you can use for beamed power in the core mod: WirelessSource, WirelessReceiver and WirelessReflector. At the moment, you'll have to add these part modules to any part you want to use for beamed power. Instructions for how to do that:

WirelessSource:

Spoiler

If you want to make a part a beamed power transmitter, you need to add the WirelessSource part module to the part's config file. You can either directly add this to a part's config file, or use a Module Manager patch. It'll looks something like this:


MODULE
{
	name = WirelessSource
	DishDiameter = 10	// in metres, pick a suitable value
	Wavelength = Long	// must be either 'Long'(short microwave) or 'Short'(short ultraviolet)
	Efficiency = 0.8	// value must be in range of 0.0 to 1.0
}

 

WirelessReceiver:

Spoiler

If you want to make a part a beamed power receiver, you need to add the WirelessReceiver part module to the part's config file. You can either directly add this to a part's config file, or use a Module Manager patch. The syntax is shown below.


MODULE
{
	name = WirelessReceiver
	recvType = Directional	// either Spherical or Directional
	recvDiameter = 2.5		// in metres, pick an appropriate value
	recvEfficiency = 0.7	// a value between 0.0 and 1.0
}

The recvType sets what type of receiver this part is. Directional means it can only receive from one source at a time. Spherical receivers receive from all transmitters in the save file, and you don't get to choose which spacecraft to receive from. Spherical receivers can be a little bit cheating, so I would suggest setting a lower efficiency for them than directional receivers.

WirelessReflector:

Spoiler

This is a part module for beamed power reflectors. They are the beamed power equivalent to relay antennas. They take power from a source and reflect to a receiver. They are especially useful when having to deal with planetary occlusion. Some reflectors can amplify power received from transmitter, so the receiver gets more power than usual. The syntax for this part module is shown below:


MODULE
{
	name = WirelessReflector
	Reflectivity = 0.98		// value between 0.0 and 1.0 , think of this as albedo
	ReflectorDiameter = 20	// in m
	
	// optional parameters
	CanAmplify = True
	Efficiency = 0.8	// efficiency of power amplifying
	wavelength = Long	// wavelength of amplifying, this must match the wavelength of beam from transmitter
						// if it doesn't, the reflector will not amplify the power.
}

 

 

Optional Extra Part Modules:

Spoiler

These are part modules for beamed power propulsion. The plan currently is that there will be three optional part modules: PhotonSail, ThermalEngine and AblativeEngine. All three part modules must be applied to a part that is already an engine (it must have a thrustVectorTransform and have ModuleEnginesFX) in order to function. Also set heatProduction on the ModuleEnginesFX to 0, as the mod calculates engine heat using a seperate module. If you don't understand this, or could benefit from an example, the mod now comes with parts for the photon-sail and thermal engine which you can use as examples.

 

PhotonSail:

This is a part module for sails pushed by the photons beamed by transmitters (parts with module WirelessSource). You can simulate something like Breakthrough-Starshot project with this part module applied to a suitable looking part.
 


MODULE
{
	name = PhotonSail
	SurfaceArea = 100  // in m^2
	Reflectivity = 0.95  // value between 0.0 and 1.0, think  of this as albedo
	partThrustMult = 1	// optional parameter, if you think photons sail is producing too little thrust, you can increase this
}

For the ModuleEnginesFX parameters, set maxThrust = 1.0, and vac isp = 30000000.

 

ThermalEngine:

This is a part module for engines which heat their propellant thermally, directly using energy from beamed power.The real life analog of this engine is the Microwave-thermal rocket, or the Laser-thermal rocket, depending on the wavelength used. The syntax for applying this part module is shown below:


MODULE
{
	name = ThermalEngine
	recvDiameter = 3.75
	recvEfficiency = 0.8	// efficiency of built-in thermal receiver
	thermalEfficiency = 0.6  // efficiency of heat-exchanger in moving heat from receiver to propellant
}

A good maxThrust to set for this engine would be 4000 - 6000 kN. A good VacIsp would be 900. If you have CommunityResourcePack and CryoTanks, I'd highly recommend changing the engine's propellant to LqdHydrgen, but keep the fuel ratio at 1.0.

 

AblativeEngine:

This is a part module for engines which get their thrust from a material being ablated off their surface, through the heat from the power beamed to them. In game, the best fuel to use for this engine is the stock Ablator. Syntax shown below:


MODULE
{
	name = AblativeEngine
	SurfaceArea = 14.0		// in m^2
	Efficiency = 0.4		// a value between 0.0 and 1.0
}

The maxThrust I would set for this engine would be 6000 - 8000 kN. A good VacIsp would be 3000. Again, keep the fuel ratio at 1.0.

 

Download (Spacedock or GitHub):

https://spacedock.info/mod/2492/Beamed Power Plugin

https://github.com/AniruddhKSP/KSP-Beamed-Power-Standalone-mod/releases

Source Code (GitHub):

https://github.com/AniruddhKSP/KSP-Beamed-Power-Standalone-mod

 

Unity Project File for parts (Google-Drive):

https://drive.google.com/drive/folders/1ogeYe_x4FzYddjxvFiJeQDCqxE_WgStH?usp=sharing

 

Other Info:

The plugin and all art assets and configs by me (@Aniruddh) are licensed into the Public Domain, do whatever you like with it!

This mod depends on Module Manager! If this isn't installed, other mods can't be supported, and you may also see lots of errors in the log and console.

Currently, the following parts are available in the mod:

    - BP-TE "Unradioactive" Thermal Engine

    - BP-541L "Starshot" Photon-Sail

    - BP-AE "Sublimation" Ablative-Engine

    - BP-T1 "Microwaving" Power Transmitter

Unity project files for the parts are on the google drive link above, I couldn't upload to GitHub due to file number restrictions. I'm sharing this so others can use this without starting from scratch, and some can also provide more detailed feedback on the parts.

Module-Manager patches to add support to existing parts are welcome, if anyone wants to contribute.

I'm completely open to suggestions and feature requests at this stage.

I'd highly recommend using the following mods alongside this one: 

    - CryoTanks

    - Waterfall

    - Near Future Exploration

What this plugin won't do:

- Add full realism, (eg. efficiency curves for adjusting wavelength)

- Add dedicated UI to stock toolbar, the right click menu is good enough.

My current To-do List:

- Parts (currently got transmitter dish and reflector left to do)

- Fix limitation of receivers not distinguishing two transmitters with same name

- Background vessel resource processing

- Kerbal Konstructs power plants and beamed-power transmitters

Differences with KSPIE:

- Receiver doesn't have to point in the right direction towards transmitter, similar to stock CommNet.

- A transmitter can only ever beam in one wavelength. To beam power in a different wavelength, you need a different part.

Possible FAQs:

1) The transmitter/receiver turns off immediately after I turn it on, why is that?

     It is either because the part is beyond its core/skin temperature limits, it is retracted (if it is deployable), or the craft it is on isn't generating enough power/batteries are drained.

2) The ablative engine and photon sail are getting too little thrust / no thrust.

    These two are direction-dependent, make sure the vessel is facing the right way (away from the transmitter). Thrust is scaled based on the angle between the two.

3) The receiver isn't getting any power even though  it says it is receiving from the right vessel.

    Make sure you switch to the transmitter vessel, and cycle through receiver vessels, until 'Transmitting to:' shows the name of the receiving vessel.

4) How to get more wavelength options/ more realistic wavelengths, e.g. Gamma-Rays?

    If you are doing a manual install, first delete the two .dlls in the plugins folder in the main mod directory, then drag the two .dlls in the Extras folder (these have RW at the ends of their names) into the plugins folder in the main directory. Move the main directory (under GameData) into your GameData folder. If installing through CKAN, just select the 'Beamed Power Standalone - Realistic Wavelengths' option, and CKAN should do the rest.

 

Pictures:

Spoiler

Transmitter Dish:

BfFYiz4.png

Photon-Sail:

PEiMJ2L.png

DPunhx6.png

Thermal-Engine:

tQHVXIh.jpg

Ablative-Engine:

Z0n4M3p.png

 

All Screenshots

Thanks for reading this far down the page! Happy launchings, (and landings) :D 

 

Latest Major Version (25th Dec) changes (1.1.0):

  • Updated for 1.11.x
  • Added a silver variant to "Starshot" photon-sail.
  • Fixed a graphical glitch on thermal-engine's mount when highlighted.
  • Added a transmitter dish part (5m).
  • Improved Wireless-Reflector part module, now the on/off toggle button actually works! Fixed Localization issues.
  • Improved performance when using reflectors.
  • Fixed a bug where a reflector could reflect power to itself.
  • Prevented NREs on wireless-reflector when no transmitter is present.

Background resource processing reduces framerates immensely, so I'd recommend not using it for now. There is still the limitation- don't name two transmitter vessels with the exact same name, or the receiver will only detect one of them. This is due to an issue with vessel ids in the game. A workaround is hopefully coming for this limitation.

 

 

Edited by Aniruddh
Link to post
Share on other sites
1 minute ago, Clamp-o-Tron said:

give alternate versions of NFEx parts (best fit for beamed power I think)

That's exactly the parts I was thinking of! Nertea's artstyle is far better than anything I could produce, and NFeX has beautiful part models/textures I did download blender the other day, and the best I could make was yet another cylindrical fuel tank, so yeah.

Link to post
Share on other sites

ziilcyl99xv21.jpg

I mean, I wanted to write this plugin and make models for it. So I could just make models for it. I have to peruse the code a bit, but this looks like 90% of what I wanted from the post, so, yay. 

Edited by Nertea
Link to post
Share on other sites
5 minutes ago, Nertea said:

I have to peruse the code a bit, but this looks like 90% of what I wanted from the post, so, yay. 

I will release another version tomorrow which should hopefully add another 5% to that. ;) 

The idea of this plugin is to not make other modders worry about the code, I have 8 hours a day to spend on this project for the next 2 weeks, so will happily add stuff to it myself.

Link to post
Share on other sites

I was just discussing a very feature-filled part I want to make and release sometime. Beamed Power is among those features. I'm glad this mod is finally happening. I know a couple of folks who would jump for joy to know that this exists.

Link to post
Share on other sites

(Ab)using Commnet to get occlusion data is a good choice :)

KSPIE features a complex dependancy on power efficiency so take care how realistic you want your mod to be.

Directionality is interesting feature, but if you can make it optional for short range transmission networks it would work great for small planetary bases.

How close to KSPIE wavelength dependancy do you plan to make your mod ? If i may suggest, make beam wavelength dependant on emitter and receiver diameter only for simplicity.

Please comment. It is better to resolve this as soon as possible.

 

Ahh also since you published plugin source, please consider moving it to https://github.com/ site so you can recveive bug reports, and patches.

Edited by fatcargo
additional info
Link to post
Share on other sites
1 hour ago, fatcargo said:

KSPIE features a complex dependancy on power efficiency so take care how realistic you want your mod to be.

The only reason efficiency is there is to provide a drawback for using beamed power for the player. 100% efficiency would mean for short distances, it would be perfect and in my opinion, a little bit cheating. I currently am thinking not to add heat mechanics based on efficiency though, so that's where it may differ from KSPIE.

1 hour ago, fatcargo said:

but if you can make it optional for short range transmission networks it would work great for small planetary bases.

Yup, acknowledged, quite easy to do, added this to my to-do list.

1 hour ago, fatcargo said:

If i may suggest, make beam wavelength dependant on emitter and receiver diameter only for simplicity.

My decision will mostly be based on the poll. I understand why you want simplicity, but I think it's rewarding gameplay wise- 'long' wavelength great for short ranges, 'short' wavelengths for long ranges. It makes the user think of compromises and make decisions. I'll add that option to the poll.

1 hour ago, fatcargo said:

Ahh also since you published plugin source, please consider moving it to https://github.com/ site so you can recveive bug reports, and patches.

I was literally going to do that today, google drive is very inconvenient anyways.

EDIT: Added GitHub link for source code.

Edited by Aniruddh
Github link added
Link to post
Share on other sites
51 minutes ago, Aniruddh said:

The only reason efficiency is there is to provide a drawback for using beamed power for the player. 100% efficiency would mean for short distances, it would be perfect and in my opinion, a little bit cheating. I currently am thinking not to add heat mechanics based on efficiency though, so that's where it may differ from KSPIE.

I agree... you need some kind of variable to keep it from being cheaty, and just an "install-the-mod-and-done" type of thing... Need some pros/cons during gameplay, to require users to actually interact with the mod, to make it interesting to use.

Well, if you *do* decide to add any heat mechanics, theres a really nice radiator parts pack, and some code, that might make it easier to incorporate into the mod :D

 

 

Link to post
Share on other sites
3 minutes ago, Stone Blue said:

I agree... you need some kind of variable to keep it from being cheaty, and just an "install-the-mod-and-done" type of thing... Need some pros/cons during gameplay, to require users to actually interact with the mod, to make it interesting to use.

Exactly!

And yup, I use Heat Control myself, whenever I get around to adding heat mechanics I will look at that mod's source. I guess a quarter of the progress minimum I've made is through looking at other modders' work. KSP's API is rather low detail, I believe there was a community made API a while back, but the link to the site no longer works.

Link to post
Share on other sites

@Aniruddh I personally would prefer the heat mechanic to be involved. Radiators are pretty severely underrated in KSP (which helps to keep things easy for newbies), but where appropriate, needing them makes a great balance for a new feature, and gives stations a bit more to be mindful of (and by extension, to have a bit more purpose). And with it involved, beamed power parts can have a heat emissive glow as part of their animations and it would make the most sense. ;) And also, Nertea's parts, if they happen, will also have heat emissives, and can plug into System Heat, his WIP plugin that replaces the stock heat dynamics system. Many of us are lining up to use that when it matures.

What would be convenient for both those who want heat, and those who don't, would be to provide a config level option to scale the heat production. I'm not rushing at all, just laying out my ideas.

Link to post
Share on other sites

Yeah... I just now voted, "Some realism"... I see I am in the majority :P
tho, if I could vote for *two*, my choices would be: some realism, and "simple"...

If possible, make the plugin maybe modular, so it has at least a couple different difficulty settings based on the choices in the poll... have the heat stuff optional.. IIRC, Angel-125 does this well with his WBI suite of mods ;)
I'm a big proponent of modularity and options for users :P

Again, not pushing... just throwing wet gobs of toilet paper at the school bathroom ceiling, to see what sticks... :rofl:

Edited by Stone Blue
Link to post
Share on other sites

Okay I finished the next update, and it is released on GitHub and Spacedock. The update is not as ambitious as I wanted it- I was planning to add the CommNet Occlusion features, but the occluderhorizonculling function makes FlightGlobals.Vessels list return nothing. I don't why it's doing that. Also, I can't figure out how to update invRotation, as said on the API. That feature is delayed for now. Read the end of the OP for changelog and further details.

Link to post
Share on other sites

Beamed power was one of the things that I liked about KSPIE. It reminded me of Scott Manley making huge solar power satellites and beaming power to stations and spacecraft many years ago. I really like how you've made the concept standalone and simplified it to boot! I like your idea of tying into commnet, at least for its tracing algorithms. I'd be curious to know what your results are; I've an idea for using the commnet tracing for something like the Mass Effect relay system.

Are you planning things like microwave-powered jets and rockets? Looking forward to seeing what you come up with! :)

Link to post
Share on other sites
3 minutes ago, Angel-125 said:

Are you planning things like microwave-powered jets and rockets?

The plugin makes the receiver spacecraft generate EC, so I though everyone could just use that EC to power plasma engines in mods like Near Future Propulsion. Whenever I get better at part modelling, I could implement the electricity driven turbo jet idea. The EC could come from the beamed power transmitters. I haven't seen that in any mods so far.

Link to post
Share on other sites
1 hour ago, Aniruddh said:

The plugin makes the receiver spacecraft generate EC, so I though everyone could just use that EC to power plasma engines in mods like Near Future Propulsion. Whenever I get better at part modelling, I could implement the electricity driven turbo jet idea. The EC could come from the beamed power transmitters. I haven't seen that in any mods so far.

Several of the beamed propulsion tech concepts I've seen, uses the beamed energy(microwave or laser) directlyas thermal energy, instead of converting it into electricity

Link to post
Share on other sites
5 minutes ago, GrandProtectorDark said:

Several of the beamed propulsion tech concepts I've seen, uses the beamed energy(microwave or laser) directlyas thermal energy, instead of converting it into electricity

I could add a part module that does that, once I figure out the stock (and system heat) heat mechanics. I could take that value and convert it to thrust and isp Although the math could get complicated, certainly is not impossible to implement. I assume thermally powered engines would get lower isp but higher thrust than electric (ion) engines.

Link to post
Share on other sites
58 minutes ago, Aniruddh said:

I assume thermally powered engines would get lower isp but higher thrust than electric (ion) engines.

https://en.m.wikipedia.org/wiki/Beam-powered_propulsion

https://en.m.wikipedia.org/wiki/Lightcraft

https://en.m.wikipedia.org/wiki/Laser_propulsion

 

I mean the tech I'm talking about could theoretically be used to power Lifter rockets. Not just probes.

Link to post
Share on other sites
1 hour ago, Aniruddh said:

I could add a part module that does that, once I figure out the stock (and system heat) heat mechanics. I could take that value and convert it to thrust and isp Although the math could get complicated, certainly is not impossible to implement. I assume thermally powered engines would get lower isp but higher thrust than electric (ion) engines.

Probably more comparable to NTRs, if I understand the theory right. But instead of lugging around a heavy nuclear reactor as a heat source, all the heat is just beamed in.

Link to post
Share on other sites
11 hours ago, Aniruddh said:

I could add a part module that does that, once I figure out the stock (and system heat) heat mechanics. I could take that value and convert it to thrust and isp Although the math could get complicated, certainly is not impossible to implement. I assume thermally powered engines would get lower isp but higher thrust than electric (ion) engines.

obviously by comparing nerva to dawn lol

but thermal has higher thrust as GPD said

Link to post
Share on other sites

I really wanted to like every post in this thread.  Thank you!

This has amazing possibilities, and one of the issues I also didn't want t deal with KSPIE is the directionality.  So THANKYOU!

I'm going to suggest Kerbalism support in Kerbalism's discord and link here.  Would your module work in the background - i.e. both craft on rails?

Peace.

Link to post
Share on other sites
7 hours ago, theJesuit said:

Would your module work in the background - i.e. both craft on rails?

Sort of : The power beamed and power received are saved to either save file or are in memory, so they are persistent and work in the background. However, eg. if your base has a nuclear reactor, and it runs out of fuel, any receiver will continue receiving power from the base until you switch back to the base. It's a limitation at the moment, but it could be fixed, I and many other modders are looking into it.

Also, does anyone know if CommNet occlusion works if the occluding body is outside the local SOI? I haven't noticed it myself when playing. Looking at SQUAD's implementation of occluder horizon culling, it seems very likely it is limited things in the local SOI, unless there is extra code internally.

Edited by Aniruddh
Link to post
Share on other sites

@Nertea How much work it would be to use the feed/reflector code in this mod ?

Would there be any quality-of-life improvements to justify implementing it into this mod ?

Also, slightly off-topic, could the feed/reflector code be generalized to allow different uses, like for example solar furnaces or concetrated solar ?

Edited by fatcargo
Link to post
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...