Jump to content

Designing a mod for dynamic rail modification


Recommended Posts

I've posted once a while ago and am essentially quite new to the KSP modding community and process despite having had watched some video tutorials over the summer and trying to create some GUIs. I've also had experience in grade 11 and 12 computer science courses whereby my only 'crime' was over-complicating my 'program architecture' and being overly ambitious.

From what I know, as generic add-ons concentrate on the addition of new parts with new behaviours, models and characteristics to the game alongside auxiliary GUIs, plugins more so concentrate on making changes to the internal game mechanics and as per my case, the plugin I wish to begin developing aims to find ways to bypass the standard vessel 'rail assignment and junk management' mechanics to allow for management of multiple flights which when unfocused undergo physical approximation. I basically have been wanting to develop a mod called "Kerbal Civilizations" which allows me to perform highly physics, administration, resources and logistics oriented simulation of a functioning Kerbal civilization.

Questions:

To start off, does there exist much information out there on how one would set up code to interact with the game API and in ways 'hijack' control over the physics of a flying vessel? For example I'd imagine that in the development of FAR, a lot of work would have had to be done to be able to robustly apply alternative forces on vessel parts using separate or auxiliary physics processing code. Furthermore, what pointers could one give me towards exploring API interactions that would allow me to stop the stock game mechanics from deleting a vessel as debris or transferring it to rails when out of focus and far away? As in I want to be able to have dynamic code that allows multiple programmed autopilots (individual agents within the entire civilization automaton; to me most of this code logic can be implemented independent of the more confusing API interactions which are what I am having trouble with) to act upon the control surfaces of a physical vessel approximation flying on rails but not undergoing internal stresses. As in if I wanted to set up within my mod the ability to organize multiple land, sea and air logistics flights, the plugin would be able to manage approximated forces and constraints acting on the craft as it traverses the world whereby at any time you can resume focus on any one logistic vehicle and dynamically introduce any other approximations that fly close within the vicinity of the focused craft. Managing the success rates of 'approximated' landings would be the next step in this project.

So to conclude, this would in ways be the programming of the dynamic switching between vector point approximations of existing vessels and safe introduction into and suspension from 'focused' full physics game world processing. It would be as though I were implementing my own solution to switching between vessels while moving within the atmosphere. As per autopilots, I have yet to figure out how to program an agent to act upon vessel control surfaces unless this were as simple as scanning through and logging all parts in a vessel structure that I want to access, else I can look into using kOS to have ways to control crafts in focus with full physics simulation and out of focus on 'modded rails.' (As I'd imagine that normally, the game 'listens' to control inputs from the kOS program, my mod would probably transfer listening and try to best approximate the expected control feedback upon the vessel while on rails. Accurately approximated point masses with angle of attacks.)

How this may interfere with 'Kraken's Bane' for dynamic focus assignment may also be an issue.

Link to comment
Share on other sites

Best place to start with this would probably be the history of "on-rails" thrust mods such as this solar sail mod (alternatively Principia, while a much more complex mod, also deals with unfocused vessels). Somewhere in there will be the code for modifying the orbits of an on-rails craft and then you just need to work out how to apply it for your situations.

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