Jump to content

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


Warezcrawler

Recommended Posts

19 hours ago, The-Doctor said:

Interesting mod, I'm confused to what it does exactly and what is atmosphere curve?

The mod in itself targets others mod makers primarily, since most of the functionality needs somebody to incorporate it into parts. I am personally using it heavily I'm my personal mod I'm having along side other mods. That said there are some MM included with the mod, which I will come back to, as well as some example parts I made as show case (unbalanced).

The theme of the mod is currently "orbiting" multi mode... If you are familiar with Interstellar Fuel switch, or any of the other fuel switch mods out there, then you basically know what it does. Mine is just currently targeting engines (a generalisation of the stock multi mode for engines, which have two modes only), intakes, converters.

Then engine multi mode plugin actually have two different modules since animations are a pain.

To you second question, what is atmosphere curve - I'm guessing that since you ask you are not familiar with any of the curves of the engine modules. Before 1.2 there were 3 different curves that could affect the performance of any engine in KSP.

  • atmosphereCurve
  • velCurve
  • atmCurve

The first one is mandatory, while the other two are optional. These are technically called floatCurves in KSP and are using Unity AnimationCurve. Basically it is a method where you can describe any curve using Time, Value, inTangent, outTangent. For any such curve the interpretation of time and value is important.

Curve Time Value
atmosphereCurve Atmospheres of pressure, where 1 = Kerbin Sea Level Specific Impluse (ISP)
velCurve Mach value Thrust Multiplier
atmCurve Atmospheres of pressure, where 1 = Kerbin Sea Level Efficiency, how much thrust can be provided at that pressure.

So these curves combined defines how much thrust, and how efficiently you engine runs. There are two new curves with KSP 1.2, which in theory also let's engine ISP be linked to the thrust, but I have yet to figure out how it functions.

I hope this answer helped.
 

Link to comment
Share on other sites

  • 3 weeks later...

[1.2.2] GTI Utilities 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'

 

To use the new throttleISPCurve for GTI_MultiModeEngine, you need the following

Spoiler

//Assume two engine modes are defined

useGTIthrottleISPCurves = true;true

        throttleISPCurve
        {
            key = 0 3
            key = 1 1
        }
        throttleISPCurve
        {
            key = 0 2
            key = 1 1
        }

//meaning the first engine mode has triple ISP at zero throttle, and normal ISP at max. The second engine mode has double ISP at zero throttle, and normal ISP at max.

ISP is then calculated as the ISP in the "atmosphereCurve" * ".Evaluate(.requestedThrottle) of the throttleISPCurve". requestedThrottle is the throttling the engine is asking for. This incorporated the thrustlimiter as well as the global throttle.

I created this throttleISPCurve because I could not get the stock thingy to work. This one is a bit less sophisticated (design choice), but I think it works. Hope you will enjoy.

Link to comment
Share on other sites

@Warezcrawler  excellent update, but  I have a problem with the multi mode intake which appears to applied to every air intake, it conflict with KSPI-E intakes which also uses IntakeAtm and assumes it is always present in conjunction with standard air intake. Any ideas on how to resolve it?

Edited by FreeThinker
Link to comment
Share on other sites

17 hours ago, FreeThinker said:

@Warezcrawler  excellent update, but  I have a problem with the multi mode intake which appears to applied to every air intake, it conflict with KSPI-E intakes which also uses IntakeAtm and assumes it is always present in conjunction with standard air intake. Any ideas on how to resolve it?

I seems that we are conflicting because of the MM of multi mode intakes. Here I apply it to most intakes, and removed the intakeAtm.... I do this, because of the fact that having two intakes is the opposite of the purpose of the multi mode intakes module, and that it reacts really funny when this is the case.

@PART[*]:HAS[@MODULE[ModuleResourceIntake],~name[NuclearJetEngine],~name[M2X_RadialAASRB],~name[M2X_RATO]]:FOR[GTI]
{
	MODULE
	{
		name = GTI_MultiModeIntake

		availableInFlight = true
		availableInEditor = true

		resourceNames = IntakeAir;IntakeAtm
		checkForOxygen = true;false
	}
}

