Jump to content

[Released][1.3.1] Antenna Helper [v0.90] (27 Feb 2018)


Li0n

Recommended Posts

Hi @Li0n - had a thought on the range circle alignment and was wondering if it might help orientation. Would it be possible to take whatever you need to draw the circles around (ship/craft, planet/DSN) and traverse the objects parent tree until you get to a celestial body. Would it be possible to use the relative reference of that parent object to it's transform Left & Fwd (X & Z) axis's to set the circles orientation? That way they'd all be on the same relative plane. This would still allow things at different heights as you'd still be using the actual objects Y axis height to place the range circle around it's centre? (This kind assumes that all celestial bodies fwd & left axis are on one plane, but at differing heights depending on if the orbit is inclined or not.)

If they aren't all aligned, could you use the Suns left/right axis to get a single plane for all circles and still use the object Y height to keep it around that object. That could either be an absolute reference with referencing the Sun object directly, or a relative reference by going up the parenting tree until you get the Sun. I may be waaay off on this one as I haven't checked and assumed you'd eventually get a relative reference with something like: craft is child of/orbits moon, which is child of/orbits a planet, which is child of/obits the Sun.

Edited by wile1411
Link to comment
Share on other sites

@wile1411 I'm not 100% sure I correctly understand everything you wrote, if I don't please correct me.

10 hours ago, wile1411 said:

Would it be possible to take whatever you need to draw the circles around (ship/craft, planet/DSN) and traverse the objects parent tree until you get to a celestial body. Would it be possible to use the relative reference of that parent object to it's transform Left & Fwd (X & Z) axis's to set the circles orientation? That way they'd all be on the same relative plane. This would still allow things at different heights as you'd still be using the actual objects Y axis height to place the range circle around it's centre?

So in a plugin/code point of view it will look like :

For the example assume the active vessel orbit the DSN planet

  1. Set the circle position at the planet position
  2. Set the circle y position so it match vessel y position
  3. Set the circle rotation so it match the planet rotation
11 hours ago, wile1411 said:

(This kind assumes that all celestial bodies fwd & left axis are on one plane, but at differing heights depending on if the orbit is inclined or not.)

If they aren't all aligned, could you use the Suns left/right axis to get a single plane for all circles and still use the object Y height to keep it around that object. That could either be an absolute reference with referencing the Sun object directly, or a relative reference by going up the parenting tree until you get the Sun. I may be waaay off on this one as I haven't checked and assumed you'd eventually get a relative reference with something like: craft is child of/orbits moon, which is child of/orbits a planet, which is child of/obits the Sun.

I think the fwd & left axis of celestial bodies are aligned with their orbital plane. Using the sun orbital plane as reference is best I think, yes there is reference to the orbited body in the vessel class.

The only concern I got is that it will not look good if the vessel has a high polar orbit and the camera is not in "top down view" (relative to the circle) : the circle will appear above or beneath the DSN / relay. Kind of a edge case tho.

So, good idea, thanks.

On a side note, I've tried to align the circles to the orbital plane of the active vessel, it was some times ago and I'm not sure I succeeded but I remember I didn't push further because I was worried that under certain circumstances the DSN/relay wouldn't be in the circle, same concern with your method. But if I can add the two method it will be likely that most case will be covered by one or the other.

I'm currently working on a new function for Crew Light, it should be finish soon (tm), I'll try to add those method after.

Link to comment
Share on other sites

@wile1411 I've tried your way but it won't work, here is how it look with a circular polar orbit around Kerbin : 56qgz3h.png

Fine above the equateur but above the pole : k916Ojp.png

The signal strength is the same, the orbit being circular, but the circle indicate that the signal should be above 75%.

I don't think there is a way to draw the circle accurately if one end of the signal is not on the circle plane...

I'll try to aligned the circle to the orbit, but it will work only for a vessel orbiting the DSN (Kerbin). In the meantime if you want to play with the version this screenshot came from, I've also add the fix discussed on your thread about layers.

Link to comment
Share on other sites

