Jump to content

(KSP 1.10 + 1.12 ) Mission Controller 3.2.0 (Final Version) (Updated 6/25/2021)


malkuth

Recommended Posts

The current longitude goal is 170 to -170, which seems to be correct. But even circling around in orbit, it never turns green (unlike latitude). Perhaps there's a bug in the code related to longitude?

Is that handled with an "and", and is the MCE code written to just treat it as a linear number ignoring the cyclical nature of angle measurements? That would make it impossible. Try to think of a number that is both larger than 170 and also smaller than -170. There isn't one. If your current position was 175, then it would be > 170 but not < -170. If your current position was -175, then it would be < -170 but not > 170.

If the check is treating longitude like a raw number, then it doesn't realize that +179 and -179 are actually only 2 degrees apart from each other.

The fact that the crater sits right on the boundary between positive and negative longitudes makes the check messier.

While it's tempting to just say "remove the longitude goal again" I think this actually highlights a bug in the check that should be dealt with so that other future longitude goals can work properly. We're just lucky that the first real longitude goal happened to be one that triggers the bug right away.

The difficult part about fixing it is that if you take into account the cyclical nature of longitude, then that flips the problem to one in which technically ALL positions match a "greater than" and "less than" check. If that was fixed then the new problem would be this:

"Is 60 degrees longitude less than 50 degrees longitude? Yes. If you start from 50 degrees longitude and go 350 degrees east, you get to 60 degrees longitude, so 60 degrees is 350 degrees less that 50 degrees."

And the problem is that that's technically not wrong. It's mathematically correct, but not what we want as it would make all checks return true.

Therefore because of the cyclical nature of degrees longitude, I think all longitude checks will have to be implemented as error bars instead:

"You must be at this longitude, plus or minus this much."

Then you could have a goal of "180 degrees, plus or minus 10 degrees" which can be made to work, instead of ">170 and <-170", which cannot be made to work.

If you did that, and then also made the check aware of the cyclical nature of degrees, (such that it realizes that -179 is +2 degrees from +179, for example) I think that's the only fix that's practical.

An algorithm for finding the shortest angle difference between two arbitrary angles, taking into account the cyclical nature of degrees:

Start with A and B being the two angles (longitudes).

Get C, the difference between A and B, rotating B into a frame of reference using A as the origin angle, so we can work entirely with C, the relative difference, from now on. (i.e. if A = 45 and B = 70, then B is at angle 35 relative to A. Or if A= 45 and B = -150, then B is -195 relative to A):

C = B - A.

Normalize C's magnitude into the 0..360 range (i.e. if C = 365, turn it into 5, or if it's -365, turn it into -5.):

C = C mod 360.

Turn negative C into positive C (i.e. -90 becomes +270):

if C < 0 then C = 360 + C.

You now have C in the range 0..360.

change C's range to -180 to +180:

IF C > 180 THEN C = -(360 - C)

Now you have C, which is how far off B is from A, preserving the sign so you know if it was off to the east or west (if that matters).

I had to do this myself for a different reason: I was making a script for kOS and discovered that the longitudes returned by the KSP API are all over the place with no consistency. Sometimes 160 degrees east gets reported as 200 degrees west (technically true) or 520 degrees east (also technically true). The normalizing for the cyclical nature of longitude was not just a petty exercise - it was absolutely necessary because the API didn't guarantee it would normalize the values for you.

Link to comment
Share on other sites

when I added the Squad turbojet onto my plane the price jumped from like $30k to $150k. This was using Real Fuels and the Advanced Jet Engine mod

ok now it's down to only $65k for the engine. Don't know what happened - maybe the Stock Rebalance project changed some stuff that affected the MCE pricing

Edited by Gaiiden
Link to comment
Share on other sites

Is there anything that can be done price-wise for re-usable craft? I'm not talking about the recycle option I'm talking about aircraft, mainly. I spend an initial cost to build my aircraft, but unless I crash it there's no reason for me to spend money on the parts again when I want to re-launch it on another mission. Currently I just use the Ship Cost Breakdown window and some manual save file editing to make sure only operating costs are deducted but it would of course be nice if MCE could do this.