@PART[*,!M2X_RadialAASRB,!M2X_RATO]:HAS[@MODULE[ModuleResourceIntake],@RESOURCE[IntakeAir],@RESOURCE[IntakeAtm]]:FOR[GTI]:FINAL
{
	!MODULE[ModuleResourceIntake]:HAS[#resourceName[IntakeAtm]]
	!RESOURCE[IntakeAtm]:HAS[#name[IntakeAtm]]
}

As you can see I already had to do some stuff because of some MM in "Mk2 Stockalike Expansion" mod.

That said, we can look at at least two approaches to solving the conflict.

  • Either KSPI-E is changed so it does not assume this anymore, but as KSPI-E is a large mod, that could take some time to work out. And you might not be interested in compatibility of that plugin?
  • Alternatively, I could add ":NEEDS[!WarpPlugin]" on my end.

What do you think?

Originally I wanted the intake to switch like I do in the converter and MultiModeEngineFX, but for some reason that did not want to work....

Link to comment
Share on other sites

@Warezcrawler For now I think it's best to add ":NEEDS[!WarpPlugin]" on your end.

But I agree with you that it's a bit weird that an intake can generate intake air and atmospheric air at the same time. I intend to integrate your intake switch into KSPI-E AtmosphericIntake module, which technically already does everything except generate intakeair. I think a potential slider would be more sense, allowing you to reserve part of the intake for air breather and another part for atmosphere breathers.

Edited by FreeThinker
Link to comment
Share on other sites

1 hour ago, FreeThinker said:

@Warezcrawler For now I think it's best to add ":NEEDS[!WarpPlugin]" on your end.

But I agree with you that it's a bit weird that an intake can generate intake air and atmospheric air at the same time. I intend to integrate your intake switch into KSPI-E AtmosphericIntake module, which technically already does everything except generate intakeair. I think a potential slider would be more sense, allowing you to reserve part of the intake for air breather and another part for atmosphere breathers.

Actually you could argue, that it would be enough to change the property "checkForOxygen" on the intake instead of the resource.... That way we could all just use the intake as-is.... This is basically the only real change when we turn towards the IntakeAtm resource anyways.....

I will make the change to my mod as requested.

Link to comment
Share on other sites

7 minutes ago, FreeThinker said:

Great, then I can use it in KSPI-E for some of the chemical engines

OK... I'll add it so that the Multi Mode Intakes are not added at all when KSPI-E is installed. Then you can activate what you think is relevant in regards to this. Makes sense to me, since KSPI-E is a mayor mod, while mine is for some isolated features enhancements.

I'm just updating now.

EDIT: I added the "NEEDS" part, but have not tested it. Hope you will revert if anything is wrong. Thanks.

Edited by Warezcrawler
Link to comment
Share on other sites

  • 1 month later...

I've been working on GTI_MultiModeHarvester module to fill this gap in the production cycle. This work is coming along nicely, just a few smaller features to work out then I can release that along with other changes that are not directly module related.

However, I have been thinking about what to do next.... So now with over 600 downloads on spacedock, I'm thinking maybe you have a good idea.

Things on my list are: (boring.....)

  • Streamlining the module code, for which I'm working on new base class
  • Giving the MultiModeIntake a makeover. It is a bit rough in the edges, and could use some refinement.

Now the first one is mostly for my sake. I don't think it will give much in stability and functionality. The second could make the module MultiModeIntake more stable and robust.

Are any of the current modules you think are missing some functionality, which you would like to see them having in the future? Or are there something else that you think could be nice to add in? MultiMode RCS maybe?

Link to comment
Share on other sites

  • 2 weeks later...

GTI have been updated to version 2.0. Lot's of code have been rewritten.

Change log:

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

Download: https://github.com/WarezCrawler/Guybrush101/releases/tag/2.0

------------------------------------

Notice: The GTI_MultiModeIntake format have been changed, and now have the following format

Spoiler

    MODULE
    {
        name = GTI_MultiModeIntake

        availableInFlight = true
        availableInEditor = true
        
        preserveResourceNodes = false;        //For warpplugin compatibility
    }

preserveResourceNodes can be set to true, in order to force the module not to mess with the resource nodes. This can help WarpPlugin from it's compatibility issues it had with the old module.

 GTI_MultiModeHarvester have been added and is symmetrically the same as for Converters, just targeting another module with small differences in the handling under the hood.

Spoiler

    MODULE
    {
        name = GTI_MultiModeHarvester
        
        availableInFlight = true
        availableInEditor = true

        externalToEVAOnly = true             //Is it possible for a kerbal on eva to change mode even if in flight switching is disabled?
    }

 

Link to comment
Share on other sites

  • 2 weeks later...

Yet anoter small update

Changelog:

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 resources 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)

 

Edited by Warezcrawler
Link to comment
Share on other sites

1 hour ago, Warezcrawler said:

@FreeThinker I was wandering, how does the latest updated to the MultiModeIntakes fare with your mod? I put some thought into supporting it, but since I don't use it personally it is so far untested on my end.

Well, I was considering this, to be a recommended KSPI mod. I like the Converter and conventional engine switching functionality. It looked promising until  I ran into maturity and  incompatibility issues. But since you claim to have fixed them I will start reviewing it again

Edited by FreeThinker
Link to comment
Share on other sites

4 minutes ago, theonegalen said:

What does the Piston engine part of the plugin signify?

That might be there at my request, not sure. I should continue to work on my mod.

Edited by Azimech
Link to comment
Share on other sites

5 minutes ago, theonegalen said:

What does the Piston engine part of the plugin signify?

That is a very good question.... Basically the engine type are the types of engines that KSP recognises. I am not sure what exactly KSP uses it for though.

The build in types are LiquidFuel, Nuclear, SolidBooster, Turbine, MonoProp, ScramJet, Electric, Generic, Piston. These are set in the engine definitions, like this example from the Nerv nuclear engine.

Spoiler

PART
{
    name = nuclearEngine
    module = Part
    author = NovaSilisko
    mesh = model.mu
    scale = 1
    rescaleFactor = 1

...various properties...

    TechRequired = nuclearPropulsion
    category = Engine
    subcategory = 0
    title = LV-N "Nerv" Atomic Rocket Motor
...various properties...
    MODULE
    {
        name = ModuleEngines
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 60
        heatProduction = 250
        fxOffset = 0, 0, 1.6
        EngineType = Nuclear
        exhaustDamageDistanceOffset = 1.86
        PROPELLANT
        {
            name = LiquidFuel
            ratio = 0.9
            DrawGauge = True
        }
        atmosphereCurve
        {
            key = 0 800
            key = 1 185
            key = 2 0.001
        }
    }
... other modules...
}

I have not actually researched too much in it, and usually just uses the main ones like LiquidFuel, Nuclear, SolidBooster and Turbine. They might have considered having electric engines at one point, which would not actually use resource with mass, but never implemented it.

I have no idea what a piston engines is, but it is in there. I included the list of the types, since I had not at the time found any resource that listed them, and thought it might be nice for anyone the are creating engines parts. It is not something I do anything with, other than set the value.

Link to comment
Share on other sites

6 hours ago, FreeThinker said:

Well, I was considering this, to be a recommended KSPI mod. I like the Converter and conventional engine switching functionality. It looked promising until  I ran into maturity and  incompatibility issues. But since you claim to have fixed them I will start reviewing it again

Sounds great. If there are other issues, I'm happy to look into smoothing that out. I would find it great if our mod can work smoothly together!

Edited by Warezcrawler
Link to comment
Share on other sites

46 minutes ago, theonegalen said:

Thank you, @Warezcrawler

 

I just took a look through the moduleEngines implementation in KSP, it seems that it is used for some vibration fx, but else have no effect on the engine performance or otherwise. I have actually never considered the vibrations the game animates in some cases to be partially linked to the engine type....

Thanks for the question, it was interesting to research the implementation of this. Now I have an idea of it's significans (or insignificans :confused:).....

Link to comment
Share on other sites

When I downloaded Nertea's Kerbal Atomics I erased the patch that made the nerv use liquid hydrogen because it broke my existing ships using liquid fuel, and also breaks rapier+nerv SSTOs, since they no longer share the same fuel.

 

Then I got thinking "what about rapiers which use liquid hydrogen"? They'd be closer to the Skylon project, since the spaceplane would have to carry bulkier, if more efficient, fuel. I think I nearly got it with an MM patch by duplicating the rapiers and changing the fuel type of both modes. But would it be easier with this mod? And maybe make the nerv be able to use either liquid fuel (at stock performance) or liquid hydrogen (at Kerbal Atomics performance)?

Link to comment
Share on other sites

1 minute ago, juanml82 said:

When I downloaded Nertea's Kerbal Atomics I erased the patch that made the nerv use liquid hydrogen because it broke my existing ships using liquid fuel, and also breaks rapier+nerv SSTOs, since they no longer share the same fuel.

 

Then I got thinking "what about rapiers which use liquid hydrogen"? They'd be closer to the Skylon project, since the spaceplane would have to carry bulkier, if more efficient, fuel. I think I nearly got it with an MM patch by duplicating the rapiers and changing the fuel type of both modes. But would it be easier with this mod? And maybe make the nerv be able to use either liquid fuel (at stock performance) or liquid hydrogen (at Kerbal Atomics performance)?

I think this mod could be very helpful in that scenario, and if you do not want in flight switching of modes, then you can set that value to false in the cfg file. That way you set the mode of the engine in the VAB/SPH, and then the engine works just as if you had to seperate engine parts (of cause with some logic running when you change the scenes, but nothing heavy).

And, I have not implemented any OnUpdate() logics, which means that you should not experience any drop in framerate from using this mod. And keeping the part count down is always good for KSP performance :)

