Jump to content

[1.9.*] GTIndustries (Updated 04-02-2020)


Warezcrawler

Recommended Posts

GTIndustries (GTI) have spend their entire budget on R&D. The results are five new products (plugins).

  • GTI MultiModeEnginesFX
  • GTI MultiModeEngines
  • GTI MultiModeIntakes (MM included)
  • GTI MultiModeConverter (MM included)
  • GTI MultiModeHarvester (MM included)

Features of GTI MultiModeEngine & GTI MultiModeEngineFX:

  • GTI Multi Mode Engines
  • Select which engine ID to affect
  • Availability (Flight, Editor)
  • Propellants, Ratios, IgnoreForISP, DrawGauge etc. is set up like stock through the alternative ModuleEngineFX modules
  • Custom naming of Engine configuration
  • Set Engine Type [LiquidFuel, Nuclear, SolidBooster, Turbine, MonoProp, ScramJet, Electric, Generic, Piston]
  • Thrust
  • Heat production
  • Curves: atmosphereCurve, velCurve, atmCurve
  • throttleISPCurve (GTI MultiModeEngine only)

Features of GTI MultiModeIntakes:

  • Switching between "ModuleResourceIntake" defined in the part
  • Switch intake resource (resourceName) when the intake switches
    • Can be disabled by setting preserveResourceNodes to true.

Features of GTI MultiModeConverter:

  • Switching between all the different "ModuleResourceConverter" in the part.
  • Compatible with USI Converters as well because they inherit from the stock module.

Features of GTI MultiModeHarvester:

  • Switching between all the different "ModuleResourceHarvester" in the part.
  • Compatible with USI Harvesters as well because they inherit from the stock module.

 

How-to add: (There are no parts added with GTI Utilities, this is intended for use in other mods)

Spoiler

Add a module to the engine you wish had multiple configurations. These could be different propellants, different ISP etc. like stock switcher

I've tried to comment as best I could in the CGF as well as in the module coding.


For moduleEnginesFX: insert the following module (example)
    MODULE
    {
        name = GTI_MultiModeEngineFX
        engineID = AirBreathing;AtmBreathing;ClosedCycle;ClosedCycleDarkGoo
        GUIengineID = Air Breathing;Atmosphere Breathing;Rocket;Dark Goo Fusion
        
        availableInFlight = true
        availableInEditor = true
    }

For moduleEngines:

    MODULE
    {
        name = GTI_MultiModeEngine
        
        messagePosition = UPPER_RIGHT
        availableInFlight = false
        availableInEditor = true
        
        GUIengineModeNames = Liquid Fuel & Oxidizer;Liquid Fuel & Intake Oxygen
        EngineTypes = LiquidFuel;LiquidFuel
        
        propellantNames = LiquidFuel,Oxidizer;LiquidFuel,IntakeAir
        propellantRatios = 0.9,1.1;0.9,1.1
        propIgnoreForISP = False,False;False,True
        propDrawGauge = True,True;True,False
        resourceFlowMode = STAGE_PRIORITY_FLOW,STAGE_PRIORITY_FLOW;STAGE_PRIORITY_FLOW,STAGE_PRIORITY_FLOW

        useEngineResponseTime = False;True
        engineAccelerationSpeed = 0;1.1
        engineDecelerationSpeed = 0;1.5
        
        //atmChangeFlows =
        useVelCurves = False;False
        useAtmCurves = False;False
        useGTIthrottleISPCurves = False;False

        maxThrust = 650;650
        heatProduction = 350;600
        

       //Curves supported are --> atmosphereCurve, velCurve, atmCurve, throttleISPCurve
       //It is important that the number of curves corresponds to the number og engine modes! Otherwise they will be ignored
        atmosphereCurve
        {
            key = 0 320
            key = 1 280
            key = 6 0.001
        }
        atmosphereCurve
        {
            key = 0 1800
            key = 1 950
            key = 6 150
        }
    }

For AirIntakes:

    MODULE
    {
        name = GTI_MultiModeIntake

        availableInFlight = true
        availableInEditor = true
        
        preserveResourceNodes = false;        //For warpplugin compatibility. Set it to true to force all resources to remain in all scenarios.
    }

