Jump to content

Building a working space elevator in KSP


HippieGold

Recommended Posts

I've been watching a lot of Isaac Arthur's videos recently, and the man is absolutely obsessed with mega structures. O'neil cylinders, Launch Loops, Orbital Rings, Orbital Mirrors, the list goes on and on, and I wondered, what would it take to build these kinds of structures in KSP? Using both Extraplanetary Launchpads and USI Kolinization, there's practically no limit to the sort of stuff you can build, since you're not limited to having to launch stuff into orbit. However, constructing things in orbit takes Material Kits and Specialized Parts, both resources added by USI, and to build a mega structure you'd need a LOT of Material Kits. So how do you get all those material kits into orbit without having to make hundreds of landings with massive resource transporting ships? The answer, I thought, was a space elevator.

But the question remains, is building a space elevator possible? Well, the answer is yes and no.

When trying to research KSP space elevators I only found two examples of people successfully building one.

 

 

The first was the one built by SWDennis, a man known for building ridiculously large objects in KSP. His space elevator appeared to be built using Kerbal Konstructs, rather than the elevator being an actual part. However, his design has an actual functioning crawler, or at least it functions until about 90 or so kilometers up, before clipping through the elevator. While this design was cool, it wasn’t really what I was looking for.

 

 

 

                The second example was by a guy called Tekist, who actually built a fully sized elevator going up to kerbin stationary orbit, and this one was a part too. Using both ubio part welder and tweak scale, he managed to build a tower 2924km high, and even launch a craft from the top! However, when he did the craft had a velocity of 0m/s and couldn’t activate its engine, so the craft wasn’t put into orbit like it should have been, were it a real space elevator. At first I thought this was definitive proof that a space elevator just wouldn’t work, at least not as intended, but something in the description of Tekist’s video caught my eye.

The tower is still affected by KSP's physics engine, resulting in it being very buggy because the engine isn't designed to handle such massive objects. This prevents a geosynchronous tower from being useful in any way. However, the low-Kerbin orbit tower is able to launch payloads.”

                So perhaps, the reason his elevator wasn’t working was because it was too high. But how high is too high? I decided I had to find out, and so I set out to build my own space elevator.

 

 

The Goal

                My goal was this. If I could build a fully functional space elevator, I could dock a freighter to the top of it, and use USI’s planetary logistics system to fill that freighter with cargo, and then send it on its way. This way would mean I wouldn’t have to build a bunch of smaller ships capable of ferrying resources for the surface to orbit. When all was said and done, I wanted a planetary wide industry capable of producing 1 billion material kits a day, and I wanted to be able to transport those 1 billion material kits into orbit, again, every single day. It was a tall order for sure, but if I was able to build a fully functional space elevator, it would be as easy as just transferring the resources via tac fuel balancer.

 

 

Issue #1: Height

So if 2924km is too high, then where can we build a space elevator that’s shorter? Now in the Kerbol system, the answer would be Minmus. Synchronus orbit above Minmus is only 357km, meaning the elevator would only have to be that high. However, from the get go my plan was to build this elevator the legit method in a Real Solar System play through, so the question then became: what body in the solar system could we build the shortest space elevator? The answer, as far as I can tell, is Ceres, with the elevator only having to be 706km high, double that of the hypothetical Minmus space elevator.

Issue #2: Physics Range

                A lot of people will tell you that space elevators are impossible because the physics range only extends 2.5km, so if you were at the top the object would just unload. This actually has the simplest solution, just using the Physics Range Extender mod. Since the elevator I planned on building was 706km, I decided to extend the range to 710km.

Issue #3: Wobble

                This definitely ended up being the hardest thing to get around, as sometimes things would work while other times they wouldn’t. The obvious issue here is that loading in a 706km long object causes the game to freak out. It begins to wobble all over the place and eventually ends up spinning out of control. My solution to this was found within the USI mod. In that mod there is a module called the “Inertial Dampener” or ground tether. When activated, it fixes an object into place in relation to the ground. This would, in theory, keep the elevator stationary, as it should be.

 

Construction

