Enigma179 Posted December 13, 2013 Share Posted December 13, 2013 (edited) So inspired by Thrfoot's automated mission challenge, which I also discovered kOS through, I came up with this little challenge.Simple enough, get a vessel of your design into a stable orbit around Kerbin, without using any input beyond typing out the execution command line at the beginning, and do it in the most (delta-v) efficient manner possible. It's not *quite* mechjeb, but it's a foundation!RULES:1. No mods that directly affect gameplay aside from kOS itself. Alternatively, say which gameplay-affecting mods you used, and that'll be fine too.1a. You're gonna want to have kOS, obviously (get it here), and another pretty-much-required mod for this is Kerbal Engineer, as you need to know your (vacuum) delta-v before you launch, and after you're in orbit.2. No user input! The only thing you can do is at the beginning of the launch, when you open up the command line, copy the program to the ship, and run it.3. Your final orbit must have an apoapsis and a periapsis around Kerbin, and both must be outside Kerbin's atmosphere (that is, 69,078 metres above sea level).4. You must have screenshots that show your delta-v from inside the hangar (Engineer shows your in-atmosphere delta-v when in flight mode), and your delta-v after achieving orbit, as well as proof that at least your periapsis is outside the atmosphere.Aside from that I can't think of any other restrictions. Your ship can be as large as you like, as complex or simple as you like, and can operate whichever way you like. I'd be impressed to see a robotic spaceplane, myself.Your score is the difference between your hangar delta-v and your orbital delta-v at the end, so obviously the lower the better. Also while this isn't required, it'd be super nice for you to post your code alongside your screenshots, help other people figure out the basics of the language. Maybe I can learn a thing or two as well.And it wouldn't be a challenge if I didn't get in on it myself first, now would it?Starting delta-v: 4,855 m/s (I play it safe alright)Final delta-v: 282 m/sSo I have a score of 4,573 m/s.And of course, here's my code. No comments because who needs good style right?lock STEERING to UP.lock THROTTLE to 1.declare TermVel.declare Speed.until APOAPSIS > 75000{wait 0.01.if ALTITUDE < 10000{set TermVel to 10 * ((1250 * 6.647 * (10^(-11)) * (5.292 * 10^(22))) / ( (1.2231 * 2.718^(-1 * ALTITUDE / 5000) * 101.33) * (600000 + ALTITUDE)^(2)))^0.5.if VERTICALSPEED > TermVel and THROTTLE > 0.8 { lock THROTTLE to THROTTLE - 0.01. }.if VERTICALSPEED < TermVel * 0.99 and THROTTLE != 1 { lock THROTTLE to THROTTLE + 0.01. }.}.if STAGE:LiquidFuel = 0{ stage.}.if ALTITUDE > 10000 and ALTITUDE < 15000 { lock THROTTLE to 1. lock STEERING to HEADING 90 by 60.}.if ALTITUDE > 15000 and ALTITUDE < 20000{ lock THROTTLE to 1. lock STEERING to HEADING 90 by 30.}.if ALTITUDE > 20000{ lock THROTTLE to 1. lock STEERING to HEADING 90 by 15.}.}.lock THROTTLE to 0.print "Apoapsis of 75km achieved".lock STEERING to HEADING 90 by 0.wait until ETA:APOAPSIS < 4.wait 0.01.lock THROTTLE to 1.until PERIAPSIS > 70000{ if STAGE:LiquidFuel = 0 { stage. }}.lock THROTTLE to 0.print "Launch Complete...".LEADERBOARD(1). adammada, -434 m/s (Maybe? Some staging shenanigans)1. Bobnova, 4413 m/s2. Enigma179: 4,573 m/s Edited December 14, 2013 by Enigma179 Link to comment Share on other sites More sharing options...
Dunbaratu Posted December 13, 2013 Share Posted December 13, 2013 The last time I had Kerbal Engineer installed it had conflicts with kOS so I de-installed it. Has that problem gone away now? It sounds like it might have since you're using it, apparently. Link to comment Share on other sites More sharing options...
Enigma179 Posted December 13, 2013 Author Share Posted December 13, 2013 Worked just fine for me Link to comment Share on other sites More sharing options...
Bobnova Posted December 14, 2013 Share Posted December 14, 2013 Mine isn't nearly as professional as yours, but it functions decently.Scattering a few stage commands through it will make it work with other ships too, I used something very similar to get to the Mun for the other challenge.Anyway, here's the album:Javascript is disabled. View full albumStarting D/V: 5247.Orbit D/V: 834.Total D/V used: 4413.For giggles I tried your program copy/pasted too, it left me with 858 D/V remaining. Link to comment Share on other sites More sharing options...
adammada Posted December 14, 2013 Share Posted December 14, 2013 Starting D/V: 1192Orbit D/V: 1626Total D/V used: -434 . I gained 434 D/V. So i'm winner now . Your ship can be as large as you like, as complex or simple as you like, and can operate whichever way you like.No cheating, just turbojet engine... Link to comment Share on other sites More sharing options...
Bobnova Posted December 14, 2013 Share Posted December 14, 2013 More of a KE staging miscalculation, KE is assuming that there will be no fuel left for the orange motors when they become active. Link to comment Share on other sites More sharing options...
SilverWarior Posted December 14, 2013 Share Posted December 14, 2013 To bad kOS doesn't use Pascal based syntax instead of C based one. I would have done wonders with it as I'm prety good in Objective Pascal. Link to comment Share on other sites More sharing options...
Enigma179 Posted December 14, 2013 Author Share Posted December 14, 2013 Leaderboard updated, and I'm a bit iffy adammada, but I *guess* that's alright? Link to comment Share on other sites More sharing options...
adammada Posted December 14, 2013 Share Posted December 14, 2013 Its all by the rules, so you should probably alter rules. Solutions:a) Ban TurboJet engines Provide .craft so it will become purely kOS contestc) Use other method of counting used delta-V. Once MechJeb had "used delta-V" stat, I don't know if it has one now. Link to comment Share on other sites More sharing options...
Bobnova Posted December 14, 2013 Share Posted December 14, 2013 It's a bug in KE. Example of another flavor of the same bug: one of these has rather of a lot more DV than the other, but they're listed the same.Javascript is disabled. View full album Link to comment Share on other sites More sharing options...
adammada Posted December 14, 2013 Share Posted December 14, 2013 Example of another flavor of the same bug: one of these has rather of a lot more DV than the other, but they're listed the same.Nope. In your example everything works as it should. Look at your staging. First stage is to ditch fuel tanks, second stage is fire engine with central tank. I think that this is not bug in KE, its just TurboJet ISP wchich is changing, so KE estimations are not correct. Link to comment Share on other sites More sharing options...
TelluriumCrystal Posted December 15, 2013 Share Posted December 15, 2013 (edited) Just discovered this now. Good luck to everyone attempting this challenge! Edited December 15, 2013 by Thrfoot Link to comment Share on other sites More sharing options...
Bobnova Posted December 15, 2013 Share Posted December 15, 2013 (edited) Hmm yeah, you're right.The Turbojet behaves very strangely. Edited December 15, 2013 by Bobnova Link to comment Share on other sites More sharing options...
Dunbaratu Posted December 16, 2013 Share Posted December 16, 2013 Please help me to understand what "ground" delta-V means.I only used Kerbal Engineer very briefly so I don't know a lot about it.What is the "delta V on the ground" readout that you're referring to and what does it actually mean? It can't be the delta V a maneuver takes since it doesn't know what maneuvers you'll be doing yet.Is it meant to be the maximum amount of delta-V you could possibly attain with the remaining fuel on board? If so I assume it needs to make lots of assumptions to make that calculation since it varies depending on how you use that fuel, and I'd like to know what those assumptions are.These are the things I'd like to know what the assumptions the measurement is based on are:ISP: ISP varies depending on how long you spend in atmosphere, because sea level ISP is not the same as vacuum ISP. What assumption is KE making about this when it comes up with the figure?Drag: Thicker air gives you less delta-V return for the same fuel burned, so since KE doesn't know my flight path what is it assuming about this? Is it just giving me what the delta-V would be in a vacuum?Which fuel goes to which engine: Various complex staging techniques can make it hard to calculate which fuel will be ending up in which engine when. If I have yellow fuel hoses doing strange things, does KE calculate the delta-V right?Does it make presumptions about when I'll be hitting the spacebar to stage? Since both the remaining mass and the remaining engines depend on staging, does it take this into account or does it presume a simple case where the length of the burn occurs all-in-one-stage for the delta-V calculation? Link to comment Share on other sites More sharing options...
Bobnova Posted December 16, 2013 Share Posted December 16, 2013 It's in the rules:You must have screenshots that show your delta-v from inside the hangar (Engineer shows your in-atmosphere delta-v when in flight mode), and your delta-v after achieving orbit, as well as proof that at least your periapsis is outside the atmosphere.Hanger DV, orbit DV. Link to comment Share on other sites More sharing options...
Dunbaratu Posted December 20, 2013 Share Posted December 20, 2013 It's in the rules:Hanger DV, orbit DV.Is the challenge only supposed to be for spaceplanes? It's a bit of a pain to get a rocket design into the hangar instead of the the VAB.Secondly, that really doesn't answer all the questions. Vacuum versus Atmosphere measure was just one question. Link to comment Share on other sites More sharing options...
Bobnova Posted December 23, 2013 Share Posted December 23, 2013 When you're in the hanger/VAB, it shows vacuum. How hard is it to understand that you take what KE shows in the hanger/vab and subtract what KE shows in orbit? Link to comment Share on other sites More sharing options...
Dunbaratu Posted December 23, 2013 Share Posted December 23, 2013 (edited) When you're in the hanger/VAB, it shows vacuum. How hard is it to understand that you take what KE shows in the hanger/vab and subtract what KE shows in orbit?Trying to optimize a thing requires knowing how it's being measured. Otherwise it's just guesswork. Knowing how to count the score doesn't mean knowing what tactics would work to make the score better. That requires knowing how those numbers are being derived. Edited December 23, 2013 by Steven Mading Link to comment Share on other sites More sharing options...
Bobnova Posted December 23, 2013 Share Posted December 23, 2013 Knowing how to count the score tells you exactly which numbers are used. If you know which numbers are used, surely you can figure out where they come from.Think, man, think. Link to comment Share on other sites More sharing options...
Dunbaratu Posted December 24, 2013 Share Posted December 24, 2013 (edited) Knowing how to count the score tells you exactly which numbers are used. If you know which numbers are used, surely you can figure out where they come from.Think, man, think.While it is possible to reverse engineer something to work it out the meaning of a number, by trying again and again and again using lots of trials with slightly different setups and recording the results until a pattern emerges, it's also an utter waste of time if it's already known. In this case it must be already known to at least some people, since the number is the result of humans making software. Take your own advice and think instead of being condescending. Edited December 24, 2013 by Steven Mading Link to comment Share on other sites More sharing options...
Bobnova Posted December 24, 2013 Share Posted December 24, 2013 Kind of asking in the wrong place if you want to know about the inner workings of KE then, aren't you?If I had to hazard a guess, I would say it probably uses the vacuum DV calculation. The one with ISP and fuel and vehicle weight. Link to comment Share on other sites More sharing options...
tavert Posted December 24, 2013 Share Posted December 24, 2013 (edited) What is the "delta V on the ground" readout that you're referring to and what does it actually mean? It can't be the delta V a maneuver takes since it doesn't know what maneuvers you'll be doing yet.Is it meant to be the maximum amount of delta-V you could possibly attain with the remaining fuel on board?Yes, essentially. In simple cases without fuel crossfeed or parallel staging, it reduces to just applying the rocket equation on each stage.ISP: ISP varies depending on how long you spend in atmosphere, because sea level ISP is not the same as vacuum ISP. What assumption is KE making about this when it comes up with the figure?KE assumes constant Isp for each engine, either vacuum or atmospheric. Hence the distinction between "vacuum dV" and "atmospheric dV."Drag: Thicker air gives you less delta-V return for the same fuel burned, so since KE doesn't know my flight path what is it assuming about this? Is it just giving me what the delta-V would be in a vacuum?Drag losses are a function of trajectory, for a fixed design. A given design has an inherent max delta-V capacity, your trajectory and throttle settings determine how far you can get with that delta-V capacity.Which fuel goes to which engine: Various complex staging techniques can make it hard to calculate which fuel will be ending up in which engine when. If I have yellow fuel hoses doing strange things, does KE calculate the delta-V right?For the most part, yes. When there is fuel cross-feed, KE does a fuel flow simulation to determine which engines draw from which tanks during each stage. When there are multiple types of engines, the overall weighted effective Isp depends on the combinations of engines that are burning, and this can change at each stage.Does it make presumptions about when I'll be hitting the spacebar to stage? Since both the remaining mass and the remaining engines depend on staging, does it take this into account or does it presume a simple case where the length of the burn occurs all-in-one-stage for the delta-V calculation?Yes, it assumes a best case where you drop each stage at the exact instant the fuel flow simulation predicts it will run out of fuel. Edited December 24, 2013 by tavert Link to comment Share on other sites More sharing options...
Dunbaratu Posted December 24, 2013 Share Posted December 24, 2013 (edited) Kind of asking in the wrong place if you want to know about the inner workings of KE then, aren't you?Well, I don't consider a number the mod is communicating to the user to be "inner workings". If it's being told to the user the presumption is that the user is supposed to know what it represents and I assumed people who'd been users of it all along would know, especially if it's being used to judge the contest, thus the question. Wanting to know the algorithm used to calculate it would be "inner workings", but just wanting to know what it actually means isn't.(EDIT: ninja post by tavert while I was composing, rendering most of what I said after this moot).Thank you for the relevant answers, tavert. The only remaining question is whether it just ignores the gravity well altogether when making the calculation. (When climbing from a gravity well into orbit you can't get nearly as much dV as you could when already in orbit, because when already in orbit you can treat the burn as if it occurred at a single instant in time, but when climbing that assumption breaks down and the fact that you spent a lot of that burn fighting against gravity as you slowly got up to speed causes "wasted" dV, and in effect this challenge is all about trying to minimize that as much as possible.)So is it saying if we pretended there was no wastage from slowly fighting a gravity well and the craft was just floating freely in interstellar space all by itself, this would be the dV it could achieve, or is it saying its the dV it would get from an optimal gravity turn, which is less than that? Edited December 24, 2013 by Steven Mading Link to comment Share on other sites More sharing options...
tavert Posted December 24, 2013 Share Posted December 24, 2013 (edited) Thank you for the relevant answers, tavert. The only remaining question is whether it just ignores the gravity well altogether when making the calculation. (When climbing from a gravity well into orbit you can't get nearly as much dV as you could when already in orbit, because when already in orbit you can treat the burn as if it occurred at a single instant in time, but when climbing that assumption breaks down and the fact that you spent a lot of that burn fighting against gravity as you slowly got up to speed causes "wasted" dV, and in effect this challenge is all about trying to minimize that as much as possible.)So is it saying if we pretended there was no wastage from slowly fighting a gravity well and the craft was just floating freely in interstellar space all by itself, this would be the dV it could achieve, or is it saying its the dV it would get from an optimal gravity turn, which is less than that?HTH. Yes, KE tells you "design dV capacity" before taking into account any losses due to gravity, atmospheric drag, or steering (non-prograde thrust). I forget whether KE will actually measure those individual losses while in flight, I know MechJeb does. Neither KE nor MechJeb do any simulations of the ascent performance of your design, or optimization of gravity turns, etc. The "design dV capacity" just tells you that if you were to burn through all of your craft's fuel (in a vacuum for vac dV, or at constant sea-level ambient pressure for atmospheric dV) and stage immediately when you should, what will be the result of integrating gross engine thrust divided by total craft mass over time. Edited December 24, 2013 by tavert Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now