Version 0.12 is up, on Github !

Quote

**Map view update :**
* circle now align with the orbit plan, only for the DSN's circle and when the transmitter orbit the DSN's celestial body
* fix for circle disappearing when zooming out, some downside : circles are now draw on top of the scaled space scenery (the planet/moon you see when zooming close, not the icon you see from afar) and the circles now experience culling mask issue
* active vessel antenna power (that is used for range calculation) is now updated when the active vessel gets modified (staging / crashing / docking / crashing / etc)
* only the deployed antennas are now used to compute the active vessel power
* re-compute active vessel antenna power when antenna are extended / retracted
* circles are now two times more transparent

** General update :**
* new icon :D made by myself with assets from FlatIcon by Freepik.

Probably the most awaited feature : yFonlr0.gif

Link to comment
Share on other sites

3 minutes ago, linuxgurugamer said:

@Li0n

Would you consider this mature enough for CKAN?

Nope.

There is two more thing I want to add : range display in the tracking station and detailed numbers in flight. Once that done it will be just polishing, and ready for spacedock and CKAN.

Link to comment
Share on other sites

Version 0.13 is up, on Github !

Quote

**General Update :**
* support for Custom Barn Kit by sarbian (and hopefully every mod that include it)
* the antenna range modifier and dsn range modifier are now correctly accounted for when loading a different save

**Map view Update :**
* workaround for the culling issue on circles added by last version : circles are now render on different layer according to their distance to the camera. As a result they look a little different on close zoom and on far away zoom. When zooming out the orbit line and the celestial body's scenery are draw behind the circles.

@Gooner, or anyone using RSS, this update should make Antenna Helper RSS friendly but I haven't directly tested it, I've messed around with Custom Barn Kit (on which RSS depend) so I'm pretty sure it's good to go. So if you find any error in the calculation please report them.

Link to comment
Share on other sites

On 2/7/2017 at 5:54 PM, Li0n said:
  • in the editor, add all the in-flight relay to the list of target.
  • in the editor, add relay antennas (part) to the list of target.

Looks like a very lovely mod! I will try it out as soon as I can or as soon as I begin to feel the need for it in my current career. The two items mentioned in the to do list in the OP are of extra special interest to me as I am running a career with reduced DSN strength and gameplay based on relay networks, my settings are based on the wonderful Stock Antenna Balance mod by @WuphonsReach

Link to comment
Share on other sites

2 hours ago, canisin said:

Looks like a very lovely mod! I will try it out as soon as I can or as soon as I begin to feel the need for it in my current career. The two items mentioned in the to do list in the OP are of extra special interest to me as I am running a career with reduced DSN strength and gameplay based on relay networks, my settings are based on the wonderful Stock Antenna Balance mod by @WuphonsReach

Thanks.

Didn't know this mod, I've take a quick look at its source code and everything should work with Antenna Helper. Have fun.

Link to comment
Share on other sites

2 hours ago, Li0n said:

Thanks.

Didn't know this mod, I've take a quick look at its source code and everything should work with Antenna Helper. Have fun.

Yea everything should work as far as i can tell, too. It's just that I am more interested in ranges to relays rather than ranges to the KSC's DSN. So those two items on your to-do list are of extra interest to me :)

Link to comment
Share on other sites

Version 0.14 is up, on Github !

Quote

**Tracking Station**
* **NEW** : add graphical display (circles ;)) of the antenna range to the Tracking Station. Work for every launched ship unless the ship is marked as "Debris"

**Map View Update :**
* fix the inner circle not being computed correctly for relay connection

Here it is : range circle in the Tracking Station :D

mtVllxY.png

Unfortunately the bug of the circle disappearing when the camera move away is present in the Tracking Station, and my workaround for the Map View don't work there.

The window isn't clamped to the toolbar button the way it does in the map view. Why getting the button position is so complicated ??

For the next release I'll try to add a list of all the ship stored in the VAB/SPH to the Tracking Station. This ,IMO, will be the most valuable feature, you'll see with a glance how far you can get without launching any ship :)