My concept was to build an object with three parts: the base, the shaft, and the top. The base and the top were relatively easy, but the shaft proved difficult. In order to get the proper dimensions, I had to weld together a part that was 0.5m wide and 3530m tall. This took a lot of finagling in the space plane hanger but I managed. Then, I would have to use tweak scale to increase it to 200x its size, making the shaft 100m across and 706km long. I increased the size of both the top and base so that it would fit as well, and before I knew it I had my space elevator.

DG5qkvT.jpg

It’s 1km across and 706km high, weighing in at 482 million tons. To build it with Extraplanetary launchpads it would cost 385 billion material kits, and in terms of funds, it costs 2.7 QUADRILLION. Truly an unholy beast of a craft, and the game absolutely did not like it existing. While sometimes the wobble wasn’t too bad, giving me time to activate the ground tether, other times physics would grab the thing by the neck and try to choke it to death. However, eventually I was able to toggle the ground tether and make the thing stationary. Then the question became this: if I uncouple something from the top of this thing, what will happen?

 

 

Testing

 

 

This was where things started to get messy. I placed a decoupler with a pod on it at the very top of the elevator and planned to decouple it after tethering the elevator, in a similar way to how Tekist did, to see if the physics engine would glitch out the same way.  However I never got that far in testing. The moment the craft loaded in the wobbling became UNBEARABLE. It was so bad I couldn’t even click on the vessel to activate the tether because the camera was freaking out so much. When I uncoupled the pod without the ground tether being activate, it was flung off into space at three times the speed of light.

kazZ8no.png

                This was incredibly disheartening, however I didn’t give up. After a few more tries using different techniques (this time I actually decided to extend the physics range), well it still didn’t work but something interesting happened. After the elevator loaded up the intense forces of the wobbling elevator broke the connection to the pod and flung it off into space, however instead of being flung at super luminal speeds, it ended up in a sub orbital trajectory.

rhIoHuN.png

                This, I thought, was very promising. It could mean that the game was actually properly calculating the orbital speed of the vessel, or perhaps the speed was being generated entirely by the flinging. I had to find out. So I decided to change my approach. Instead of putting something on the top of the elevator and uncoupling it, I would load in the regular elevator and tether it to the ground, build a ship with a grabber claw on it, fly it all the way to the top, and forcefully dock with it. Then, I would undock to see what would happen.

Iue6vKa.jpg

                I built something small, turned on infinite fuel, and began to fly up. It took me about three days to get to this point, and I was incredibly excited. The elevator was stable, stationary, and as I flew up it continued to stay that way. I knew by using the camera tools mod that the top of the elevator did in fact exist, although it did flicker quite a bit, so I knew there was actually something to get to. My only worry at this point was that at that distance the physics engine would break down and the ship would phase right through the shaft. Still I had to try. Then, at around 150-200km up, the elevator disappeared.

P3omQDn.jpg

                I was dumbfounded. It didn’t make any sense. The physics range extender was working just fine. I went back to the tracking station and indeed, the elevator was still there. I switched back to the elevator, then switched back to the ship, and then bam, it was gone again. It was only after using cameratools to inspect the surface that I figured out what was going on. The ground itself was disappearing after a certain distance, and because the elevators base was tethered to it, the elevator disappeared along with it. And that was it, definitive proof that a fully practical space elevator in KSP is impossible, something that still bothers because it appears to directly contradict with Tekist’s video, where his elevator stayed rendered after undocking from it. How he managed this, and how he managed to build an elevator without wobble in the first place, I may never know.

 

Faux Practical

                Okay, so the elevator can’t be docked with, that point I’ve conceded. However, just because it  can’t be fully practical, doesn’t mean it can’t be faux practical. Essentially, all I need is a device capable of getting things into orbit on the cheap, and USI’s orbital logistics module gives me some room for that possibility. The plan now became to lower the physics range back down to normal, then build a space station directly above the elevator in the orbit it would supposed to be in. This way, I could use USI orbital logistics to transport resources to that space station, then have ships dock with that station to retrieve resources from it. I could even have a shaft extend 10km down from the station to make it look somewhat more realistic. Now the orbital logistics module requires the use of transport credits in order to make a transfer, but I could just use cheats to give the elevator an absurd amount of transport credits. So I attempted to put this theory into practice, and again, ran into a problem. Remember that my goal was to be able to put 1 billion material kits into orbit every day. Well, using USI’s orbital logistics, even with infinite transport credits, it would take four YEARS to get 1 billion Material Kits into orbit. I wasn’t able to find any setting in the mod to be able to edit this amount of time, not even in my save file.