Link to comment
Share on other sites

This has probably been asked and I am sorry if it has, been searching for an hour and got tired of looking! :) On the SOI missions Keres VII requires you to take a CSM and LM undock in orbit, land on the Mun and then reunite for the trip back. I had always had a issue with the undock part but I was able to get around it by redocking then undocking again on the previous missions. This one however will show all green for the landing on the Mun part but refuses to mark it as completed. I read where this is not suppose to be an issue with ships that start out together but it seems to be a Vessel ID issue. Any idea how to fix it? Or anyone have a CSM/LM design to share since it may just be my horrible designing skills!! LOVE the mod BTW :D

Edited by Cobrattack
Link to comment
Share on other sites

This has probably been asked and I am sorry if it has, been searching for an hour and got tired of looking! :) On the SOI missions Keres VII requires you to take a CSM and LM undock in orbit, land on the Mun and then reunite for the trip back. I had always had a issue with the undock part but I was able to get around it by redocking then undocking again on the previous missions. This one however will show all green for the landing on the Mun part but refuses to mark it as completed. I read where this is not suppose to be an issue with ships that start out together but it seems to be a Vessel ID issue. Any idea how to fix it? Or anyone have a CSM/LM design to share since it may just be my horrible designing skills!! LOVE the mod BTW :D

Possible that mce has saved info from a previous attempt to do mission. If so then using thes delete all mission goals in settings might clear up the issue. If you do this though you will lose all saved mission goals that you have not completed yet.

Link to comment
Share on other sites

In Package SRB - Interplanetary completing the mission Kenus I doesn't unlock Kenus II ecc...

The name has to match the title name of last mission. I will check to make sure when I get a chance and add it to this weeks patch.

Link to comment
Share on other sites

Is there anything that can be done price-wise for re-usable craft? I'm not talking about the recycle option I'm talking about aircraft, mainly. I spend an initial cost to build my aircraft, but unless I crash it there's no reason for me to spend money on the parts again when I want to re-launch it on another mission. Currently I just use the Ship Cost Breakdown window and some manual save file editing to make sure only operating costs are deducted but it would of course be nice if MCE could do this.

If you land a plane on runway you get 95% of cost back. As long as it has wings and jet engines. Same goes with rocket as long as it has jet engines and some sort of wing.

Also you can cheat the system a little by landing a plane and parking it. Nothing really stops you from later using it again for another mission. You don't have to press space bar to start missions either. That just charges for craft. Having a way to refuel the planes can be fun too.

Edited by malkuth
Link to comment
Share on other sites

The name has to match the title name of last mission. I will check to make sure when I get a chance and add it to this weeks patch.

yes, i've done all the rest of the package without problems, is a crashing mission, at the end it shows the message of mission complete... save the progress... but the mission 2 remains locked

Link to comment
Share on other sites

Is that handled with an "and", and is the MCE code written to just treat it as a linear number ignoring the cyclical nature of angle measurements? That would make it impossible. Try to think of a number that is both larger than 170 and also smaller than -170. There isn't one. If your current position was 175, then it would be > 170 but not < -170. If your current position was -175, then it would be < -170 but not > 170.

If the check is treating longitude like a raw number, then it doesn't realize that +179 and -179 are actually only 2 degrees apart from each other.

The fact that the crater sits right on the boundary between positive and negative longitudes makes the check messier.

While it's tempting to just say "remove the longitude goal again" I think this actually highlights a bug in the check that should be dealt with so that other future longitude goals can work properly. We're just lucky that the first real longitude goal happened to be one that triggers the bug right away.

The difficult part about fixing it is that if you take into account the cyclical nature of longitude, then that flips the problem to one in which technically ALL positions match a "greater than" and "less than" check. If that was fixed then the new problem would be this:

"Is 60 degrees longitude less than 50 degrees longitude? Yes. If you start from 50 degrees longitude and go 350 degrees east, you get to 60 degrees longitude, so 60 degrees is 350 degrees less that 50 degrees."

