Jump to content

[1.1.3] AntennaRange 1.11.4 - Enforce and Encourage Antenna Diversity


toadicus

Recommended Posts

Hey all, just dropping a line to say we'll have a little quality of life update whenever 0.24 drops. It'll include configurability for the LOS "fudge factor", 0.24 compatibility, and basically nothing else! Development is underway on the Big Rewrite, but not done yet.

Link to comment
Share on other sites

The LOS code has a 5% "grace" figure in it to make satellite constellations easier with stock tools. That is, line of sight will be granted when the distance from the center of a body to the line ended by both relays is greater than 95% of the radius of the body. On Mun, that should mean that two vehicles at "zero" level on the surface can contact each other from about 127 km apart, or more if the antennas are raised above the surface. Also, terrain is not considered whatsoever: if one antenna is up on the highlands a few kilometers above "zero" level, you'll get even more distance out of the grace number. Considering terrain is complicated and expensive from a calculations standpoint, and pretty much completely useless for orbiting vessels, so at this point I'm not planning to add such a function.

I will make the grace figure configurable in config.xml in the next release, though, so you can make things tougher on yourself. ;)

I kind of figured terrain couldn't be accounted for with LOS, which is why I was OK with it relaying while I was ~20km from it. A 5% grace doesn't seem like much until you look at it on the map. I'm even farther away now, nearly to the Norther Basin, ~110km away. It looks like I'm almost halfway around the Mun and can still relay through that probe.

Hey all, just dropping a line to say we'll have a little quality of life update whenever 0.24 drops. It'll include configurability for the LOS "fudge factor", 0.24 compatibility, and basically nothing else! Development is underway on the Big Rewrite, but not done yet.

Can I make another suggestion? Can you give Kerbals a short range transmitter (1km or so) so they can relay EVA reports through their ship/lander/rover that they are standing next to? It seems odd that they have to get back in the ship/lander/rover to transmit EVA reports taken from outside.

Link to comment
Share on other sites

I kind of figured terrain couldn't be accounted for with LOS, which is why I was OK with it relaying while I was ~20km from it. A 5% grace doesn't seem like much until you look at it on the map. I'm even farther away now, nearly to the Norther Basin, ~110km away. It looks like I'm almost halfway around the Mun and can still relay through that probe.

Can I make another suggestion? Can you give Kerbals a short range transmitter (1km or so) so they can relay EVA reports through their ship/lander/rover that they are standing next to? It seems odd that they have to get back in the ship/lander/rover to transmit EVA reports taken from outside.

Yeah, the Mun's terrain is also mostly pretty high elevation, which compounds the problem. I'll be interested to hear what feels like a good "fudge factor" to you once you get the new version. :)

To your other suggestion: I think I can do that now. Probably. I'll have to mess around and see if it works as expected. Ordinarily Kerbals don't carry ElectricCharge, so I'd need to give them some of that, too; I should be able to do it in a way that synergizes with TACLS. Probably won't happen before the 0.24 refresh, but who knows!

Link to comment
Share on other sites

AntennaRange has been updated to version 1.4! This version brings 0.24 compatibility and a configurable option for the "fudge factor" used in LOS calculations.

CHANGELOG:


v.1.4 [2014-07-17]
* Updated for KSP 0.24.
* Made the "fudge factor" used in line of sight calculations configurable.

Link to comment
Share on other sites

I just saw the news of .24 release! Will the new version of this mod work in .23.5? I'm going to keep playing the old version until all of my mods get updated and I finish current missions? If nobody replies by the time I get home and play (in just a little bit) I guess I'll find out and edit my post.

Link to comment
Share on other sites

I just saw the news of .24 release! Will the new version of this mod work in .23.5? I'm going to keep playing the old version until all of my mods get updated and I finish current missions? If nobody replies by the time I get home and play (in just a little bit) I guess I'll find out and edit my post.

I'm going to guess it will, but I can't guarantee it. Try it and find out! If not, let me know; there might be something I can do to help out. Also, you can always redownload the old version (http://ksp.hawkbats.com/AntennaRange/AntennaRange-1-3.zip).

EDIT: I've got a stock toolbar button working nicely. Now I just need my artist to get back and make a higher resolution icon so I can give you something that doesn't look awful forever. :)