Or at least that was what I thought until just this very moment. Turns out you absolutely can edit the amount of time it takes for a transfer, which means I can turn those 4 years into 1 second. So, in short, I now have a totally practical space elevator, capable of transporting millions of tons into orbit for free. It took a lot of cheating and mods, but still, it can be done.

 

 

The end result

 

f1Fdf7Z.jpg

A few things. First, in order for maximum stability, I turned the shaft into a physicsless object. This means when you load in the elevator the camera will jump down to the base. However, this also causes the base of the elevator to jitter, even when tethered to the ground. I found the only way to prevent this was to load up another craft on the Launchpad. Then, for whatever reason, the elevator becomes completely stable and stationary. What you’re left with is a really cool looking thing that kind of, sort of does what a space elevator is meant to do, hence the answer to whether you can build a space elevator in KSP being both yes and no.

Keep in mind this was made for Ceres in RSS, but I never actually tested it there, as this whole affair had already become enough of a pain. So maybe this thing wouldn’t even work on Ceres, who knows. Maybe a shorter one built for Minmus would work better. All questions I am not currently prepared to answer. I’m just glad I was able to build something cool.

NJh0FnP.jpg

By the way, in case you couldn’t tell the elevators base was based on this artwork.

 

Anyway, if you have any questions or want the craft file and save file, let me know, but really the main point of this was to put my findings out there on building a functional space elevator, so that some other poor sap won’t have to go through the same trials and tribulations I did.

 

So is it possible to build a space elevator in KSP? Yes, absolutely.

 

PVW3xZ9.jpg

Edited by HippieGold
Link to comment
Share on other sites

The PQS had bitten you .

I think that a possible solution is to make the elevator residing on every PQS level. Constructions are bounded to the highest details ones, as they only need to be rendered when visible to the current camera.

I don't know how to do it but the KK guys should be able to hint about!

Link to comment
Share on other sites

1 hour ago, HippieGold said:

This was where things started to get messy. I placed a decoupler with a pod on it at the very top of the elevator and planned to decouple it after tethering the elevator, in a similar way to how Tekist did, to see if the physics engine would glitch out the same way.  However I never got that far in testing. The moment the craft loaded in the wobbling became UNBEARABLE. It was so bad I couldn’t even click on the vessel to activate the tether because the camera was freaking out so much. When I uncoupled the pod without the ground tether being activate, it was flung off into space at three times the speed of light.

                This was incredibly disheartening, however I didn’t give up. After a few more tries using different techniques (this time I actually decided to extend the physics range), well it still didn’t work but something interesting happened. After the elevator loaded up the intense forces of the wobbling elevator broke the connection to the pod and flung it off into space, however instead of being flung at super luminal speeds, it ended up in a sub orbital trajectory.

                This, I thought, was very promising. It could mean that the game was actually properly calculating the orbital speed of the vessel, or perhaps the speed was being generated entirely by the flinging. I had to find out. So I decided to change my approach. Instead of putting something on the top of the elevator and uncoupling it, I would load in the regular elevator and tether it to the ground, build a ship with a grabber claw on it, fly it all the way to the top, and forcefully dock with it. Then, I would undock to see what would happen.

Are you familiar with the "deep space kraken"? Physics calculations in Unity are performed in 32 bits, so past about 6 km there are rounding errors when working with the positions of things. The "krakensbane" bug fix addressed this by creating a small bubble in which physics happens, that moves with (I think) the root part or the center of mass of the active vessel, and the physics range is the size of that bubble. So increasing the physics range will make more vessels active, but the farther away ones will be subject to rounding errors in their physics, and the farther they are the worse it gets. That's probably your biggest obstacle at this point; effectively you've turned off krakensbane. The geostationary space station seems like a fair way to simulate it to me.

Link to comment
Share on other sites

1 minute ago, HebaruSan said:

Are you familiar with the "deep space kraken"? Physics calculations in Unity are performed in 32 bits, so past about 6 km there are rounding errors when working with the positions of things. The "krakensbane" bug fix addressed this by creating a small bubble in which physics happens, that moves with (I think) the root part or the center of mass of the active vessel, and the physics range is the size of that bubble. So increasing the physics range will make more vessels active, but the farther away ones will be subject to rounding errors in their physics, and the farther they are the worse it gets. That's probably your biggest obstacle at this point; effectively you've turned off krakensbane. The geostationary space station seems like a fair way to simulate it to me.

Ah that definitely makes sense. That would also explain why sometimes the wobbling would be ridiculous and other times it would be manageable. Also yeah, I think breaking it up into two parts is about the best you can do, though it disallows you from moving kerbals into orbit.

Link to comment
Share on other sites

May I point out that synchronous orbit on Gilly is only 42 km.

As to the ground disappearing, as mentioned, sounds like something with PQS, and switching to scaled space view.

I suggest trying this on Gilly, just to see if its possible and behaves as expected.

Or mod kerbin to spin super fast, with a short atmosphere, so that KSO is like 25 km high.

It should work. Ksp calculates orbital and surface velocity. Its easy to make a mod planet where things are flung off the surface because it spins so fast.

Link to comment
Share on other sites

I have a space elevator design, but I haven't test it due to the insufficient performance of my computer. It is unable to transport stuff from ground level to orbit, but still able to launch rocket from it's summit (I haven't tested how it behaves though). Here's what I've planned:

1. This plan requires Physics range extender mod. Also, Extraplanetary launch pad mod (build rockets on another celestial body by using on-site mining). It takes the advantage of the ore mining feature for building rockets. Additionally it also requires Vessel mover mod (move and spawn vessel-in game) if the elevator is going to be placed elsewhere (even on another planet). This last one is optional, though without it, it's restricted to default runway or launch pad

2. The plan uses the exploit that fairings can be built infinitely long and it will act as a single rigid entity (no structural instability on fairing no matter how large and how long it is). The elevator is divided into 3 components: ground level, connecting tether and orbital facility

3. The ground level consists of a series of drills, batteries, radiators, ore tanks, anything required for mining operation. This will be the main ore mining facility for building rockets on the elevator's summit. On the top of the ground level facility, is a fairing that extends all the way beyond the atmosphere. To keep the whole thing stable, the launch clamps are attached on the fairing, not the ground facility (the facility hangs under the fairing, mining ore while the fairing itself is supported by launch clamps)

4. The connecting tether is a fairing that extends all the way beyond kerbin's atmosphere (70km high). I haven't found a way to directly edit the fairing length by simply typing the number instead of building it manually (which is time consuming), but an extremely long fairing is a rigid structure that counts as a single entity, making it very good for long structural element

5. The orbital facility consists of habitation modules, solar arrays, labs, comms array and stuff that you would attach to space stations. It must be symmetrical to keep whole thing balanced. It provides power for ground level facility and also houses the manufacturing module of extraplanetary launch pad and it's spawn point on top center. Basically, since the whole elevator counted as a single craft, the elevator works by mining the resource on ground level, then using it to build rockets that spawns at orbital facility (so in essence, while it's unable to send stuff physically from the ground, it does send the resource mined from the ground to be used on the orbit)

Feel free to comment about it

Edited by ARS
Link to comment
Share on other sites

1 hour ago, ARS said:

I have a space elevator design, but I haven't test it due to the insufficient performance of my computer. It is unable to transport stuff from ground level to orbit, but still able to launch rocket from it's summit (I haven't tested how it behaves though). Here's what I've planned:

1. This plan requires Physics range extender mod. Also, Extraplanetary launch pad mod (build rockets on another celestial body by using on-site mining). It takes the advantage of the ore mining feature for building rockets. Additionally it also requires Vessel mover mod (move and spawn vessel-in game) if the elevator is going to be placed elsewhere (even on another planet). This last one is optional, though without it, it's restricted to default runway or launch pad

2. The plan uses the exploit that fairings can be built infinitely long and it will act as a single rigid entity (no structural instability on fairing no matter how large and how long it is). The elevator is divided into 3 components: ground level, connecting tether and orbital facility

3. The ground level consists of a series of drills, batteries, radiators, ore tanks, anything required for mining operation. This will be the main ore mining facility for building rockets on the elevator's summit. On the top of the ground level facility, is a fairing that extends all the way beyond the atmosphere. To keep the whole thing stable, the launch clamps are attached on the fairing, not the ground facility (the facility hangs under the fairing, mining ore while the fairing itself is supported by launch clamps)

4. The connecting tether is a fairing that extends all the way beyond kerbin's atmosphere (70km high). I haven't found a way to directly edit the fairing length by simply typing the number instead of building it manually (which is time consuming), but an extremely long fairing is a rigid structure that counts as a single entity, making it very good for long structural element

5. The orbital facility consists of habitation modules, solar arrays, labs, comms array and stuff that you would attach to space stations. It must be symmetrical to keep whole thing balanced. It provides power for ground level facility and also houses the manufacturing module of extraplanetary launch pad and it's spawn point on top center. Basically, since the whole elevator counted as a single craft, the elevator works by mining the resource on ground level, then using it to build rockets that spawns at orbital facility (so in essence, while it's unable to send stuff physically from the ground, it does send the resource mined from the ground to be used on the orbit)

Feel free to comment about it

Your design is 100% possible. I don't think there's any need to use fairings as a tether either, as I assume fairings are a physicsless object, and you can just edit a better looking tether to be physicsless instead. Since your tower would only stretch up less than 100km it would work, but launched crafts from the top would still need deltaV to get into orbit, just a lot less than normal. Also if performance is an issue I'd recommend using partwelder to keep your elevator down to the minimum amount of parts. At most, I'd say it would have to consist of the base, shaft, station, to solar arrays, and one EL launchpad, so just five parts. Remember, if you want to use part welder you have to use version 3 of module manager.

 

4 hours ago, KerikBalm said:

May I point out that synchronous orbit on Gilly is only 42 km.

As to the ground disappearing, as mentioned, sounds like something with PQS, and switching to scaled space view.

I suggest trying this on Gilly, just to see if its possible and behaves as expected.

Or mod kerbin to spin super fast, with a short atmosphere, so that KSO is like 25 km high.

It should work. Ksp calculates orbital and surface velocity. Its easy to make a mod planet where things are flung off the surface because it spins so fast.

Gravity is so low on Gilly I think a space elevator would just be redundant, as you could literally just land a 4km long freighter on it like it was nothing. It's also so misshapen I'm not sure where the best place to put the base would be. Still, it is a good consideration to keep in mind.

Link to comment
Share on other sites

Personally I like mag lev launchers.  One mag lev launches straight up.  A second mag lev in orbit accelerates/decelerates depending on perspective into orbit.  The second mag lev then reboosts its orbit using ion or other exotic high efficiency thrusters preferably nuclear powered or ground based laser powered.

As part of a collage project I did the calculations for a carbon nanotube static space elevator with no margin would require 2 ropes weighting a total of 638 kt and would only be able to lift 50 kg into geostationary orbit.  It had a max width of 62 cm

Edited by Nich
Link to comment
Share on other sites

  • 3 weeks later...
On 6/10/2019 at 2:03 PM, HippieGold said:

there's practically no limit to the sort of stuff you can build,

Save for CPU speed of course. TBH I have a high-tier machine and with 200+ mods performance is "not great, not terrible". Imagine what a few hundred trusses would do to fps!

With that put behind us: if the idea is proof of concept, I dont think anybody would mind a lot of alt+12. Build a elevator tower segment with detacheable RCS and alt+12 piece by piece. 

Edited by Daniel Prates
Link to comment
Share on other sites

  • 2 weeks later...

The shaft is the easy part. I did it 3 ways.

1. Create it in Blender and make it 60000m high.

2. Create a 20m shaft in Blender and scale it in Unity by 3000.

3.  I was able to adapt the code in linuxgurugamer's NRAP mod and created a shaft you could scale to any height.

I then created a shuttle that could move up the shaft and that's where I had problems. After a point the games blows up with the following log entries:

I'm not sure what is causing the problem PRE or just game mechanics.

Errors

Video

BTW: I'm not much of a modeler or a coder.

Just FYI it was interesting getting to this point.

Link to comment
Share on other sites

7 hours ago, uscespc said:

The shaft is the easy part. I did it 3 ways.

1. Create it in Blender and make it 60000m high.

2. Create a 20m shaft in Blender and scale it in Unity by 3000.

3.  I was able to adapt the code in linuxgurugamer's NRAP mod and created a shaft you could scale to any height.

I then created a shuttle that could move up the shaft and that's where I had problems. After a point the games blows up with the following log entries:

I'm not sure what is causing the problem PRE or just game mechanics.

Errors

Video

BTW: I'm not much of a modeler or a coder.

Just FYI it was interesting getting to this point.

Well, you are getting a division by zero or some other math accident on the code!

rPos: [NaN, NaN, NaN]   rVel: [NaN, NaN, NaN] |NaN|
Delta: [NaN, NaN, NaN] / [NaN, NaN, NaN]

The problem happened at 1.000 meters apparently. And I think it can be related to the 3D World rendering instead of the physics engine - something happens at 1.000 meters. But without the code, it's a blind guess - with the code we will be guessing too, but at least we would be seeing what we are guessing. :)

— — — POST EDIT — — —

I run a small test: got a rocket, activated the infinite fuel cheat and launch it with the smallest vertical velocity I managed to set - of course, with SAS activated and keeping the nose straight up (at 90° marker on the Navball).

You will notice that the ship will "drift" to west slowly. This is Kerbin rotating under you - winds are not simulated on KSP.

Division by zero happens when the dividend gets smaller and smaller until you have a underflow and the float is "rounded" to zero. Assuming this is what happened on the code, something that never goes to zero is... going to zero, and then things go through the tubes.

One thing that is never zero once you are flying are the angular speed of Kerbin. Since KSP "centers" the universe around your ship (i.e., everything moves around you for simulating you moving around - this is a trick needed due Unity using floats and not doubles on the physics  - something needed as GPUs are tremendously faster handling floats than handling doubles), Kerbin is not moving under you when you are landed - but once you are flying, this is something that cannot be zero.

Ok, this is a wild, blind guess. But it's something to start looking into the problem. :)

Edited by Lisias
Wild guessing — and tyops!
Link to comment
Share on other sites

21 hours ago, Lisias said:

Well, you are getting a division by zero or some other math accident on the code!


rPos: [NaN, NaN, NaN]   rVel: [NaN, NaN, NaN] |NaN|
Delta: [NaN, NaN, NaN] / [NaN, NaN, NaN]

The problem happened at 1.000 meters apparently. And I think it can be related to the 3D World rendering instead of the physics engine - something happens at 1.000 meters. But without the code, it's a blind guess - with the code we will be guessing too, but at least we would be seeing what we are guessing. :)

— — — POST EDIT — — —

I run a small test: got a rocket, activated the infinite fuel cheat and launch it with the smallest vertical velocity I managed to set - of course, with SAS activated and keeping the nose straight up (at 90° marker on the Navball).

You will notice that the ship will "drift" to west slowly. This is Kerbin rotating under you - winds are not simulated on KSP.

Division by zero happens when the dividend gets smaller and smaller until you have a underflow and the float is "rounded" to zero. Assuming this is what happened on the code, something that never goes to zero is... going to zero, and then things go through the tubes.

One thing that is never zero once you are flying are the angular speed of Kerbin. Since KSP "centers" the universe around your ship (i.e., everything moves around you for simulating you moving around - this is a trick needed due Unity using floats and not doubles on the physics  - something needed as GPUs are tremendously faster handling floats than handling doubles), Kerbin is not moving under you when you are landed - but once you are flying, this is something that cannot be zero.

Ok, this is a wild, blind guess. But it's something to start looking into the problem. :)

Finally got one to work.

In version 1 the shuttle was rigidly constrained by the shaft, version 2 uses a 4x4 hollow shaft with a 3.5x3.5 shuttle in the middle allowing for drift.

As the shuttle goes up it will drift back and forth but doesn't crash the game.

I'm also using this code in FixedUpdate:  (have to test if removing makes a difference)

 part.Rigidbody.angularVelocity *= 0;
 vessel.angularMomentum = Vector3.zero;

Here's a pic at 59.5Km (I stopped there to test stopping)

 

 

 

 

 

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