Link to comment
Share on other sites

Just wanted to say thank you @Warezcrawler for the great plugin, I'm developing custom converter and harvester plugin that introduces variable operation speed linked to an animation (demo below). Was really struggling with writing multiconverter code (not much coding experience) so your plugin solved one of the issues I had with stock converter :) Once again cheers man :)

 

Link to comment
Share on other sites

4 hours ago, FreeThinker said:

I'm getting a lot of exception at startup, which mention GT modules.  They should be fixed as much as possible

Oh... Really... Could you please get me a log file?

I don't have exceptions on my current install of ksp, so it could be really interesting to look at what causes it on yours.

Link to comment
Share on other sites

I will only mention all GTI errors I saw in the log:

[LOG 20:30:41.333] PartLoader: Compiling Part 'ModRocketSys/Parts/Engine/NBintake1m/part/NBintake1m'
[ERR 20:30:41.337] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:41.357] PartLoader: Compiling Part 'ModRocketSys/Parts/Engine/NBintakeBasic0m/part/NBintakeBasic0m'
[ERR 20:30:41.361] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:42.665] PartLoader: Compiling Part 'Squad/Parts/Aero/airIntakeRadialXM-G50/airIntakeRadialXM-G50/airScoop'
[ERR 20:30:42.669] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:42.925] PartLoader: Compiling Part 'Squad/Parts/Aero/circularIntake/intakeShockCone/shockConeIntake'
[ERR 20:30:42.928] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:43.347] PartLoader: Compiling Part 'Squad/Parts/Aero/intakeRadialLong/intakeRadialLong/IntakeRadialLong'
[ERR 20:30:43.351] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:43.368] PartLoader: Compiling Part 'Squad/Parts/Aero/miniIntake/SmallIntake/miniIntake'
[ERR 20:30:43.371] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:43.398] PartLoader: Compiling Part 'Squad/Parts/Aero/ramAirIntake/ramAirIntake/ramAirIntake'
[ERR 20:30:43.402] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:42.917] PartLoader: Compiling Part 'Squad/Parts/Aero/circularIntake/circularIntake/CircularIntake'
[ERR 20:30:42.921] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:45.627] PartLoader: Compiling Part 'Squad/Parts/Engine/jetEngines/jetEngineBig/turboFanSize2'
[ERR 20:30:45.636] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:49.791] PartLoader: Compiling Part 'Squad/Parts/Structural/mk1Parts/engineBodyRadial/radialEngineBody'
[WRN 20:30:49.793] PartLoader Warning: Variable cryoPower not found in Part
[ERR 20:30:49.795] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:49.838] PartLoader: Compiling Part 'Squad/Parts/Structural/mk1Parts/engineNacelle/nacelleBody'
[WRN 20:30:49.840] PartLoader Warning: Variable cryoPower not found in Part
[ERR 20:30:49.843] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

[LOG 20:30:49.925] PartLoader: Compiling Part 'Squad/Parts/Structural/mk1Parts/mk1FuselageIntake/MK1IntakeFuselage'
[WRN 20:30:49.927] PartLoader Warning: Variable cryoPower not found in Part
[ERR 20:30:49.930] Invalid boolean value! Field preserveResourceNodes, value true; on object of type GTI.GTI_MultiModeIntake

 

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