Edited by toadicus
Added info about the stock toolbar
Link to comment
Share on other sites

I didn't try the new version on .23.5. I decided to just stick with .23.5 with everything the way it is until all the mods I'm using get updated to .24. I have a few things I want to finish in my current career before starting over in .24 too.

When there are multiple antennas on, how does the mod chose which one to use? Tonight I finished up my Mun rover mission, and it returned to the orbital science station. The station itself has a Communitron 16 and a DTS-M1, the transfer ship has a DTS-M1, the rover has a Communitron 16, and there is an emergency rescue lander with another Communitron 16. After the rover docked with the station, I transmitted some science back to Kerbin, and for some odd reason it used one of the Communitron 16's and relayed it through a probe on the surface. I'm assuming it used a Communitron because I could see both dishes and neither one animated. Kerbin was directly overhead, so why didn't it just use one of the DTS-M1 dishes to transmit directly back to Kerbin? Earlier when I docked the rover after shipping it from Kerbin, when I transmitted some science back and it used the DTS-M1 on the crew ship.

Link to comment
Share on other sites

Does this mod add anything significant if one already has Remote Tech?
Not really  it's a much less intrusive alternative to RT2.

As ModZero suggests, this is more like "RT2Lite" at this point. If you already have RT2, AntennaRange may: a) not function correctly; B) not function at all; or c) break RT2, so in general it's a one-or-the-other option.

EDIT: Here's a quote from a few pages back where I go over what I think are the primary differences.

Honestly I've never used RemoteTech so I have no idea what the differences are. :P But, based on what I think I've gleaned about RemoteTech from watching Scott Manley's videos, here are some guesses:

AntennaRange...

  • does not have any time delay or any facility for programming future actions.
  • does not have additive ranges; everything is transmitter-side (so if you have a whip antenna out at Jool, it can't phone home even if there is a big dish around Kerbin).
  • does not require antennae to target other antennae and does not have any limit to the number of relays that can be "connected" at any time. not a difference per JeffreyCor
  • does not have those cool lines that show you which relays are connected to each other.
  • does not maintain a persistent model of the relay network; everything is calculated dynamically as contact is required (or every few seconds, when probe connectivity is enabled and you're flying a probe).
  • allows line-of-sight and connectivity requirements to be disabled.

EDIT:

I didn't try the new version on .23.5. I decided to just stick with .23.5 with everything the way it is until all the mods I'm using get updated to .24. I have a few things I want to finish in my current career before starting over in .24 too.

When there are multiple antennas on, how does the mod chose which one to use? Tonight I finished up my Mun rover mission, and it returned to the orbital science station. The station itself has a Communitron 16 and a DTS-M1, the transfer ship has a DTS-M1, the rover has a Communitron 16, and there is an emergency rescue lander with another Communitron 16. After the rover docked with the station, I transmitted some science back to Kerbin, and for some odd reason it used one of the Communitron 16's and relayed it through a probe on the surface. I'm assuming it used a Communitron because I could see both dishes and neither one animated. Kerbin was directly overhead, so why didn't it just use one of the DTS-M1 dishes to transmit directly back to Kerbin? Earlier when I docked the rover after shipping it from Kerbin, when I transmitted some science back and it used the DTS-M1 on the crew ship.

So, I don't have a super clear picture of exactly what the setup was, but here's the facts. When transmitting from an experiment dialog, Squad's code uses a utility function called GetTransmitterScore to determine the "most efficient" antenna to use. Squad's method of determining that is... pretty suspect, at any rate... so I've helped it out a little bit. Here's my rationale, straight out of the code comments:


/*
* The next two functions overwrite the behavior of the stock functions and do not perform equivalently, except
* in that they both return floats. Here's some quick justification:
*
* The stock implementation of GetTransmitterScore (which I cannot override) is:
* Score = (1 + DataResourceCost) / DataRate
*
* The stock DataRate and DataResourceCost are:
* DataRate = packetSize / packetInterval (units in "bytes" per second)
* DataResourceCost = packetResourceCost / packetSize (units in Charge per "byte")
*
* So, the resulting score is essentially in terms of joules per byte per baud. Rearranging that a bit, it
* could also look like joule-seconds per byte per byte, or newton-meter-seconds per byte per byte. Either way,
* that metric is not a very reasonable one.
*
* Two metrics that might make more sense are joules per byte or watts per baud. Since both of those metrics
* are closely coupled in Squad's model, they wind up exactly the same once you cancel things out:
*
* DataRate = packetSize
* DataResourceCost = packetResourceCost
*
* So... hopefully that doesn't screw with anything else.
* */

Put concisely, with AntennaRange installed, Squad's code picks antennas based on the most efficient transmission in terms of ElectricCharge per MiT. Then, since Squad's antennas are balanced strangely, the Communotron 16 will always win when all three antennas are performing at their best.


Packet Size Packet Cost Score
Communotron 16 8 10 1.375
DTS-M1 8 12.5 1.6875
Communotron 88-88 8 20 2.625

Lowest score wins.

Now, to your circumstance. From what I can glean from your description, it sounds like you've got two ships / satellites in Munar orbit and a rover on the Munar surface. When you transmit from one of the ships in Munar orbit, it uses the rover to phone home. This is probably because all three vessels are within optimal range for all three antennas, and the rover is closer to the orbital station than the other orbital vessel. If I'm misunderstanding your setup, please let me know. A ship shouldn't be able to use itself as a future relay (that is, the orbital station can't transmit through the rover unless the rover has another route back to Kerbin, e.g. another orbital vessel), and if that's happening it's a bug.

Edited by toadicus
Added response to NJC2
Link to comment
Share on other sites

Now, to your circumstance. From what I can glean from your description, it sounds like you've got two ships / satellites in Munar orbit and a rover on the Munar surface. When you transmit from one of the ships in Munar orbit, it uses the rover to phone home. This is probably because all three vessels are within optimal range for all three antennas, and the rover is closer to the orbital station than the other orbital vessel. If I'm misunderstanding your setup, please let me know. A ship shouldn't be able to use itself as a future relay (that is, the orbital station can't transmit through the rover unless the rover has another route back to Kerbin, e.g. another orbital vessel), and if that's happening it's a bug.