For converters

    MODULE
    {
        name = GTI_MultiModeConverter
        
        availableInFlight = true
        availableInEditor = true
    }

Pictures:

Spoiler

KrpEb6f.jpg

Fe77XKa.jpg?1       1U6mD0T.jpg?1

SFsMm5Y.jpg

AwIsyq2.jpg

Download:
Download from GitHub (including the source code)

Download from SpaceDock
 

Example Engines:

Spoiler

Based on feedback, I have created 3 engines as a showcase of this mod. It is best used with Smokescreen and IFS, and moduleManager is as for most mods a need to have.

Get the parts here

The engines are as follows

  • CR-13 R.A.P.T.O.R. Engine
    • Based on stock RAPIER engine
    • 4 mode engine
      • Air Jet engine
      • Atmosphere engine, capable of flying on other Atmospheric worlds without oxygen - it is less efficient than air jet, but still much better than rockets
      • Closed Cycle aka Rocket mode slightly more powerfull and efficient than RAPIER
      • DarkGoo Fusion, this runs on a combination of LiquidFuel and Xenon Gas (substitute for DarkGoo) - highly efficient mode, lower thrust and very bad performance in atmospheric environments
  • NRX "KINKI" Atomic Rocket Propulsion
    • Based on stock Atomic Engine
    • Needs SmokeScreen to work
    • 3 modes
      • Normal - compares to normal nuclear engine
      • High Velocity - is high efficiency mode at lower thrust, more heat and bad performance in atmospheric environments
      • Over Drive - boosted thrust, better performance in atmospheric environments, but much lower max ISP.
  • GTI-2020 "Icicle" Multi Electric Propulsion System
    • Based on the Stock Ion Engine
    • 3 modes
      • Normal - compares to normal nuclear engine
      • High Velocity - is high efficiency mode at lower thrust, more heat and bad performance in atmospheric environments
      • Over Drive - boosted thrust, better performance in atmospheric environments, but much lower max ISP.

 

Credits to Nazari for effects from HotRockets which I use. These demand SmokeScreen to work.

Dependencies: (separate downloads)
Module Manager by sarbian which is under a "CC share-alike license"

Changelog:

Spoiler

15-02-2020

- No change- Fully Compatible with v1.9.0 as is

04-02-2020

- Recompile for v1.8.1

19-03-2018 v2.5.1

- Minor fix for IntakeAtm resource patch

18-03-2018 v2.5

- Recompile for KSP 1.4.1
- Fixed bug, where harvester and converters where accessible even before being extended
- Fixed bug where IntakeAtm was missing if Community Resource Pack was not installed (indirect dependency removed)
- Other various stuff

04-02-2018 v2.4

- Recompiled for KSP 1.3.1

05-06-2017 v2.3

- Recomplied for KSP 1.3. No testing have been done since I have not upgraded my current gameplay to the new version yet. I will probably wait for 1.3.2 as alway!
- The actions for activate and deactivate was by error not migrated to new setup in version 2 of GTI_MultiModeEngineFX. That is now corrected.

26-04-2017 v2.2

- Minor fix of MM "GTI_MultiModeIntake__MM.cfg" where I by mistake had ";" in the end of patch for boolean values leading to errors. Thanks to FreeThinker.

14-04-2017 v2.1

- Fixed error in last release, where GTI_MultiModeEngine was broken in VAB.
- Fixed GTI_MultiModeIntakes, such that it does never remove resource that are not used by the Intakes. This mean compatibility with mods where there are other resources in the intake part, like electric charge, solid fuel or any other resource. (option to preserve resources in any scenario still exists for mods that demand they are never destroyed)

05-04-2017 v2.0

