Jump to content

[1.12.x] KRASH - Kerbal Ramification Artificial Simulation Hub (simulation mod for KSP) - Cost settings have been change


linuxgurugamer

Recommended Posts

This mod includes version checking using MiniAVC (http://forum.kerbalspaceprogram.com/threads/79745)
If you opt-in, it will use the internet to check whether there is a new version available. Data is only
read from the internet and no personal information is sent. For a more comprehensive version checking 
experience, please download the full KSP-AVC plugin (http://forum.kerbalspaceprogram.com/threads/79745">KSP-AVC Plugin)

KRASH lets you launch flights from the VAB\SPH, and when the flight is over, it restores the game to the exact state that 
it was in before the simulation started. It handles restoring the state of any mod which stores its data in the vanilla 
persistence file (basically any of them worth their salt), and even handles it if you exit the game during a simulation.

Reviewed by KottobasGames

The new version for KSP 1.4.1 has new dependencies:

New Dependencies

CKAN has been updated to install the dependencies, if needed.

Mod available from:  https://spacedock.info/mod/302/KRASH - Kerbal Ramification Artifical Simulation Hub (simulation mod for KSP)
Source:  https://github.com/linuxgurugamer/KRASH

License:  MIT, portions are covered by GPLv3 (specified in header)

Patreon.png

https://www.patreon.com/linuxgurugamer
 

Instructions

There is now a configuration screen.  It is available both in the Spacecenter and the VAB/SPH.  Click on the SIM button in the SPH, to access the configuration screen in the VAB/SPH right-click on the SIM button.  It brings up the following screen:

L8wizbv.png

There are a number of pre-defined configs, associated with the type of career you are playing.  The asterick to the left of the name indicates that it is a pre-defined config and cannot be changed.

The first set have costs which are calculated based on the number of parts and weight of the vessel, and are the defaults used if you don't select a config.  The second set (with the percent sign) calculate costs based on the cost of the vessel.  While the pre-defined configs don't mix the percentage and per-part/per-ton cost calculations, you can use all if you like.

Click the config you want to use.  You can make adjustments before accepting & saving.

The buttons do the following:

Save - Saves the config using the specified name.  You cannot save a config with an asterick in the first character, the button is disabled in this case

Accept - Use the selected config without saving it.  Note that if you selected one of the pre-defined configs and made changes, the changes will only be there for the duration of the current game, so be sure to change the name and save it if you want to keep it.

Reset - Resets all the values to the last saved config

Cancel - Resets and closes the screen

Delete - Delete the selected config.  You cannot delete a pre-defined config, the button is disabled in this case

 


In the VAB/SPH, load the ship you want to simulate
Click the SIM button, you will see the following screen:

JqtJscE.png

The buttons at the top select the starting location, and are as follows:

Kerbin - The homeworld of the game.  If you are running a mod which changes the homeworld, it will be shown here
Landed - Start sim landed on any planetary body
Orbit Selection - Start sim in an orbit around any planetary body

In career mode, if you haven't reached a planetary body, you won't be able to start the sim there

Starting sim at Kerbin
You will be able to start the sim either at the Runway or the Launchpad.  Selected which one you want,see this screen:

JqtJscE.png

Starting sim Landed
There is a row of buttons which will allow you to filter the displayed planetary bodies by either planets, moons, or all.
Select the planetary body you want to start the sim at from the displayed list.  Also, 
enter an altitude where the vessel should be started at.  You can also enter the Latitude 
and Longitude for the starting location.  It will start there, and very 
slowly descend until it touches the ground.  See the following screen for details:
LYyU4PR.png

Starting sim in Orbit
There is a row of buttons which will allow you to filter the displayed planetary bodies by either planets, moons, or all.
Select the planetary body you want to start the sim at from the displayed list.  Also, 
enter an altitude where the vessel should be started at.  Note that when you select a body, the
altitude will be automatically adjusted to be just outside the atmosphere if it has one, or
at an altitude of 10000m.  You can override it with whatever values you want.
bsSzXEa.png

Click the big green button to start the simulation

IMPORTANT NOTE:  If you are running RemoteTech, be sure that ALL your antennas are set to start retracted,
otherwise they will be ripped off during the teleportation process.

During the simulation, everything works normally, except you can't go to the Space Center.  Hitting the Escape key
will bring up the Simulation menu, see the following screenshot:
EWNWtqc.png

At this menu, you can either restart the simulation, or terminate the simulation and return to the editor.

In the event of either a game crash during the simulation, or exiting the program, restarting the game will restore 
the game to the point just before you started the simulation.

When the simulation is terminated, you will see the usual flight history dialog before the final revert.

When playing in career mode, there is some additional functionality:

  1. Simulations now cost money (ie:  computer time = money).  The cost of the simulation consists of several parts:  A flat cost, a per-part cost and a per-ton cost.  These costs  are calculated for an initial setup cost, and a per-minute cost.  The costs for the simulation  differs based on the level of game you are playing.  Easy, Normal, Moderate, Hard and Custom.  The costs are defined in the KRASH.cfg file, and can be changed if desired  The estimated simulation costs are shown while you are setting up the simulation in the  lower right-hand column.  You can also enter an upper limit for the simulation costs.  When the simulation costs equal  the specified limit, the simulation will end.
  2.  Simulations will terminate if one of the following situations happens:
  •             Simulation terminated due to lack of funds
  •             Simulation terminated due to cost limit reached
  •             Simulation terminated due to lack of science data
  •             Simulation terminated due to entering unknown SOI
  •             Simulation terminated due to landing on unknown body
  •             Simulation terminated due to vessel destruction

The following image shows the entry field for limiting the simulation costs (at the lower-right):

FESErxw.png

Changelog

0.2.0 initial release

0.3.0

  Fixed Cancel button to cancel the sim
  Fixed "Simulation Active" message not being displayed during sim
  Disabled Quicksave and Quickload functions

  New Features:
  Simulation costs added for career mode
  Sim-to-date costs shown along left side of the screen
  Configuration file added. See the config file for explanations:
   flatSetupCost
   flatPerMinCost
   flatSetupCost
   flatPerMinCost
   perTonSetupCost
   perTonPerMinCost
   AtmoPerMinMultipler
   ContinueIfNoCash
   TerminateAtSoiWithoutData
   TerminateAtLandWithoutData
   TerminateAtAtmoWithoutData
   MaxAllowableSimCost
   DefaultSimTime

  Config file enhanced with with nodes for each career type.  Top of
  the config file are the basic values, the values in the nodes override
  the basic values (if present).

  API added for modders
  Ability to limit total simulation costs
  Termination modes added for career:
   Simulation terminated due to lack of funds
   Simulation terminated due to cost limit reached
   Simulation terminated due to lack of science data
   Simulation terminated due to entering unknown SOI
   Simulation terminated due to landing on unknown body
   Simulation terminated due to vessel destruction

0.3.1

Disable view of costs when not in career mode
Fix sandbox & science mode (wasn't starting at all)

0.3.2

When in Pause menu, game is not paused even though menu is up
Switching to another craft causes Pause menu to fail
In sandbox, go to another planet, then return and start career game, that last planet is still available
Make simcosts text larger
Decimal points not being accepted at end of number for lat/long

0.4.0

Reduced starting costs by 90% based on feedback
Added % of initial ship cost to cost structure
Added description to cfg file
Added new cfg file for custom settings
Added abililty to relocate running costs during sim, or not display altogether
Added dialog to pause when ship lands

Credits

KRASH is derived from HoloDeck by enneract.  Renamed at enneract's request
Portions taken from Hyperedit by khyperia

Edited by linuxgurugamer
Link to comment
Share on other sites

The following are the (current) known bugs. 

KNOWN BUGS

  1. In Career mode, after 1st sim, during subsequent sims the display of the costs during the sim will be overlayed when the pause menu is displayed

If you are replacing HoloDesk with KRASH, you should edit your save file(s) and remove the following lines:


 

    SCENARIO
    {
        name = HoloDeck
        scene = 5, 6, 7, 8
        SimulationActive = False
    }

It will eliminate some errors in the logs.

Likewise, if you remove KRASH, you should remove the following lines from the save file(s):

 

    SCENARIO
    {
        name = KRASH
        scene = 5, 6, 7, 8
        SimulationActive = False
    }
    SCENARIO
    {
        name = KRASHShelter
        scene = 5, 6, 7, 8
        SimulationActive = False
		(other lines here)
    }

But Holodeck and KRASH both insert a few lines there, for persistent data, and if you remove the mod, those like will cause a few harmless error messages in the logs

Edited by linuxgurugamer
Link to comment
Share on other sites

12 hours ago, ThaZeus said:

Nice to see a release! Any plans on makeing it cost funds to run sims? (Like in KCT)

Yes, next release, in a week or so

1 hour ago, Koverpk said:

@linuxgurugamer Yes I would like to know what are differences from KCT. 

Actually, once I get the costs into it, there really won't be much functional difference from what KCT does in it's simulation mode.  The KCT author is thinking of replacing the KCT sim mode with this once I get that done.

Edited by linuxgurugamer
Link to comment
Share on other sites

On 2/28/2016 at 8:57 AM, linuxgurugamer said:

The KCT author is thinking of replacing the KCT sim mode with this once I get that done.

Yep! For at least a little while I'll keep the KCT simulations available, but will start phasing them out and promoting the use of this mod instead. I expect the simulations will finally get some features that they've been needing by relying on an external mod instead of using the very outdated code in KCT.

Link to comment
Share on other sites

As a long-time Holodeck lover, I'm excited to try this. Looks very snazzy.

This would have made the testing for my Grand Tour ship much easier. I spent about 4 hours on Sunday night simulating things with Holodeck, where the very first thing I did upon launch was hyperedit things to other planets. :D

Link to comment
Share on other sites

On February 29, 2016 at 10:53 AM, magico13 said:

Yep! For at least a little while I'll keep the KCT simulations available, but will start phasing them out and promoting the use of this mod instead. I expect the simulations will finally get some features that they've been needing by relying on an external mod instead of using the very outdated code in KCT.

Kinda disappointed by this. Really trying to stop adding mods to my already massive install. But if that's the way you go I guess I have no choice :/ 

Link to comment
Share on other sites

1 minute ago, Svm420 said:

Kinda disappointed by this. Really trying to stop adding mods to my already massive install. But if that's the way you go I guess I have no choice :/ 

Just curious, but why is that? If you have X mods right now, and X+1 mods will make your game better then why would you stop doing it?

It can't be memory footprint as this mods' is very small, and will be mitigated in part by KCT's size presumably getting smaller with the removal of the simulation feature.

Link to comment
Share on other sites

4 hours ago, Draradech said:

Very nice. Using it to test my landers.

Bugreport: If you quicksave/quickload during a simulation, the Simulation Active Text vanishes, and KRASH prevents you from exiting the scene - you need to kill the game...

Oh.

hmmm.  I'll have to disable the quicksave/load.

Just in time for me to fix before releasing the next version

Thanks

Edited by linuxgurugamer
Link to comment
Share on other sites

11 hours ago, linuxgurugamer said:

Oh.

hmmm.  I'll have to disable the quicksave/load.

Just in time for me to fix before releasing the next version

Thanks

It would be better, if you can get it working with quickload. But I guess that will be difficult - you are using the stock revert which doesn't work after quickload, correct?

Link to comment
Share on other sites

Just now, Draradech said:

It would be better, if you can get it working with quickload. But I guess that will be difficult - you are using the stock revert which doesn't work after quickload, correct?

That would totally negate the reason behind this mod

Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

That would totally negate the reason behind this mod

Not necessarily. Sometimes there is quite a setup process involved before you get to the point where the actual mission simulation launches; it would at times be helpful to be able to revert to that state, instead of having to set up everything anew.

I'm not entirely certain how KCT handles the financial side of restarting the simulation, i.e. whether costs are additive, or a one time, up-front flat fee regardless of how many times you rerun the simulation. I suspect the latter, but I think both methods have their pros and cons.

I wouldn't mind an initial, fixed setup cost, and if there's a time based cost too, I don't see how repeated re-running of any phase of the sim would contradict the idea of simulating the running costs of a mainframe... the tricky part would be to keep the running total in memory while reverting the rest of the game.

Link to comment
Share on other sites

15 minutes ago, linuxgurugamer said:

Quickload can totally bypass simulation code.  As of now, simulations start from the Editor.  A future update will probably allow simulations starting in flight, which would probably do what you need/want.

What I was thinking of was configuring parts that you can't do in the editor, like setting up kOS, Remote Tech, Infernal Robotics etc., or getting to a certain state in the flight from where you start the interesting part; merely starting in flight wouldn't necessarily help with that.

Maybe if KRASH would keep track outside the game state, in its own data file, it could "remember" the running cost regardless of a reload. Of course that would completely contradict the approach of keeping all relevant information inside the .sfs file. I'm not convinced that would be worth it, but on the other hand, I'd like to see an option to allow quick-saves; I mean, who defines what constitutes "cheating"... if I decide I'm fine with that, I'd like to at least have the option to conscientiously do so.

 

EDIT: Just a thought... if it were possible to intercept the quick load function, it might be possible to manipulate the previous quicksave with updated information, and keep it all inside the sfs. Not saying it would be easy, or even worth the effort.

Edited by Corax
Link to comment
Share on other sites

would a way to configure things before starting the sim help?  ie:  You start the sim in the editor, it puts the craft where it is to start, and then pauses the game while you do your setup?  I'm not sure if this is doable, but i can look into it if it would  help

Link to comment
Share on other sites

27 minutes ago, linuxgurugamer said:

would a way to configure things before starting the sim help?  ie:  You start the sim in the editor, it puts the craft where it is to start, and then pauses the game while you do your setup?  I'm not sure if this is doable, but i can look into it if it would  help

It's not so much the time running, as having to repeat certain steps again and again before getting to the actual point of the simulation. It simply would help immensely to start the sim, set up all that needs setting up (that may or may not include launching and flying to a certain situation), and then be able to revert to that point to test different approaches, which IMO is the point of a simulation. Nothing stops me from "simulating" with the default KSP facilities of putting a craft on the pad, quicksaving, and returning to that quicksave at will.

I do like KCT's, and now your mod's, idea of having "proper" simulations within the framework of career mode, and would love to have the ability to "simulate" whatever initial conditions I need to set up. As it is now, neither KCT nor KRASH can provide that, and I understand the technical challenge. It doesn't break the mod for me if that isn't feasible, but it would be immensely helpful and in my opinion, realistic to be able to set initial parameters beyond what the editor provides.

Link to comment
Share on other sites

17 minutes ago, Corax said:

It's not so much the time running, as having to repeat certain steps again and again before getting to the actual point of the simulation. It simply would help immensely to start the sim, set up all that needs setting up (that may or may not include launching and flying to a certain situation), and then be able to revert to that point to test different approaches, which IMO is the point of a simulation. Nothing stops me from "simulating" with the default KSP facilities of putting a craft on the pad, quicksaving, and returning to that quicksave at will.

Ok, i understand what you are looking for.  But it's quite a challenge.  Don't hold your breath, but I'll look into it.

Link to comment
Share on other sites

2 hours ago, linuxgurugamer said:

Ok, i understand what you are looking for.  But it's quite a challenge.  Don't hold your breath, but I'll look into it.

No worries, as I said, this would be the icing on the cake.

Link to comment
Share on other sites

Quote

  Simulation terminated due to vessel destruction

This one troubles me. My Simulations keep geting terminatet a couple of seconds after launch, i'm not 100% sure, but maybe this is because the launchclamps get removed. Can you please take a look at this.

 

This little nuisance asaide i realy like this mod

 

 

 

Link to comment
Share on other sites

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