Happy crashing

Link to comment
Share on other sites

7 hours ago, linuxgurugamer said:

Enhancement suggestion:

Have a way to simulate an antenna at an arbitrary location.  To keep it simple, the arbitrary location would have to be either an existing vessel or planetary body.

Good idea, it will make designing relay easier. For the arbitrary location I think I can manage something better than an existing vessel or celestial body, should be doable to pick any place on the sun orbit plan with a raycast from the mouse position.

Simulate an antenna isn't enough, it needs a GUI with the ability to choose which and how many antenna to simulate. It has already been suggested that I add something like this for the editor.

Thanks for the suggestion @linuxgurugamer I'll add it to the to-do list.

 

Currently I'm on a feature to show a list of vessel saved in the VAB/SPH, but not launched, in the tracking station. It's almost done, it's working but I need to rewrote most of my previous Tracking Station related code as it was designed to work with object of the Vessel class but ship saved in the editor don't work the same way.

Next will probably be the gui to select antenna(s) part as target. For the editor at first, the dummy antenna in the tracking station will need more work. Sooner than later I'll also add support to Blizzy/linuxgurugamer toolbar, thanks to Toolbar Control.

Link to comment
Share on other sites

It's a really great mod, but for me, doesn't do anything if I can't see what happens when a vessel gets to the destination.  I know I can always hyperedit a vessel there, but that's a real pain.

4 hours ago, Li0n said:

Sooner than later I'll also add support to Blizzy/linuxgurugamer toolbar, thanks to Toolbar Control.

Yay!

Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

It's a really great mod, but for me, doesn't do anything if I can't see what happens when a vessel gets to the destination.  I know I can always hyperedit a vessel there, but that's a real pain.

Not 100% sure I understand correctly.

By what happens when a vessel gets to the destination I guess you mean does the vessel gets an active connection and if so how much signal strength ?

At the moment you can know it in the editor : in the main window the color bar indicate the signal strength / distance. In the "signal per planet" window you'll see the signal to expect when orbiting the different planet. (For now) those are compute only for a direct connection to the DSN. And you need to know how far (in meter) you want to go. But :

In the tracking station / map view : once your ship is launched (or temporary placed on the launchpad) you can open the map view/ tracking station, select "relay + dsn" in the gui and you'll have a visual display of where you can go with how much signal strength.

So that's already in the mod.

The suggestion you made earlier will be useful when the place you want to go isn't covered by CommNet, so you need a relay. It will help choose which antenna go on the relay. Here is how I see it working :

  1.  you build a probe to Moho, put on it as much antenna as possible
  2. you save your probe inside Antenna Helper editor ship list (that will be in the next version)
  3. you go to the tracking station, select your probe as a transmitter from Antenna Helper editor ship list (again, in the next version)
  4. at this point you realize CommNet don't cover Moho, or the signal strength to expect is to low
  5. A relay is needed
  6. Click the "make a dummy relay" button (that's your feature)
  7. Click anywhere on the map view to place the dummy relay at this position
  8. A new window will have appear to choose which relay antenna will go on the dummy relay
  9. Add relay antenna until you see enough range / signal strength to your liking
  10. Go build a relay with the antenna you selected before
  11. ...
  12. Profit !

That was a big explanation but it will serve me when I add this function to Antenna Helper. Tell me if that cover your need or if I (still) haven't get what you meant.

Link to comment
Share on other sites

Version 0.15 is up, on Github !

Quote

**Editor Update**
* All the in-flight vessel can be selected as a target, works only for vessel with relay capability tho.
* Editor ship can be saved internally by Antenna Helper to be used as a target

**Tracking Station Update**
* Editor ships can be selected as the active transmitter, they need to be saved in the editor with Antenna Helper GUI first
* complete rewrote of the tracking station bug, because of the workaround of what I think is a stock bug the camera may flicker when the Tracking Station start

**Update of the README (with picx :D)**

It take my longer to expected due to what I think is a stock bug. I got a workaround for it and as far as I have tested it it stands. But if you see any circle with the wrong scale/color in the tracking station please report it. The flight/map view scene shouldn't be affected and the tracking station not always so not easy to nailed it down.

Enjoy :)

