Quicksave Shenanigans

Astatium_209

Alliance’s Executor // Unstable and Toxic
MOTY 2021
TEAM HAWK
Moon Maker
Swingin' on a Star
Atlas
Deja Vu
Fly me to the Moon
Under Pressure
Copycat
Registered
#1
'ello 'ello,

I've been experimenting with quicksave editing to get a piston to work, specifically in the "joints" list that's in the rockets.txt file. The point was to be able to get some tight tolerances on sliding parts, which would have otherwise ended with the parts connected.

Joints are just lists of dictionaries which contain the indexes of the connected parts. If we want to connect the first and fifth part, the joint would look like this: {"a": 0, "b": 4}. That's all.

(This part may be incoherent, feel free to skip, and you have been warned)
Now, adjusting all of the connections manually would be a right pain in the neck, and as such, I made myself a python script that does it for me. To distinguish which parts belong to the piston and which to the housing, I used a, perhaps inelegant, but functional method of adjusting orientation values to a number that is unlikely to appear by course of normal part placing or manual bp editing, i.e. "o": {"x": 1.0} could be changed to "o": {"x": 0.991234}. Once the script is run, it's runs through the parts and identifies the indexes of parts of interest, at the same time assigning them to their proper connection groups. After this is done, the necessary joints are created. Certain joints will need to be disconnected, so we need to check for those and remove them if they appear.

Apon loading a quicksave into the world, the old joints will remain up until any separation event, during which the game goes through the joints and updates the craft.

Here's the result (Imgur link):
ezgif.com-gif-maker.gif

It's actually quite smooth, the gif compression makes the video stutter.

Here's a look inside the build screen:
1658908068655.png


I plan to use this on a lunar lander landing leg.
 

Mooncrasher

RCS rocket good
Staff member
Team Valiant
Voyager Quest
Man on the Moon
#2
That's a very impressive method of manipulation.:)
So much done with a script, without a mod.
 

Astatium_209

Alliance’s Executor // Unstable and Toxic
MOTY 2021
TEAM HAWK
Moon Maker
Swingin' on a Star
Atlas
Deja Vu
Fly me to the Moon
Under Pressure
Copycat
Registered
#3
I must say, I'm pleasantly surprised!

With a load test under perfect earth conditions (1g of acceleration), the piston can lift up to 170 tons semi-reliably with a lot of jittering, 125 tons without breaking a sweat. (This is cool because solar panels break very easily)

The "Arrows" fuel tank has its fuel level set to 100.0, which corresponds to about 169.3t in weight. The performance should be the same in the opposite orientation.
Load Test.gif


Needless to say, if you try such a load test horizontally, without a rail for the pushed mass, your piston will suffer from a severe case of "the bends" :p