And the problem is that that's technically not wrong. It's mathematically correct, but not what we want as it would make all checks return true.

Therefore because of the cyclical nature of degrees longitude, I think all longitude checks will have to be implemented as error bars instead:

"You must be at this longitude, plus or minus this much."

Then you could have a goal of "180 degrees, plus or minus 10 degrees" which can be made to work, instead of ">170 and <-170", which cannot be made to work.

If you did that, and then also made the check aware of the cyclical nature of degrees, (such that it realizes that -179 is +2 degrees from +179, for example) I think that's the only fix that's practical.

An algorithm for finding the shortest angle difference between two arbitrary angles, taking into account the cyclical nature of degrees:

Start with A and B being the two angles (longitudes).

Get C, the difference between A and B, rotating B into a frame of reference using A as the origin angle, so we can work entirely with C, the relative difference, from now on. (i.e. if A = 45 and B = 70, then B is at angle 35 relative to A. Or if A= 45 and B = -150, then B is -195 relative to A):

C = B - A.

Normalize C's magnitude into the 0..360 range (i.e. if C = 365, turn it into 5, or if it's -365, turn it into -5.):

C = C mod 360.

Turn negative C into positive C (i.e. -90 becomes +270):

if C < 0 then C = 360 + C.

You now have C in the range 0..360.

change C's range to -180 to +180:

IF C > 180 THEN C = -(360 - C)

Now you have C, which is how far off B is from A, preserving the sign so you know if it was off to the east or west (if that matters).

I had to do this myself for a different reason: I was making a script for kOS and discovered that the longitudes returned by the KSP API are all over the place with no consistency. Sometimes 160 degrees east gets reported as 200 degrees west (technically true) or 520 degrees east (also technically true). The normalizing for the cyclical nature of longitude was not just a petty exercise - it was absolutely necessary because the API didn't guarantee it would normalize the values for you.

Well before we go through and try to do this type of changes.. First we should make sure I just don't have the numbers in the mission reversed. Taking a look at the numbers now I have it set maxLogitude = -70 and minLogitude = 70... Think it should be the other way around.. So I will do some test and see what happens. ;)

Link to comment
Share on other sites

So my initial description was off for which I apologise.

I have only one way of closing this window once opened or re-start the game.

http://i1332.photobucket.com/albums/w615/greenskullinc/screenshot1_zps0df03482.png

http://i1332.photobucket.com/albums/w615/greenskullinc/screenshot3_zps683f651c.png

http://i1332.photobucket.com/albums/w615/greenskullinc/screenshot4_zps85154e4e.png

http://i1332.photobucket.com/albums/w615/greenskullinc/screenshot5_zpscf850aa1.png

I did try a contract and after a lot of messing about I got a satellite into the desired orbit. However I was unable to complete the contract because the desired apoapsis was in red. No matter what height I changed it too it was still red. I couldn't revert the mission to VAB using that window and I couldn't exit to space centre. In the end I alt-tabbed and had to shut KSP from desktop.

