Jump to content

Creating programmed flight


Recommended Posts

Is it possible to create a programmed flight? I mean the programmed flight itinerary that would be run automatically and could be interrupted by the player, such as:

At 0 milliseconds start the solid engines.

At 30000 milliseconds drop the last stage and fire the liquid engines.

At 90000 milliseconds rotate to 270 degrees and decrease the thrust to 30%.

Is it possible (directly or with the SDK in .Net)? It would be nice to:

1) put it in a flight script (ie. written in notepad) or

2) create it similarly to visual combination of stages in VAB or

3) is it possible to create this automation in .Net via the SDK?

Thanks

Link to comment
Share on other sites

MechJeb's Autom8 module may be able to do that (it has a "fly me to the Mun" function...), but I can't tell you for sure.

Once flight plans and AI-piloted rockets are officially implemented, I guess we will have access to the necessary stuff to make our own flight programs.

Link to comment
Share on other sites

Man oh man, I would love flight programming. I used to play a lot of Omega (a cyber-tank programming game by Origin, back in the late 80s) and Carnage Heart, a similar Playstation 1 game from the 90s. I would lie awake at night, mentally sketching out code, and realize I was playing a computer game without needing a computer. How fun!

Anyway, I would be all over scripting robotic missions.

Link to comment
Share on other sites

I'm working on an Addon that can do exactly this. I called it the "flight computer"

The plan is that it executes simple statements like this:

Wait 20 # wait 20 seconds before liftoff
Trottle 100 #100% trottle
WaitAltitude 10.000 #Wait till we reach 10.000km
Trottle 75 #Trottle a bit down
WaitTillStageOutOfFuel
NextStage

I'm still implementing most of the commands, and I'm still learning how to do some stuff like setting the throttle from software.

Link to comment
Share on other sites

This would be really handy for photographers and videographers. If software is controlling the flight, the human can concentrate on composing beautiful images.

Can you make it so that the flight computer runs on a detached assembly? Folks have been hoping for a way to do that. For example, deorbit a second-stage booster, then activate a parachute at a certain speed or altitude.

Link to comment
Share on other sites

Cool, I thought I was the only one thinking about this. I'll start investigating how to implement this, and, if possible, write an addon or a request for KSP's devs.

Anyone who could direct me towards this (a link, e-mail etc) or needs help?

Link to comment
Share on other sites

Can you imagine a tandem launch with two craft flying in loose formation? That would be spectacular.

I think that will have to remain a dream for now. Running it on a detached assembly doesn't seem to work for now (outside of my capabilities)

Link to comment
Share on other sites

This would be an awesome feature/add on

A) Different types of triggers for events:

-Time event

-Location/altitude/pressure/speed

B) Ability to snap screenshots or pictures using the photo add-on, based on triggers stated above

Attempting to program a Curiosity style controlled landing would be awesome in KSP

Link to comment
Share on other sites

With MechJeb autom8, all of this is pretty much doable already. It takes Lua scripts, and has a bunch of functions to interface with MechJeb modules, as well as providing data about the spacecraft.

Here's the documentation on MechJeb wiki: http://wiki.mechjeb.com/index.php?title=Autom8

You can do almost all the things named in this thread:

  • Control most of MechJeb modules
  • Directly control the spacecraft (set heading, throttle)
  • Use time (wait(seconds)), MechJeb state (wait(mechjeb.free)) or spacecraft state (while loops checking for different parameters with a wait(1) inside) to time the actions you take

Upcoming in the update:

  • Manual throttle control (currently a bit broken)
  • Manual staging
  • possibly: access to ILS module for spaceplane automation

As you see, it's getting a nice functionality bump in the upcoming MechJeb update, so stay tuned :) The "Fly me to the Mun" script is a good example of what can be done, and I've written a "return from Mun" script that does something very similar to a free return trajectory, that I will publish once the new version is out.

Edited by olex
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...