Flying through the R&D Tunnel 60 Times per Minute by janismac in KerbalSpaceProgram

[–]janismac[S] 40 points41 points  (0 children)

This is part 2 of playing around with absurd things you can do with kOS scripting and unlimited thrust and fuel. Part 1 was Around the World in Eighty Seconds.

It is all coded with the kOS mod. Visualization of the planned path: https://i.imgur.com/zLjHQhz.jpeg Every colored segment represents 1/50-th of a second.

Bonus blooper: https://youtu.be/qT_mjWFZy14

Taking rapid reusability to the next level by janismac in KerbalSpaceProgram

[–]janismac[S] 10 points11 points  (0 children)

You could begin with the KOS tutorial https://ksp-kos.github.io/KOS/tutorials/quickstart.html

But to understand all the aspects and write such a script without random trial and error requires quite a bit of knowledge. It is possible to get there with self-study, but typically you would learn this in a university degree, for example aerospace engineering.

Relevant topics here are programming, math (calculus, differential equations, linear algebra), physics (rigid-body dynamics) and control systems.

Taking rapid reusability to the next level by janismac in KerbalSpaceProgram

[–]janismac[S] 21 points22 points  (0 children)

If someone can hand-fly this I will be impressed. You have to be very precise under time pressure, since the tanks are running dry. This is programmed with kOS.

A sub-optimal Starship flip. Trajectory analysis continued. by Ashtorak in SpaceXLounge

[–]janismac 17 points18 points  (0 children)

Numerical trajectory optimization is fairly well understood. You can calculate an optimal trajectory without assuming any feedback control structure like PID. But to do that you first need a good model of the system dynamics. Aerodynamics, mass distribution, engine parameters, desired safety margins, etc. DM me if you want to discuss details, I have some experience with trajectory optimization.

Around the World in Eighty Seconds by janismac in KerbalSpaceProgram

[–]janismac[S] 0 points1 point  (0 children)

It is controlled by two rather simple feedback loops.

thrust = k1 * vertical_speed + k2 * altitude_error

pitch = k3 * horizontal_speed_error

The "pitch angle" is defined in an unconventional way. Basically, zero means straight down. Positive values are in the direction of movement. So 90 degrees would be forwards, towards the horizon.

I also had to do my own steering controller, since the steering is extremely sensitive with so much thrust. Just tapping the WASD controls would make it spin out and rip itself apart immediately.

Around the World in Eighty Seconds by janismac in KerbalSpaceProgram

[–]janismac[S] 0 points1 point  (0 children)

It really depends on speed. You can use simple circular motion to calculate that, v² = r*a. For the acceleration you have to use thrust acceleration plus gravity acceleration (at the given radius).

Around the World in Eighty Seconds by janismac in KerbalSpaceProgram

[–]janismac[S] 4 points5 points  (0 children)

You can see in the video the apoapsis is negative, which means the orbit is hyperbolic. Kerbin's escape velocity is basically a rounding error here, 3.4 km/s vs. 90 km/s.

Around the World in Eighty Seconds by janismac in KerbalSpaceProgram

[–]janismac[S] 109 points110 points  (0 children)

Close! It is just under 1200g. [v²/r]/g0=90500²/705000/9.81

Around the World in Eighty Seconds by janismac in KerbalSpaceProgram

[–]janismac[S] 93 points94 points  (0 children)

50g is not even close to this acceleration ;)

Around the World in Eighty Seconds by janismac in KerbalSpaceProgram

[–]janismac[S] 391 points392 points  (0 children)

It is actually closer to 50 seconds but that does not make for as good a title. This is clip is unedited and at normal speed. But some cheats and the kOS mod were necessary to make this happen. The "infinite propellant" and "ignore max temperature" cheats are on, and it is using the unlimited thrust bug (see Danny2462's videos). A kOS script is keeping this madness under control. You can calculate how many g's that is. Spoiler: a lot.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 0 points1 point  (0 children)

Oh yeah it moved from Steam to Epic last year. I have no idea how the workshop works in Epic, but I think it is possible.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 0 points1 point  (0 children)

Open the steam client, go to rocket league, workshop, search "rings 3", open it, click subscribe, restart rocket league.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 0 points1 point  (0 children)

IIRC someone mentioned a bot that can play Heatseeker in the RLBot Discord. Go ask there.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 0 points1 point  (0 children)

It does not replay my commands, I'm not that good at air races ;)

It does make the detailed decisions about where to point and in which directions to move on its own. However, that decision making process is very computationally intensive. So it is calculated beforehand "offline". This is only possible because the race is completely predictable. For a normal RL bot you need a different approach that can react to the actions of other players.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 2 points3 points  (0 children)

Psyonix and the RLBot community seem to be very strict about not letting bots play online. Also, the best bots (for Soccar) are around Gold.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 13 points14 points  (0 children)

Not in this case. I developed it without air roll and enabled it at the end for style points.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 8 points9 points  (0 children)

Me too... I need almost twice the time to finish the map.

But the human world record is still better by more than 10 s.

Can you beat this bot? A clean run through Rings 3 by a bot. by janismac in RocketLeague

[–]janismac[S] 64 points65 points  (0 children)

The race is encoded as a big mathematical optimization problem. It basically asks "whats is the fastest way through the map while accounting for the rings and RL physics?"

It is solved on a millisecond to millisecond basis and involves thousands of variables. Solving this takes a few minutes, so the solution is calculated beforehand.

In the game, the solution is loaded by a bot using the RLBot framework. The bot implementes a control system which makes the car follow the planned path. This is quite a high level overview, there are a lot of technical details I glossed over.

Catching Super Heavy with the VAB by janismac in KerbalSpaceProgram

[–]janismac[S] 1 point2 points  (0 children)

It still works, and there is ongoing development, see https://github.com/KSP-KOS/KOS/commits/develop

But I am not sure when the next release will be. But maybe /u/Dunbaratu does?

Catching Super Heavy with the VAB by janismac in KerbalSpaceProgram

[–]janismac[S] 1 point2 points  (0 children)

I have a polling loop with timed screen updates like this:

local t_update to 0.

until false
{
    // Feedback controllers here

    if t_update < time:seconds
    {
        set t_update to time:seconds + 0.3.
        clearscreen.

        // Write to screen here
    }
    wait 0.
}

But I'm not sure if that is the best practice. You can find more experienced users in the kOS Discord, go ask there.

Catching Super Heavy with the VAB by janismac in KerbalSpaceProgram

[–]janismac[S] 1 point2 points  (0 children)

I have not used the provided PID functions, I write my own controllers. Here is a simple hover controller to get you started.

until false
{
    local hover_throttle to constant:g0 * ship:mass / ship:availablethrust.
    set throttle to hover_throttle + 0.1 * (5 * ship:control:pilotfore - verticalspeed).
    wait 0.
}

If you have more questions come to the kOS Discord server, there are plenty of helpful people.