- Changed some utility class' to static
- Implemented CustomParameterUI, i.e. now the GTI settings are available in the in game settings menu.
- Created GTI_MultiModeHarvester, which is basically the same as multi mode for converters
- Updated MM for MultiModeConverter to handle ModuleAnimationGroup better.
- Updated GTI_MultiModeConverter to use new base class for multimode. Functionality basically the same on UI level.
- Added EVA button for changing modes, for when you only want this functionality in Editor and in on manned missions.
- GTI_MultiModeConverter and GTIMultiModeHarvester now supports changing mode on eva, making it more viable configuring the multimode to only be in VAB and on eva, hence no drone switching of modes in flight. [availableInEditor, availableInFlight, externalToEVAOnly --> if "availableInFlight = true" then externalToEVAOnly is forced to true. If "availableInFlight = false" then "externalToEVAOnly = true" to enable eva switching of modes.
- Introduced "affectSymCounterpartsInFlight" to the base class, meaning Converter and Harvester multimodes now have the option to enable symmetric counterparts to be affected in flight when you switch modes. Does NOT apply to EVA switching.
- Updated GTI_MultiModeEngineFX to use the same base class as converters and harvesters
- Complete rewrite on GTI_MultiModeIntakes, now functions like the other multi modes modules. In order to have multimode intakes work, you now have to add multiple intakes, one for each mode.
- Added KSPField preserveResourceNodes to MultiModeIntake which effectively stops the module from messing with resources in the part. This is for compatibility with WarpPlugin (KSP Interstellar)

20-02-2017 v1.5
- added ":NEEDS[!WarpPlugin]" to MM for Multi Mode Intakes as requested by FreeThinker, to support KSPI-E.

18-02-2017 v1.4
- New event called "onThrottleChange" added. It is running only in flight in separate thread, and should therefore not impact performance on multicore processors in any significant way. It is detecting changes to the throttle, and fires when it changes.
- Added new "throttleISPCurve" to GTI_MultiModeEngine
- Added "usethrottleISPCurve" semicolon separated bool list to GTI_MultiModeEngine
- ISP will be calculated as the atmosphereCurve value (ISP) times the evaluation of the throttleISPCurve, where time = throttle. Value is between 0 and 1. eg. throttleISPCurve { key = 0 2 key = 1 1 } meaning double ISP at zero throttle, and normal ISP at max.
- The module GTI_MultiModeEngine now overrides the "thrustPercentage" field (UI_RANGE) of the moduleEngines, so that the new ISP curve updates as it is supposed to do when the thrust limiter is changed.
- Centralized some GTI global settings in "GTI_Config.cfg" - settings for debugging will be moved from individual modules to the common static class
- General cleanup and moving stuff around between the class'

20-01-2017: v1.3
- MultiModeConverter: Fix regarding 'ModuleAnimationGroup' overriding the MultiModeConverter. Now this module figures out when it can retake control if "useModuleAnimationGroup = true" setting is set.
- MultiModeConverter: Added silent updating for when module processes with animations and on initialization.
- Various debugging statements have been commented out.
- GTI_MultiModeEngineFX introduced to replace prior GTI_MultiModeEngine.
- New GTI_MultiModeEngine introduced which targets moduleEngines.
**!IMPORTANT: GTI_MultiModeEngine has changed to GTI_MultiModeEngineFX to indicate that it targets moduleEnginesFX**

03-01-2016: v1.2
- MultiModeConverter: Fixed bug where all actions where available on every converter for assignment, even though only one can operate at any one time.
- MultiModeConverter: Added toggle actions
- MultiModeConverter: Added setting for where on screen the message regarding new converter should be shown. Option: UPPER_CENTER, UPPER_RIGHT, UPPER_LEFT or LOWER_CENTER (e.g. messagePosition = LOWER_CENTER )
- MultiModeConverter: Added actions for specific selection of converters, so there are now 12 available. (If more are needed, simply request them. They are easy enough to add, but cannot be done procedurally).
- Added more ConfigNode methods to the utilities. (no gameplay impact yet)

28-12-2016: v1.1
- Recompiled against KSP 1.2.2
- Changed GTI_MultiModeEngine to GTI_MultiModeEngineFX in order for being ready for new module that can handle MultiModes on ModuleEngines and not only ModuleEnginesFX. REMEMBER to change CFG files accordingly.
- Added new GTI_MultiModeConverter for switching between different converter modules. Should work for derivatives from "ModuleResourceConverter".
- Minor tweaks to MM of the GTI_MultiModeIntake.

24-11-2016
- Initial release

Known issues:

Spoiler

- No known issues

Credits and sources of code inspiration:
Diazo - help & advise
kerbokatz - Afterburner mod - inspiration
FreeThinker - Interstellar Fuel Switch - inspiration
blowfish - advice on UI_ functions
Crzyrndm - advice on ConfigNode coding
NathanKell - for coding advise in the forums
sarbian - Module Manager & advice
Nazari1382 - HotRockets FX

 

Licence: https://opensource.org/licenses/MIT
All bundled material follows it original licencing terms!
HotRockets Art Assets: http://creativecommons.org/licenses/by-nc/4.0/

Edited by Warezcrawler
update of mod
Link to comment
Share on other sites

33 minutes ago, Nansuchao said:

Your idea seems brilliant, but probably a couple of engines to show what is capable of would help. They could also lead other modders to use your plugin.

I think you could have a point.... I will look into creating a couple of engine MM's. Only issue is how to convert effects on moduleEngine to the effects structure on moduleEngineFX. Like with stock MultiModeEngine, this is needed if effects are not to be an issue....

Link to comment
Share on other sites

@Azimech Earlier you asked about a ResourceCollector switch plugin. I have started to look at that. I'm not aware of another mod doing this, so it will be a nice niche to fill, and having ISRU's converting Karbonite, Ore, Dust etc. at the same time does not feel realistic, so it would be nice to be able to change that behavior while keeping parts count not too high even though performance is much better than in 1.0!

Link to comment
Share on other sites

1 hour ago, Warezcrawler said:

@Azimech Earlier you asked about a ResourceCollector switch plugin. I have started to look at that. I'm not aware of another mod doing this, so it will be a nice niche to fill, and having ISRU's converting Karbonite, Ore, Dust etc. at the same time does not feel realistic, so it would be nice to be able to change that behavior while keeping parts count not too high even though performance is much better than in 1.0!

ResourceCollector? That's a module? I'll have to check the docs on that.

Link to comment
Share on other sites

The fun you can have with ModuleResourceConverter ... it's incredible. It's on the shelf right now but I'm building a music machine ... players can build a tune in the SPH and play it on the runway. I just need more motivation ;-)

Link to comment
Share on other sites

Based on feedback, I have created 3 engines as a showcase of this mod. It is best used with Smokescreen and IFS, and moduleManager is as for most mods a need to have.

Get the parts here

The engines are as follows

  • CR-13 R.A.P.T.O.R. Engine
    • Based on stock RAPIER engine
    • 4 mode engine
      • Air Jet engine
      • Atmosphere engine, capable of flying on other Atmospheric worlds without oxygen - it is less efficient than air jet, but still much better than rockets
      • Closed Cycle aka Rocket mode slightly more powerfull and efficient than RAPIER
      • DarkGoo Fusion, this runs on a combination of LiquidFuel and Xenon Gas (substitute for DarkGoo) - highly efficient mode, lower thrust and very bad performance in atmospheric environments
  • NRX "KINKI" Atomic Rocket Propulsion
    • Based on stock Atomic Engine
    • Needs SmokeScreen to work
    • 3 modes
      • Normal - compares to normal nuclear engine
      • High Velocity - is high efficiency mode at lower thrust, more heat and bad performance in atmospheric environments
      • Over Drive - boosted thrust, better performance in atmospheric environments, but much lower max ISP.
  • GTI-2020 "Icicle" Multi Electric Propulsion System
    • Based on the Stock Ion Engine
    • 3 modes
      • Normal - compares to normal nuclear engine
      • High Velocity - is high efficiency mode at lower thrust, more heat and bad performance in atmospheric environments
      • Over Drive - boosted thrust, better performance in atmospheric environments, but much lower max ISP.

 

Credits to Nazari for effects from HotRockets which I use. These demand SmokeScreen to work.

 

 

Link to comment
Share on other sites

  • 4 weeks later...

The scientists in GT Industries have been busy, and are now presenting the all new GTI_MultiModeConverter. The time of converting 10 things at the same time from one converter is over. Having 10 different converters for realism is now not mandatory anymore.

Change log

Spoiler
  • Changed GTI_MultiModeEngine to GTI_MultiModeEngineFX in order for being ready for new module that can handle MultiModes on ModuleEngines and not only ModuleEnginesFX. REMEMBER to change CFG files accordingly.
  • Added new GTI_MultiModeConverter for switching between different converter modules. Should work for derivatives from "ModuleResourceConverter".
  • Minor tweaks to MM of the GTI_MultiModeIntake.

Grab the updated GTI_Utilities mod here.

Known issues:
Loading the switching mechanism on startup is set to have a simple delay in order to handle some kind of delay in other modules updating when loading vessel. Whether this is a problem is currently unknown. Delay is set to 1.5 seconds.

 

Link to comment
Share on other sites

@Warezcrawler a little request, of this is something you're interested in or it's, as I hope, matter of this mod. Is there a way to make the ISP of an engine be dependant on his throttle? In RL, there are some theoretical atomic engines that will have bigger ISP with lower thrust, and a couple of them are actually in Interstellar Extended, but their controllers are deeply coded in the huge plugin.

Link to comment
Share on other sites

7 minutes ago, Nansuchao said:

@Warezcrawler a little request, of this is something you're interested in or it's, as I hope, matter of this mod. Is there a way to make the ISP of an engine be dependant on his throttle? In RL, there are some theoretical atomic engines that will have bigger ISP with lower thrust, and a couple of them are actually in Interstellar Extended, but their controllers are deeply coded in the huge plugin.

Interesting idea. It is as far as I know not something stock does, and so far I have only been doing minor manipulations with stock. Performance is important to me, and I think this have to go into the FixedUpdate instead of a single on demand manipulation. But that said, maybe this can be done with only minor performance impact. I will put it on the list for research, and see what I can do. I have so far successfully worked with ISP changes directly, so the basic formulas should be worked out already.

In the current setup think of this as supported through the possibility of creating multiple engine modes, each with their own ISP curves. While this is not directly bound to the throttle, it can by design be closely related to the max thrust (throttle by proxy) of the engine mode.

I think my two example engines of the Nuclear and Ion engines does this. Though minor updates are probably needed after my latest update of the plugins.

Link to comment
Share on other sites

@Nansuchao I did some research on implementing throttle dependent ISP and found the Squad already did that with 1.2.

Quote

* ModuleEngines now supports throttle-Isp interactions. Turn on with useThrottleIspCurve = True and set the throttleIspCurve and throttleIspCurveAtmStrength curves. Final Isp = input Isp * Lerp(1, throttleIspCurve.Eval(throttle state), throttleIspCurveAtmStrength.Eval(atms of pressure))

also see

 

I also found a thread which regards this topic and I did some testing. I haven't figured out exactly how it works yet. But I do not think I will implement this is as it is already supported directly in moduleEngines.

Link to comment
Share on other sites

I've updated GTI Utilities to version 1.2. I've made several tweaks to MultiModeConverter module.

Change Log:

  • MultiModeConverter: Fixed bug where all actions where available on every converter for assignment, even though only one can operate at any one time.
  • MultiModeConverter: Added toggle actions
  • MultiModeConverter: Added setting for where on screen the message regarding new converter should be shown. Option: UPPER_CENTER, UPPER_RIGHT, UPPER_LEFT or LOWER_CENTER (e.g. messagePosition = LOWER_CENTER )
  • MultiModeConverter: Added actions for specific selection of converters, so there are now 12 available. (If more are needed, simply request them. They are easy enough to add, but cannot be done procedurally).
  • Added more ConfigNode methods to the utilities. (no gameplay impact yet)
Link to comment
Share on other sites

  • 3 weeks later...

Another update

FX in moduleEngines did not react well to changing modes, and therefore I decided to create a module where this was not the issue. Since my original GTI_MultiModeEngine is focussing on the moduleEnginesFX I decided to change the name to GTI_MultiModeEngineFX instead.

The new module inherits the original name "GTI_MultiModeEngine".

The new module has a number of fields

Basics

name = GTI_MultiModeEngine                 **The name of the module is always needed
messagePosition = UPPER_RIGHT          **This changes where in screen the message is put : Default = UPPER_CENTER
availableInFlight = false                            ** Set if it is available in flight : Default = true
availableInEditor = true                             ** Set if it is available in VAB: Default = true

GUIengineModeNames =                         ** semi colon separated list of mode names for gui. If empty the propellant names are used

propellantNames =                                   ** semi colon separated list of propellants. For each mode the propellants are separated by comma.
propellantRatios =                                    ** semi colon separated list of ratios. For each mode the propellants are separated by comma.
propIgnoreForISP =                                 ** semi colon separated list of true/false. For each mode the propellants are separated by comma.
propDrawGauge =                                   ** semi colon separated list of true/false. For each mode the propellants are separated by comma.

useEngineResponseTime =                     ** semi colon separated list of true/false
engineAccelerationSpeed =                      ** semi colon separated list of time (float)
engineDecelerationSpeed =                      ** semi colon separated list of time (float)

atmChangeFlows =                     ** semi colon separated list of true/false
useVelCurves =                           ** semi colon separated list of true/false
useAtmCurves =                          ** semi colon separated list of true/false

maxThrust =                                ** semi colon separated list of thrust
heatProduction =                         ** semi colon separated list of heat production

**Curves are added as if it was a moduleEngine module. It is important the if the are two modes then if a curve is used, then the number of that curve is the same, namely two.
**This means that e.g. atmosphereCurve would be there twice in a row. When switching modes the curve will be replaced in the moduleEngine.
atmosphereCurve{}
velCurve{}
atmCurve{}

 

DOWNLOAD

Change log:
- MultiModeConverter: Fix regarding 'ModuleAnimationGroup' overriding the MultiModeConverter. Now this module figures out when it can retake control if "useModuleAnimationGroup = true" setting is set.
- MultiModeConverter: Added silent updating for when module processes with animations and on initialization.
- Various debugging statements have been commented out.
- GTI_MultiModeEngineFX introduced to replace prior GTI_MultiModeEngine.
- New GTI_MultiModeEngine introduced which targets moduleEngines.
**!IMPORTANT: GTI_MultiModeEngine has changed to GTI_MultiModeEngineFX to indicate that it targets moduleEnginesFX**

Link to comment
Share on other sites

1 hour ago, Aerospacer said:

Hmm...
 

  Hide contents

 

It's cheat way to wrong evolution.

No connect to reality. Do a many parts useless.

Just for testing of digital worlds abilities...

IMHO, of course.

 

 

Have you tried it? As far as I am concerned it's a matter of configuration. You could make the part only switch in VAB, so that you har to make a decision up front, like when choosing one part over another. I'm still working on changing costs when doing that, but I get NRE from it.

I don't see it as a cheat thing. But it is not a realism thing either. I like being able to switch it to using the rest of my monopropellant, even if it more inefficient.

Cheating comes if you do not balance things out which is a major task, but that needs to be done with any part anyways.

 

EDIT:

And the multi mode converter actually make things harder than just having 10 different converter thing running in one part at the same time, which often happens in mods today.... Still not necessarily realism, but not cheating either, relatively.

Edited by Warezcrawler
Link to comment
Share on other sites

  • 2 weeks later...
6 hours ago, FreeThinker said:

@Warezcrawler

Does it have CKAN support yet? I would like to use it ...

Edit: shouldn't it be  "Updated 20-01-2017" instead of  "Updated 20-01-2016" ?

I updated the heading, thanks.

CKAN..... Well never used that, what does it take to use it? Do I have to upload a specific place or something?

Link to comment
Share on other sites

1 hour ago, Warezcrawler said:

Thanks... Am I right when I read it as, it is simply easier using CKAN when hosting on SpaceDock compared to other solutions?

Spacedock has an auto CKAN registration,, just upload and activate checkbox

It will also help a lot players and mod makers to find you mod.

Edited by FreeThinker
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...