Jump to content

Xyphos

Members
  • Posts

    1,083
  • Joined

  • Last visited

Posts posted by Xyphos

  1. in old versions of the game, if you put a part on your vessel, it had drag effect no matter what, even if it was in a stack attachment, it behaved like it wasn't
    later, drag cubes where added and calculations were put in place to determine if the drag should be applied/multiplied, etc but this proved to be suboptimal and caused lag.
    fast forward to present, the last I heard, the drag cubes aren't used anymore, or at least don't behave as they used to.

    I haven't tested it, but I theorize that the drag is the surface area of the part like you said, and the drag cubes simply add a "tweaking" mechanic to the drag model.

    if you do some experimenting with the surface area formula and compare your results to other test cases, I'm sure you'll find some sort of pattern and/or formula.

  2. I want a UI button to do something for a specific celestial body being viewed in the tracking station.
    I have the UI code setup but scratching my head on how to determine which celestial body is being focused on in the tracking station.

     

     

    UPDATE:

    after a few days of trial and error, I've found the answer:

    var celestialBody = PlanetariumCamera.fetch.target.celestialBody;

    also worth noting that the target can be anything that the tracking station can focus on, so you need to make sure it's a celestial body (or any other type)

    var isCelestialBody = PlanetariumCamera.fetch.target.type == MapObject.ObjectType.CelestialBody

     

  3. progress update.
    I took a break from development over the holiday but today I've made some changes to the code. It's still too slow to scan actively, so the cache data generator is working from the tracking station, and the part module will use the cache data to provide near-instant results. The cache data is accurate within 20 square meters, I figure that should be a large enough area to quickly skip scanning over without greatly decreasing scan accuracy.

    5iCZkTT.png

     

    As soon as the cache data is completed, I'll be ready to further develop the part module and waypoint code.

  4. nah, I don't need resources consumed, the PartModule is actually inherited from ModuleScienceExperiment which is what my mod is currently implementing.

     


    I just need some guidance on how to create a science report properly and transmit it back to Kerbin for some science, and to enable a feature after transmitting.
    the lack of documentation for the API and no general information given is frustrating. I looked at @DMagic's code and found myself saying 'what' more than I usually do.

  5. 12 minutes ago, HebaruSan said:

    Probably the least worst pattern I've seen is to derive multiple scene-specific shell classes from your main MonoBehaviour class and then tag each one with the appropriate attribute. E.g., that's what KAC does:

    https://github.com/TriggerAu/KerbalAlarmClock/blob/c5f813cd8a4e7a4ea5afc74b65f74a702188fbfb/KerbalAlarmClock/KerbalAlarmClock.cs#L31-L55

    Not ideal, but it gets the job done without too much fuss.

    I considered doing it that way, but I was worried if Unity wouldn't fire the inherited methods.

    thanks!

  6. okay, so even with that piece of code added it's still very slow.
    too slow to be an ACTIVE scan, so I'm changing plans yet again.
    I'll revert back to the original concept, run it from the tracking station as an addon instead of a part module, scan all bodies and log the results to a .cfg file as a data cache
    if I let my computer run for a week, I should have generated the cache data to be distributed with the mod, and used with a separate science experiment part module.
    the science experiment should read the cached data and return the highest peak almost instantly, complete with a waypoint.
    the upside is, celestial body data hasn't changed since I don't know when so I won't have to regenerate the cached data often.
    the downside to this is, only stock planets would have the cached data and any mod systems would have to have the cached data generated from the space center before the science experiment could work.

    unless anyone has any other ideas?

  7. 2 hours ago, DoctorDavinci said:

    Here's some code that will let you calculate how many meters are in a degree of any given planet and then break that down into how many degrees are in a meter in relation to the current celestial body ...
    It will give you how many degrees are in a meter at 0 meters in altitude (the radius of the celestial body) ... you can even add the current vessels altitude to get more precision if you're high in the sky or way out in orbit, but for your purposes it should do what you would need

     

    this might actually help. thanks!

    a landing zone could be like,  25 square meters so all I have to do is calculate the degrees for those areas and reduce the number of scans overall.

  8. well, I fixed the code and it works... very... very... very... slowly.
    I didn't account for the time it takes to complete 360 * 1000 * 180 * 1000 operations by doing them 100 times per physics frame

    so... would it be possible to speed things up with multiple coroutines? is there a limit as to how many are allowed?

    possible idea: maybe do a preliminary fast and less accurate scan to find regions with height > 100 (or 1000?) and deep scan within those regions
    but this could be erroneous if the fast scan doesn't register a peak near the scan point...

     

    I'm open to ideas.

  9. 3 minutes ago, DoctorDavinci said:

    I assume you're using 1 offset GPS point per cardinal direction to calculate the highest of the 9 during scan and if this is the case you could easily add in a landing difficulty indicator based on the difference in altitude of each of the GPS points

    I have no clue what any of that means :D

    and I'll seriously consider interfacing, I've done interfaces with MechJeb before so it's possible.

  10. 10 minutes ago, DoctorDavinci said:

    No problem ... Any other question you have feel free to ask as what you are doing with your mod is along the lines of what I've been doing in OrX Kontinuum, albeit your mods purpose, ie getting the highest altitude of a given point to be displayed to the user, is not part of it

    I'm doing the same sort of deal in W[ind/s] to simulate updrafts for hang gliding as well as ocean currents for Scuba Kerb ... scuba diving is a thing in KSP now :wink:

    The mod's original purpose was to locate the highest peak on every celestial body from the tracking station and log it to a text file.

    but plans change; now I'm thinking of making it a part module (currently for command modules during testing, will transition to the Stock M700 Survey Scanner later) that only scans the current orbiting body.

    when I get it working properly, I intend on having it set a Stock Waypoint at the highest peak, and maybe even send some science data back.

    landing vessels at these peaks would save dV for landing and takeoff  but would require some precision piloting to achieve.

    I got this idea from a youtube video I saw, someone completed the Jool 5 Challenge in a < 7tonne SSTO SpacePlane but he landed on their highest peaks to do it, so I wanna give it a shot too, and maybe even beat the lowest mass record

×
×
  • Create New...