I have a science station in orbit around the Mun. I have a rover/lander that goes down, gets samples and returns to dock with the station, so I can clean the experiments and go back for more. Also docked to the station is the ship that brought the crew and a rescue lander in case I crash the rover and need to rescue the Kerbal. Each ship has its own antenna(s). The station itself has a DTS-M1 and Communitron 16, the rescue lander has a Communitron 16, the crew ship has a DTS-M1 and the rover has a Communitron 16. A screen shot might help see the setup. Also there are various unmanned probes scattered on the surface with DTS-M1 dishes.

After I had returned the rover and docked to the station. When I transmitted some stuff to Kerbin, I didn't see the DTS-M1 fold out and the message said it was relaying through one of the probes on the surface. I just thought that was a bit odd since Kerbin was directly overhead and earlier before I sent the rover down I did some EVA reports and transmitted them and it used the DTS-M1 on the crew ship to transmit those.

Link to comment
Share on other sites

Put concisely, with AntennaRange installed, Squad's code picks antennas based on the most efficient transmission in terms of ElectricCharge per MiT.

That actually really interesting, I've always wondered that. As I also have Science Revisited installed, it's interesting to see what combinations of antennas are used.

For reference, SR does this:

// Rebalanced the antenna in weight, interval and resource costs
@PART[longAntenna]
{
@MODULE[ModuleDataTransmitter]
{
@packetInterval = 0.8
}
}

@PART[mediumDishAntenna]
{
@mass = 0.025

@MODULE[ModuleDataTransmitter]
{
@packetInterval = 0.4
@packetResourceCost = 20.0
}
}

@PART[commDish]
{
@mass = 0.05

@MODULE[ModuleDataTransmitter]
{
@packetInterval = 0.2
@packetResourceCost = 40.0
}
}

Link to comment
Share on other sites