Link to comment
Share on other sites

On 1/16/2018 at 2:47 AM, Li0n said:

Good idea, it will make designing relay easier. For the arbitrary location I think I can manage something better than an existing vessel or celestial body, should be doable to pick any place on the sun orbit plan with a raycast from the mouse position.

Simulate an antenna isn't enough, it needs a GUI with the ability to choose which and how many antenna to simulate. It has already been suggested that I add something like this for the editor.

Thanks for the suggestion @linuxgurugamer I'll add it to the to-do list.

 

Currently I'm on a feature to show a list of vessel saved in the VAB/SPH, but not launched, in the tracking station. It's almost done, it's working but I need to rewrote most of my previous Tracking Station related code as it was designed to work with object of the Vessel class but ship saved in the editor don't work the same way.

Next will probably be the gui to select antenna(s) part as target. For the editor at first, the dummy antenna in the tracking station will need more work. Sooner than later I'll also add support to Blizzy/linuxgurugamer toolbar, thanks to Toolbar Control.

Let me know if you need any help with the Toolbar Controller

Link to comment
Share on other sites

Hi @Li0n I've been brushing up on my Trig for some charting I'm doing at work and during some idle time, I've thought up a few ideas for this mod in case you're looking for expansions :)

These are just suggestions, so nix them all if you don't feel like they'd fit for the mod.

Suggestion 1) Change the location of the DSN from the center of Kerbin to the KSC. This will make it appear off center from Kerbin.  I haven't tested this property, but I think the transform for the KSC is here: CommNet.CommNetHome.nodeTransform 
(I almost suggested adding the other ground stations, but that might end up looking messy with circles at difference heights over the globe.)

Suggestion 2) investigate adding half circles to the full circles you currently use so as allow drawing of arcs with the orbited planets occluding the signal.
 - Way to do that would if current antenna range is less than the orbit altitude, use the full circle as it wouldn't clip the planet. 
 - If the antenna range is greater than the orbit altitude, then have a 1/2 disc still set to be centered around craft/DSN, but perpendicular to the surface
        then add two other 1/2 discs either side of the first and rotate these extra 1/2 circles so they are at the angle that result in a tangent line with the planet. 

This would result with the 3 half circles overlapping, but with a pie slice missing where the planet would be to represent the signal occlusion.
Caveat: The idea would only work to give a pie shaped gaps in the circles for the nearest planet and wouldn't create gaps for moons or other planets

Little pic to help explain: 

AEhOveI.png

Calculating the a) angle to rotate the 1/2 discs so it's tangent to planet.

r = radius of planet
a = altitude of craft / DNS above planet
d = r + a 							//distance of craft / DNS from center of planet
L = sqrt(d^2 - r^2)         				        //length of hyponenuse of tanget line
h = L * r / d							//height of right angle triangle
a-Angle (in radians) = 90 - asin(h / L) 	    		// Angle is inverse sin of h/L
a-Angle (in degrees) = 90 - asin(h / L) * (180/Pi)

 

Edited by wile1411
Link to comment
Share on other sites

1 hour ago, wile1411 said:

Suggestion 1) Change the location of the DSN from the center of Kerbin to the KSC. This will make it appear off center from Kerbin.

Not much really, as most antenna power/range is way bigger than Kerbin radius.

1 hour ago, wile1411 said:

(I almost suggested adding the other ground stations, but that might end up looking messy with circles at difference heights over the globe.)

Only one circle (one ground station) will be display at a time, the problem is that I can't align the circle with the orbital plan in this case (as opposed to the circle center at the planet center).

Currently the circles draw around the DSN has its center at the DSN's planet center but is up-scaled to account for the planet radius.

There will be a benefit from drawing the circle at the DSN's antenna location if I can occlude some portion of the circle, I think that will make playing with the ground station turned off way more enjoyable. Which leads to :