(Side note I did have trouble reading the tiny apoapsis etc figures when they were in red. I'm sure older players may agree with me on this :P)

My reason for asking about RSS compatibility is that my orbit durations are different from stock and I wondered if this was causing the inability to complete the contract.

Can't reproduce the not able to close the Window part. I go into custom contracts.. Push exit and everything seems to work fine. Load a custom contract works fine. What is exactly happening that is causing the window not to close?

Link to comment
Share on other sites

I love this mod! Just a question though, how does it calculate costs?? I think I read somewhere it is based on mass rather than the actual value of parts. Is there anyway to get the mod to actually charge the costs shown on the part descriptions? (+ fuel of course) Seems like an odd system at present.. (or I guess I could just wait for .24 to add it!). Also is it a know bug that the ship value randomly changes with the same parts? I can have a ship worth about 90,000... then take the engine off, put the engine back on and suddenly the ship costs twice as much!

Link to comment
Share on other sites

Well before we go through and try to do this type of changes.. First we should make sure I just don't have the numbers in the mission reversed. Taking a look at the numbers now I have it set maxLogitude = -70 and minLogitude = 70... Think it should be the other way around.. So I will do some test and see what happens. ;)

I still think it's something to worry about because I've seen raw (unmodded) KSP give me screwy weird numbers for longitude that aren't normalized into the range of -180 to +180. I've had it tell me, for example, that my landed craft was at a longitude of "581 degrees west", when if you think about it, that's really just a really screwed up way to say 221 degrees west, which is really 139 degrees east"

If it returns numbers like that in the user interface, I'm fearful that it does the same thing in the underlying API and therefore normalizing the result may be needed.

Link to comment
Share on other sites

Hi, I installed this mod and really like the idea of it. I can't wait until this is actually put into the game.

Anyway, I have a problem where if I land at high altitudes on kerbin it doesn't register in the mission. Note that I'm landing with the same ship that did the rest of the mission (no docking of any kind, only decouplers). Is this a bug in the mission or the mod? and is there anything I can do to help fix it?

Link to comment
Share on other sites

I still think it's something to worry about because I've seen raw (unmodded) KSP give me screwy weird numbers for longitude that aren't normalized into the range of -180 to +180. I've had it tell me, for example, that my landed craft was at a longitude of "581 degrees west", when if you think about it, that's really just a really screwed up way to say 221 degrees west, which is really 139 degrees east"

If it returns numbers like that in the user interface, I'm fearful that it does the same thing in the underlying API and therefore normalizing the result may be needed.

There appears to already be code for normalizing the angles to be between -180 and +180. I wasn't able to understand all the function calls that were going on for checking the mission goals though, because it was referencing classes and functions that I couldn't find the code for.

Link to comment
Share on other sites

Hi, I installed this mod and really like the idea of it. I can't wait until this is actually put into the game.

Anyway, I have a problem where if I land at high altitudes on kerbin it doesn't register in the mission. Note that I'm landing with the same ship that did the rest of the mission (no docking of any kind, only decouplers). Is this a bug in the mission or the mod? and is there anything I can do to help fix it?

Not sure what you mean by high altitude? Because if its not working then its not a MCE problem but a KSP problem. MCE uses KSP own code for deciding the situation of the vessel.. In this case situation is landed. The highest altitude on kerbin is the mountain range right next to KSC I believe.

I can do more test if I have mission name that is giving problems.

Edited by malkuth
Link to comment
Share on other sites

There appears to already be code for normalizing the angles to be between -180 and +180. I wasn't able to understand all the function calls that were going on for checking the mission goals though, because it was referencing classes and functions that I couldn't find the code for.

Indeed is code for this. Its in the Math Tools, I just had the values reversed in Mission. All is better in next patch.

Link to comment
Share on other sites

Version .64 Is Released

Figured I would get this out to fix the more annoying problems.

1. Fixed longitude problem in Crater Random Mission.

2. Fixed the wrong name in Oribital-MCE in a few contract mission.

3. Fixed a few of the BSM missoins reported in thread with Undock.

Possible other issues that been reported that I can't find and need more info.

1. The User Contracts window not closing.

2. Missions not ending could be multiple reasons, if the mission can only be done once (IE not repeatable LOTS OF BSM Mission Like this).. If a previous attempt exist that failed, then a new vessel won't work.. Need to delete all mission goals in settings to reset this problem. And when you die in these types of missions its important to pick the Do mission with another vessel if you get the death screen. (I will attempt another way around this in a later version).

.63 fixes carryOver

Version .63 Changes

1. Added a Few Hotfixes to make an official Version change Name change in contract Mission Part name OrbitalResearch (this is only a contract name change vessels are STILL SAFE)

2. Added a few fixed to Stock ComSat Missions Got rid of time count and Passive Mission parts (passive mission no longer works)

3. Fixed Random Contracts Mid Years Large Orbital Mission for you get Max APA and Min PEA instead of Max APA and Min APA.

4. Fixed a possible time bug with the time countdown. remember you can only do 1 timed mission at a time.. Not including Orbital Reserearch or roverResearch Both these types have own countdown timers. If your having issues with the timer its possible that the timer is set up for another mission. If you check your .sp file this line should read like this. timeStarted = -1 (thats a Minus 1 its important) if not then set it to -1 to restart the timer. Its not important if you don't do this. Just that if the timer is set to an older time (other mission not finished) the timer will continue from that time, and either give you an instant finish, or possible longer countdown then what current mission is. I will fix this at a later more extensive update.

Edited by malkuth
Link to comment
Share on other sites

malkuth said:
Version .64 Is Released

....

In every mission package Lunar or Planet Bases and Orbital when you have to do an "auxiliary module" mission the requested mission to unlock has wrong name, for example it searches Kerbin Orbital Station - Command Module but the mission is named Kerbin Orbital - Command Module, in Bases Packages to, it searches Kerbin Surface base - Command Module but the mission is named Kerbin Surface - Command Module, same thing for every auxiliary mission, so i've corrected all 4 .mpkg, now it works

simply replace this 4 files in GameData\MissionController\Plugins\PluginData\MissionController

https://mega.co.nz/#!8I4TxLzA!4Heb3I6-YRlgFNHCcHgS3UFYnhDXHCtYI3B7Y64v9EM

or

[dead link removed]

All "Auxiliary Module" missions will be unlocked correctly

gj2r.jpg

Edited by Snark
Dead link removed by moderator
Link to comment
Share on other sites

I may be mistaken about the high altitude. I think it actually may be if ksp thinks that sas is preventing movement while on the ground. So if you land on a hill steep enough to make your ship tip over and roll down the hill then it may still count it as flying. I've also noticed that if it's a manned mission I can get out of the ship and then it realizes that I've landed and that if I do a eva report then the game says flying at kerbin.

It could also be that the game thinks that the command module has to be so close to the ground in order for it to be considered landed. That would explain why later missions have trouble and not the early ones because I tend to attach science jrs. to the bottom of the command module soon after I start.

The missions I've had problems on were Katurn 4 I believe and a couple of stayputnik missions such as 3 or 4 maybe. I've only played about 6 or 7 missions and the first ones never have problems.

Edited by Jonnothin
Link to comment
Share on other sites

Well I just threw both of my theories out the window. I landed in the water with a command capsule 2 goos on opposite sides and an engineering module on another and it didn't say the mission was finished until my kerbal got out. This would have been a problem if it were unmanned.

This was mission Kerra 3.

Any thoughts?

Link to comment
Share on other sites

Well I just threw both of my theories out the window. I landed in the water with a command capsule 2 goos on opposite sides and an engineering module on another and it didn't say the mission was finished until my kerbal got out. This would have been a problem if it were unmanned.

This was mission Kerra 3.

Any thoughts?

So your saying no matter where you land your not getting the finished mission popup?

The vessel has to be completely still for it to register as landed. Usually though landing in water you get it instantly. The mountain part if your vessel is rolling then it does not count as landed until your stopped.

I will run Kerra 3 and see if it works for me.. Its a simple mission though so should work.. Make sure you have latest version.. Not that it matters because landing has never really been broken. ;)

Of course if you have other mods in your game. There might be some sort of Bad interaction with it.. could be the case.

Couple things I should mention.

1. Make sure your throttle is a 0 or can't finish mission or objectives.

2. Make sure your out of Time warp to finish mission.

3. Make sure you select the mission first outside of flight, (sometimes it causes issues when you start it in flight, not sure why)

4. In single missions only use 1 craft.. If you fail the first time MCE saves the vessel ID and is expecting that vessel to finish the mission.. Other vessel even the same type will not be able to finish on Do only once type missions. You have to either Option A. Select the Fly Mission with different vessel in the pop up that comes up if you explode... Or b. Go to settings and clear Mission Goals to clear any saved goals from older vessel that might be dead.

In your case (the mission does work for me) I think number 4 is the issue. You have previosly tried to do the mission and failed. MCE saved the vessel info and ID of that craft. Somehow you died, or reverted.. Now your vessel has different ID. You need to clear you Mission Goals in settings to get rid of this problem.

I will have a different fix for this at a later time, when I get more time to look into a better way of stopping this from happening.

Edited by malkuth
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...