I have a science station in orbit around the Mun. I have a rover/lander that goes down, gets samples and returns to dock with the station, so I can clean the experiments and go back for more. Also docked to the station is the ship that brought the crew and a rescue lander in case I crash the rover and need to rescue the Kerbal. Each ship has its own antenna(s). The station itself has a DTS-M1 and Communitron 16, the rescue lander has a Communitron 16, the crew ship has a DTS-M1 and the rover has a Communitron 16. A screen shot might help see the setup. Also there are various unmanned probes scattered on the surface with DTS-M1 dishes.

After I had returned the rover and docked to the station. When I transmitted some stuff to Kerbin, I didn't see the DTS-M1 fold out and the message said it was relaying through one of the probes on the surface. I just thought that was a bit odd since Kerbin was directly overhead and earlier before I sent the rover down I did some EVA reports and transmitted them and it used the DTS-M1 on the crew ship to transmit those.

So, I tried a quick test to duplicate what I think you're saying. I didn't build a whole station, so it's not entirely fair:

arRelayTest0.png

I accidentally put a Communotron 88-88 on the lander, so I parked it on the dark side of the Mun to make sure it couldn't phone home without the relay sat. In this circumstance, the satellite's Communotron 16 does not function, and its 88-88 phones back to Kerbin directly.

EDIT: It just occured to me in looking at these images that you can't tell from the image above that the second satellite shown below isn't also in orbit already. So, for the record: it's not. :)

So, then I put together the condition I mentioned to you before:

arRelayTest1.png

The two sats are 120° separated; both in view of the lander. Each sat will use the lander as a relay, because it's more efficient to send data there with the 16 than to use the 88-88. The eventual costs of relaying the data two more times aren't modeled at all at this point.

In the Big AR2 Rewrite I'm working on, I think this sort of behaviour will be less common. That is, it should hopefully only happen when it's actually a better route.

If you only had one vessel in orbit, and the rescue lander didn't have any long range antennas, it shouldn't have been available as a relay. But, it's possible that I missed an event and when you docked things on orbit, one of them got left in the cache as an un-docked vessel and used. Docking is weird.

Pretty intresting idea for a mod, I can certainly see why people would like it. By the way toadicus, if your iffy about using curseforge you could always try http://beta.kerbalstuff.com/ this place instead.

I'm planning to use KerbalStuff Soonâ„¢. There are a couple of API pieces I'm hoping for / waiting patiently for that would really streamline my process. For now, I have a few terabytes of bandwidth with nothing else to do; may as well host my KSP mods. ;)

That actually really interesting, I've always wondered that. As I also have Science Revisited installed, it's interesting to see what combinations of antennas are used.

For reference, SR does this:

// Rebalanced the antenna in weight, interval and resource costs
@PART[longAntenna]
{
@MODULE[ModuleDataTransmitter]
{
@packetInterval = 0.8
}
}

@PART[mediumDishAntenna]
{
@mass = 0.025

@MODULE[ModuleDataTransmitter]
{
@packetInterval = 0.4
@packetResourceCost = 20.0
}
}

@PART[commDish]
{
@mass = 0.05

@MODULE[ModuleDataTransmitter]
{
@packetInterval = 0.2
@packetResourceCost = 40.0
}
}

IMO, that actually makes the situation worse. In real life, a more-directive antenna should generally cost less power to get the same bandwidth, or put differently, should get better bandwidth for the same power. Were I to rebalance the antennas using Squad's current system, I'd put all the power usages the same and increase the packet sizes for the dishes, so that they could be superior choices even once in a while. In AR, and AR+SR, they don't become superior choices until the next best choice gets out past optimal range and starts losing efficiency.

Link to comment
Share on other sites

Would there be away to set a dish to have line of sight but a Antenna have the fudge factor ?

EDIT- Maybe 2 MODULE 1 for dishes and 1 for antenna's

I could easily add a "fudge factor" field for dishes and antennas, but it would not be easy for me to make it tweakable because of the way AntennaRange deals with unloaded vessels, so any changes would require a change to the cfg files. That could exist in addition to or in place of the global "fudge factor" (probably the former).