1 hour ago, wile1411 said:

Suggestion 2) investigate adding half circles to the full circles you currently use so as allow drawing of arcs with the orbited planets occluding the signal.
 - Way to do that would if current antenna range is less than the orbit altitude, use the full circle as it wouldn't clip the planet. 
 - If the antenna range is greater than the orbit altitude, then have a 1/2 disc still set to be centered around craft/DSN, but perpendicular to the surface
        then add two other 1/2 discs either side of the first and rotate these extra 1/2 circles so they are at the angle that result in a tangent line with the planet. 

This would result with the 3 half circles overlapping, but with a pie slice missing where the planet would be to represent the signal occlusion.
Caveat: The idea would only work to give a pie shaped gaps in the circles for the nearest planet and wouldn't create gaps for moons or other planets

Never thought about the half circle method, good one. I've already give some thought about occlusion but was set on finding a way to cut the 3D mesh to represent occlusion. You method seem way easier :)

My first thought about occlusion was that the math will be a nightmare, so thanks for the formula :) Re-thinking about it, it may be easier/better for unity speed, to find the angle using a raycast.

The seam between the half circle (opposed to the occlusion seam) will be visible, the same way the relay and dsn circle are visible when they overlap. That may be resolvable if I find the right shader for the job.

This made me remember of something I wanted to add a while ago : a representation of  the range at all time, not only at this instant. I've made an illustration for it back then :

9i3bQ8s.png

The little circle represent the range now, the donnut represent all the possible connection range as the relay move on its orbit.

I think it will work nicely with the occlusion, showing that it's only temporary.

 

Thanks for the suggestions, the occlusion stuff is something I think of since the start but wasn't sure on how to do it. I'll add it to the to-do list. Don't expect it any time soon tho...

For the ground station/KSC stuff, I think it's pointless without the occlusion system so maybe, one day...

Anyway thanks and keep the suggestion coming :)

Edited by Li0n
Link to comment
Share on other sites

5 minutes ago, Li0n said:

Not much really, as most antenna power/range is way bigger than Kerbin radius.

Only one circle (one ground station) will be display at a time, the problem is that I can't align the circle with the orbital plan in this case (as opposed to the circle center at the planet center).

Currently the circles draw around the DSN has its center at the DSN's planet center but is up-scaled to account for the planet radius.

There will be a benefit from drawing the circle at the DSN's antenna location if I can occlude some portion of the circle, I think that will make playing with the ground station turned off way more enjoyable.

Yeah - I figured if you did do the ground station it might be done via being dynamic with a quick raytrace to find the nearest to the vessel you currently in map mode from, then use that DSN station transform to be the DNS in your map menu.

I'll give the orbital plan problem a crack so see what comes up. I've been playing with setting a procedural primitive to stick out from the planet surface. I'll see if I can get the cone I was using to be over the KSC and keep it perpendicular. 

10 minutes ago, Li0n said:

Never thought about the half circle method, good one. I've already give some thought about occlusion but was set on finding a way to cut the 3D mesh to represent occlusion. You method seem way easier :)

Yeah - I'd thought of something similar but couldn't work out how to do a dynamic mesh to poke additional holes when something was in the way. If only you could turn a raycast into a something visible, then the game would put those gaps in fine.

13 minutes ago, Li0n said:

My first thought about occlusion was that the math will be a nightmare, so thanks for the formula :) Re-thinking about it, it may be easier/better for unity speed, to find the angle using a raycast.

The seam between the half circle (opposed to the occlusion seam) will be visible, the same way the relay and dsn circle are visible when they overlap. That way be resolvable if I find the right shader for the job.

Would the seam be visible if it was drawn on the same pixel layer? I was optimistic that it would just blend, but practically, I figure there would of high change of Z fighting flickers. But as it was the same color, wasn't sure if that artifact would be visible.