Link to comment
Share on other sites

I just installed this mod and tried it out, thanks.

With the Communotron 16, I wasn't able to get a signal through to KSC from a 75km orbit. It did work from the ground, however. Is there something I need to configure or do to make it work from orbit? It's also possible that I damaged the antenna during launch, but it had a status of "Locked" and it extended and retracted.

Thanks again for providing this, and thanks for any help.

Link to comment
Share on other sites

Does this mod work with other mods that have antennas?

Yep, here:

Here is a cfg to add AntennaRange to this list of parts with RT2 you need to zip up or delete the plugin folder and the cfg's here is a list of some of the mods it covers but, I do think, I need to cut the range on them, I just haven't got around to doing it.

RemoteTech2

Squad

Hyomoto Aerospace

Dmagic

DongFangHong

FASA By Frizzank & APOLLO By DennyTX

NovaPunch

Telemachus

Lionhead

AIES

LLL-Lite

https://www.dropbox.com/s/xv2153q8ybfl1s6/AntennaRange2.cfg

Link to comment
Share on other sites

I just installed this mod and tried it out, thanks.

With the Communotron 16, I wasn't able to get a signal through to KSC from a 75km orbit. It did work from the ground, however. Is there something I need to configure or do to make it work from orbit? It's also possible that I damaged the antenna during launch, but it had a status of "Locked" and it extended and retracted.

Thanks again for providing this, and thanks for any help.

You should definitely be able to get a connection from anywhere in low Kerbin orbit with the Ctron 16; if you're not then something's afoot. Do you have a debug log (Windows: \path\to\KSP_win\KSP_Data\output_log.txt; Linux: ~/.config/unity3d/Squad/Kerbal\ Space\ Program/Player.log; Mac: ~/Library/Logs/Unity/Player.log) I could look at to see if I can tell what's going wrong?

One thing worth doing up front would be to upgrade to ModuleManager 2.2. I updated AntennaRange because MM 2.2 came out; no idea is 2.2 fixes anything in particular, but it's a good idea anyway.

Link to comment
Share on other sites

Is there anything that would slow down the antenna extending animation? If I extend the antenna manually by right clicking on it, it's fine and takes about 3.5 seconds. If I transmit data and the antenna extends automatically, it takes about 10 seconds. FRAPS is saying I'm getting a solid 40 odd FPS with both situations, the MET colour stays green.. :/

Edited by ObsessedWithKSP
Link to comment
Share on other sites

Is there anything that would slow down the antenna extending animation? If I extend the antenna manually by right clicking on it, it's fine and takes about 3.5 seconds. If I transmit data and the antenna extends automatically, it takes about 10 seconds. FARSP is saying I'm getting a solid 40 odd FPS with both situations, the MET colour stays green.. :/

I don't change anything to do with the animations. I tried that once and it ended poorly. ;) What I do know is this:

The antenna animations works two different ways. First, they can be toggle directly using ModuleAnimateGeneric's Start/Stop/Toggle methods. Second, they can be moved to specific points along the animation using IScalar methods. When I looked in to tweaking them for TE, the Extend/Retract events called ModuleAnimateGeneric's methods, which just says "go" and then the animation plays at 1× speed. The "transmit" methods in ModuleDataTransmitter, however, actually move the antenna frame-by-frame using the IScalar methods rather than letting it move itself. Why? I have no idea. But they do. So, my guess is that Squad moved ModuleDataTransmitter actions from Update to FixedUpdate, or changed the Coroutine delay to depend on the physics frame time, or similar, and didn't rebalance the distance that the antenna moves per frame.

That's a guess, but it's all I've got. Does the speed of the animation change at all if you timewarp after clicking transmit? If so, I'm probably pretty close.

Edited by toadicus
Link to comment
Share on other sites

That's a guess, but it's all I've got. Does the speed of the animation change at all if you timewarp after clicking transmit? If so, I'm probably pretty close.

After a quickload, things seemed to work fine. Guess it was just a one-off then.. still, glad to know that AR isn't responsible but if it happens again, I'll do some experimenting.. for SCIENCE!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...