Other low grade idea for poking holes in the disc was to take advantage of what I think is a bug. Somehow use a capsule primitive the same  size as a planet. The body would be in the closest end-cap and the other end cap would be stretched away far enough that it would occlude the area behind the planet to the range of the antenna.  It wouldn't be accurate as it really should be at an angle from the craft origin, but it might close enough and could be a way to poke multiple holes in a disc if a ray casting mesh wasn't possible. As far as hiding the existing disc mesh, I remember there was a post that described a circumstance where a shader took precedence and effectively wiped out any other shaders behind it . Something to do with KSP only bothering to render the top shader visible or something like that. It might be a pie in the sky idea thought. - but I joined that idea with the disc and capsule primitive where it might be able to hide a section of the disc due to the conflicting shaders.

29 minutes ago, Li0n said:

This made me remember of something I wanted to add a while ago : a representation of  the range at all time, not only at this instant. I've made an illustration for it back then :

The little circle represent the range now, the donnut represent all the possible connection range as the relay move on its orbit.

I think it will work nicely with the occlusion, showing that it's only temporary.

 

Thanks for the suggestions, the occlusion stuff is something I think of since the start but wasn't sure on how to do it. I'll add it to the to-do list. Don't expect it any time soon tho...

For the ground station/KSC stuff, I think it's pointless without the occlusion system so maybe, one day...

Anyway thanks and keep the suggestion coming :)

I saw the donut idea the other day when I realized I'd not read the whole thread. It's a good idea, but I'm not sure I'd use it without knowing WHEN the overlapping donuts occur. 

Lastly, there is zero expectation here. I figure most of my ideas are hair-brained and likely to be dismissed with a quick feasibility check. If it's useful, then awesome.

Link to comment
Share on other sites

12 minutes ago, wile1411 said:

Would the seam be visible if it was drawn on the same pixel layer? I was optimistic that it would just blend, but practically, I figure there would of high change of Z fighting flickers. But as it was the same color, wasn't sure if that artifact would be visible.

Other low grade idea for poking holes in the disc was to take advantage of what I think is a bug. Somehow use a capsule primitive the same  size as a planet. The body would be in the closest end-cap and the other end cap would be stretched away far enough that it would occlude the area behind the planet to the range of the antenna.  It wouldn't be accurate as it really should be at an angle from the craft origin, but it might close enough and could be a way to poke multiple holes in a disc if a ray casting mesh wasn't possible. As far as hiding the existing disc mesh, I remember there was a post that described a circumstance where a shader took precedence and effectively wiped out any other shaders behind it . Something to do with KSP only bothering to render the top shader visible or something like that. It might be a pie in the sky idea thought. - but I joined that idea with the disc and capsule primitive where it might be able to hide a section of the disc due to the conflicting shaders.

As the shaders goes I'll probably wait for KSP 1.4 to see what's new for them. I have close to zero knowledge about shader science but for what I've gather around the one KSP use/bundle are a bit old and rigid. So unless I get very bored before 1.4...

18 minutes ago, wile1411 said:

I saw the donut idea the other day when I realized I'd not read the whole thread. It's a good idea, but I'm not sure I'd use it without knowing WHEN the overlapping donuts occur.

Instead of the whole donut I can draw a dummy circle at some point of interest on the orbit, apopsis, next maneuver etc...

Link to comment
Share on other sites

Version 0.16 is up, on Github !

Quote

**General Update**
* Add support to Toolbar Continued by @linuxgurugamer, thanks to Toolbar Controller by @linuxgurugamer
* Toolbar Controller is now a dependency

**Editor Update**
* **NEW :** Add a list of relay antenna to be selected as target
* Add a button to remove ship from the editor ship list, they also get remove in the Tracking Station
* In-flight ship list show only relay
* Sort Editor and In-flight ship list by power
* Few visual improvement to the target windows
* Prevent click from going through the windows

**Tracking Station Update**
* Few visual improvement to the editor ship list window

**DEPENDENCY**
*MUST be installed*
Toolbar Controller version 0.1.4.2 or higher

K0SlJns.png

I'll rewrote the read-me (again) later.

Enjoy :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...