Jump to content

[1.10.1+] Contract Configurator [v1.30.5] [2020-10-05]


nightingale

Recommended Posts

20 minutes ago, steve_v said:

I don't know anything about the internals of CC, but when you say 'generation' I take it you mean the generation of new contracts? If so, and contract generation is the main source of garbage, why does it seem to scale so neatly with number of active contracts?

Maybe not "main source", but definitely the biggest source.  That's not to say there isn't problems with the active contracts.

I'll cross-post something on the RP-0 thread to see if I can get some more details (from you or others).

Link to comment
Share on other sites

4 hours ago, nightingale said:

Maybe not "main source", but definitely the biggest source.  That's not to say there isn't problems with the active contracts.

I'll cross-post something on the RP-0 thread to see if I can get some more details (from you or others).

You obviously know the internals of CC better than I do, but from my testing in flight, contract generation was not the biggest source of stutter.

When I cancelled all active contracts, but still had CC running, I had a 75% decrease in garbage rate.  That alone shows that it's the active contracts, not just generation.

Link to comment
Share on other sites

20 minutes ago, Maxsimal said:

You obviously know the internals of CC better than I do, but from my testing in flight, contract generation was not the biggest source of stutter.

When I cancelled all active contracts, but still had CC running, I had a 75% decrease in garbage rate.  That alone shows that it's the active contracts, not just generation.

Yeah, but contracts don't generate in flight as of 1.15.0 - so unless you're testing on an old version then I wouldn't expect contract generation to have a large impact in flight.  Don't get me wrong though - the fact that active contracts does have such a large impact in flight is a problem, and needs to get addressed.

Link to comment
Share on other sites

4 hours ago, nightingale said:

Yeah, but contracts don't generate in flight as of 1.15.0 - so unless you're testing on an old version then I wouldn't expect contract generation to have a large impact in flight.  Don't get me wrong though - the fact that active contracts does have such a large impact in flight is a problem, and needs to get addressed.

I'm playing 1.81.1

Garbage rate is very high both in space center and in flight.  So... you're saying you're going to fix generation, which won't impact the dramatic stutter in flight?   And which frankly is the part that makes the game difficult to play - there's a 1-2 second pause every 5 seconds when I'm doing RO.  The stutter in the space center is not as bad, since it doesn't happen when I'm in the VAB - I'm really only in the space center briefly.  

Link to comment
Share on other sites

6 minutes ago, Maxsimal said:

I'm playing 1.81.1

Garbage rate is very high both in space center and in flight.  So... you're saying you're going to fix generation, which won't impact the dramatic stutter in flight?   And which frankly is the part that makes the game difficult to play - there's a 1-2 second pause every 5 seconds when I'm doing RO.  The stutter in the space center is not as bad, since it doesn't happen when I'm in the VAB - I'm really only in the space center briefly.  

No - I'm saying generation was moved to not run in flight as of 1.15.1 as the biggest garbage/performance culprit at the time for exactly the reason you've stated - players generally aren't looking at offered contracts in flight, and aren't in the space center for long.

For a release soon I'll be looking at active contracts, as that seems to be the current worst offender.

Link to comment
Share on other sites

Hey there :) I really am not sure if this mod is causing this, or one of the other contract-oriented mods I have (CapCom, MCE, etc) but I'm getting the problem of disappearing contracts after accepting them!

It seems to be only certain types of contracts doing this, namely asset recovery and part tests.

LOG 23:08:36.591] [MessageSystem] Reposition 0.02 550864
[ERR 23:08:36.600] ContractList: Contract type 'RecoverAsset' not found

[ERR 23:08:36.601] ContractList: Contract type 'PartTest' not found

[LOG 23:08:36.678] MCE Remove Contracts loaded

That's the except from my log file that seems to be when they are removed from my list.

Any idea what would be causing this? Just now, I tried to do a engine part test, and a kerbal recovery. I accepted them and went to the hangar to build a ship for em, and boom, when I looked to see the contract parameters, they were just..gone.

Link to comment
Share on other sites

Just now, DracoSilverpath said:

Hey there :) I really am not sure if this mod is causing this, or one of the other contract-oriented mods I have (CapCom, MCE, etc) but I'm getting the problem of disappearing contracts after accepting them!

It seems to be only certain types of contracts doing this, namely asset recovery and part tests.


LOG 23:08:36.591] [MessageSystem] Reposition 0.02 550864
[ERR 23:08:36.600] ContractList: Contract type 'RecoverAsset' not found

[ERR 23:08:36.601] ContractList: Contract type 'PartTest' not found

[LOG 23:08:36.678] MCE Remove Contracts loaded

That's the except from my log file that seems to be when they are removed from my list.

Any idea what would be causing this? Just now, I tried to do a engine part test, and a kerbal recovery. I accepted them and went to the hangar to build a ship for em, and boom, when I looked to see the contract parameters, they were just..gone.

I'd need to see a full log to say for sure, but the snippet you sent seems to imply it's intended behavior of MCE.

Link to comment
Share on other sites

16 minutes ago, nightingale said:

I'd need to see a full log to say for sure, but the snippet you sent seems to imply it's intended behavior of MCE.

Sure thing, here ya go :)

https://www.dropbox.com/s/o9oag38jhebiq5w/KSP.log?dl=0

Also, just a note, both types of contracts are enabled in contract configurator's settings menu, and there appears to be no settings for disabling those in the MCE settings menu, so...yeah.

EDIT: I think you can safely disregard this now, as it was indeed MCE doing it. Apparently, they were actually turned off in outs config file, but the settings don't show up in game as they are supposed to. Still, doesn't really explain why they still showed up in the list instead of just being outright hidden.

Edited by DracoSilverpath
Link to comment
Share on other sites

On 9/2/2016 at 2:56 PM, nightingale said:

Yeah, but contracts don't generate in flight as of 1.15.0 - so unless you're testing on an old version then I wouldn't expect contract generation to have a large impact in flight.  Don't get me wrong though - the fact that active contracts does have such a large impact in flight is a problem, and needs to get addressed.

Looks like it should be really easy to fix. More than 90% of the garbage being produced is coming from one method and one closure in particular based on very quick lookover

New game, no mods excluding MM + CC, no active flights

Contract Packs: additional progression contracts, anomaly surveyor, BaseConstruction, CleverSat, FieldResearch (a decent scattering for profiling purposes).

Snapshot of profiler while on the pad with a couple contracts accepted:

Spoiler

8ac72f55ca.png

Taking a couple more contracts:

da31a1b729.png

 

Link to comment
Share on other sites

New release, and a huge thank you to @xEvilReeperx for identifying the major source of garbage.  Download here!

Contract Configurator 1.19.0

  • Added Part.UnlockCost().
  • Added Part.Resources().
  • Added Part.ResourceCapacity().
  • Reworked ParameterDelegate - worst source of in-flight LINQ (ie. garbage).
  • Check contract requirements before displaying them in mission control in case something has changed.
  • Fixed issues with part parser (thanks 5thHorseman).
  • Fixed exception in Mission Control (thanks Conventia & AccidentalDisassembly).
  • Fixed a NullReferenceException in PartValidation.
  • Fixed an incorrect condition on the ReseachBodies check which caused heaps of garbage to be created (thanks xEvilReeperx).
  • Fixed issue with Duration parameter not kicking off correctly in some circumstances (thanks 5thHorseman).
Link to comment
Share on other sites

@nightingale  Huge improvement!   My GC is running at around every ~20 seconds in flight - basically what I was doing with no active contracts before.  That's definitely liveable, and probably some other mod causing it now.  When I get a chance I'll try uninstalling CC and seeing if that still makes a different, but way to go, so much better!

Link to comment
Share on other sites

Massive improvement. I am running memgraph and I adjusted heap size to 7GB. Before the update the GC ran every 25ish seconds and the heap was filling with 125MB/s, now it is running every 105 seconds and heap is filled on a rate of 15MB/s.

I would say: Great success! Thanks!

P.S.: Looking forward to KSP 1.2 for the stock optimizations :D

Link to comment
Share on other sites

Hi, I'm just coming to notice an exception with the latest CC release.
I'm using RP-0, but I didn't investigate if the issue was coming from that :

[WRN 18:28:04.113] File 'GameData/ModuleManager.TechTree' does not exist
[ERR 18:28:04.113] ContractConfigurator.Tech: Couldn't load tech tree from GameData/ModuleManager.TechTree

Else, I maybe have an issue or an enhancement request : the maximum number of available contracts for a group prevents the Mission Control to offer all different contracts it should propose.
It seems that that only the same contracts are proposed (the first unlocked or loaded from config files).
Is there some random when the list of available contracts are generated?

Link to comment
Share on other sites

3 hours ago, hargn said:

Hi, I'm just coming to notice an exception with the latest CC release.
I'm using RP-0, but I didn't investigate if the issue was coming from that :


[WRN 18:28:04.113] File 'GameData/ModuleManager.TechTree' does not exist
[ERR 18:28:04.113] ContractConfigurator.Tech: Couldn't load tech tree from GameData/ModuleManager.TechTree

Well, it tries to read the Tech Tree directly from the file (there were reasons I can't quite remember for doing it this way).  The error pretty much says that the file that is setup isn't actually there, so I'd look at a potential issue in Module Manager first (since it's the one generating the file in this instance).  If you provide a full log file, I can take a look and see.

3 hours ago, hargn said:

Else, I maybe have an issue or an enhancement request : the maximum number of available contracts for a group prevents the Mission Control to offer all different contracts it should propose.
It seems that that only the same contracts are proposed (the first unlocked or loaded from config files).
Is there some random when the list of available contracts are generated?

Should go through them in a less fixed order now.  The group limits preventing stuff from being offered is by design - might mean a change is needed in RP-0 (or that might be intentional).

Link to comment
Share on other sites

On 05/09/2016 at 9:59 PM, nightingale said:

Should go through them in a less fixed order now.  The group limits preventing stuff from being offered is by design - might mean a change is needed in RP-0 (or that might be intentional).

The contracts belongs to a group ComSat I've written, and the max Simultaneous contracts for this group is 5.
So only a Milestone contracts, two (the max) polar comsat and two (the max) SSO comsat are proposed. It seems that the molniya and tundra Comsat unlocked after the first ones are never proposed.
I'll look around this with more contracts, and play with weights, to confirm this really is an issue or not.

EDIT : I tried with maxSimultaneous = 8 in the group and with 5 kind of satellite contracts that are unlocked successively by milestone contracts : Polar, Sunsynchrous, Molniya, Tundra and GEO, each having a maxSimultaneous = 2.
CC generate contracts in the order of unlocking, so I get 2xPolar, 2xSSO, 2xMolniya and 2xTundra contracts available in the mission control and the GEO contracts are never available.
So I think that the contract generation seems randomless.
 

 

On 05/09/2016 at 9:59 PM, nightingale said:

Well, it tries to read the Tech Tree directly from the file (there were reasons I can't quite remember for doing it this way).  The error pretty much says that the file that is setup isn't actually there, so I'd look at a potential issue in Module Manager first (since it's the one generating the file in this instance).  If you provide a full log file, I can take a look and see.

This is maybe an issue with the RP-0 techtree, after it is generated by ModuleManager.
I believe that this issue appears when calling MaxTechLevelUnlocked() when CC try to generated new contracts. The returned value is always 0.
But I let you investigate this, here are my full log and the related tech tree : https://drive.google.com/file/d/0B2RjcW4lKwZLQVVLcjBPZVJ0TVU/view?usp=sharing

Edited by hargn
Add precision for contract randomless generation issue
Link to comment
Share on other sites

Hello @nightingale

Is it possible to square numbers? Or more importantly to take square roots and cube roots of numbers? 

I am trying to accomplish figuring out the SMA required for a Synchronous orbit. In order to do this I need to get the cube root. In Excel it operates like this: number ^ (1/3)

The operator ^ is to take the power of something. 

Thanks! 

Link to comment
Share on other sites

@nightingale I'm looking for information on the stock contract format in .sfs files. Specifically the order of the values line listing rewards. I am looking at ContractConfigurator-master\source\ContractConfigurator\ContractType.cs. The order of the rewards in this .cs file does not seem to be the same as the order in .sfs files. I assume it is necessary for ContractConfigurator to know this order and I haven't found where this is in the source.

Link to comment
Share on other sites

On 06/09/2016 at 0:51 AM, hargn said:

The contracts belongs to a group ComSat I've written, and the max Simultaneous contracts for this group is 5.
So only a Milestone contracts, two (the max) polar comsat and two (the max) SSO comsat are proposed. It seems that the molniya and tundra Comsat unlocked after the first ones are never proposed.
I'll look around this with more contracts, and play with weights, to confirm this really is an issue or not.

EDIT : I tried with maxSimultaneous = 8 in the group and with 5 kind of satellite contracts that are unlocked successively by milestone contracts : Polar, Sunsynchrous, Molniya, Tundra and GEO, each having a maxSimultaneous = 2.
CC generate contracts in the order of unlocking, so I get 2xPolar, 2xSSO, 2xMolniya and 2xTundra contracts available in the mission control and the GEO contracts are never available.
So I think that the contract generation seems randomless.

Well, you've got it set up in a way that takes the random out of it.  If you are allowed to generate 8 total, and there are only two polar available then it will generate those.  Later, when two SSO are also available, then it'll generate those, etc. etc.  What *should* happen is that when one of those falls off the list, it'll randomly generate a new one.  I'd check the expiry dates though - if not enough time is passing or the expiry dates are very large, it won't offer new contracts.

On 06/09/2016 at 0:51 AM, hargn said:

This is maybe an issue with the RP-0 techtree, after it is generated by ModuleManager.
I believe that this issue appears when calling MaxTechLevelUnlocked() when CC try to generated new contracts. The returned value is always 0.
But I let you investigate this, here are my full log and the related tech tree : https://drive.google.com/file/d/0B2RjcW4lKwZLQVVLcjBPZVJ0TVU/view?usp=sharing

Nothing useful to me in that log - the tech tree file simply doesn't exist at any point Contract Configurator needs it.  I know that @sarbian had to implement some magic in his code to be able to make the tech tree file Module-Managerable, but I've never known it to cause issues with Contract Configurator before.

Looking at your log, there's none of the MM log messages I'd expect to see around the tech tree, yet your install is still trying to go to its copy of the tech tree.  Maybe the URL in the settings.cfg was manually modified?

5 hours ago, wreckerbal said:

@nightingale I'm looking for information on the stock contract format in .sfs files. Specifically the order of the values line listing rewards. I am looking at ContractConfigurator-master\source\ContractConfigurator\ContractType.cs. The order of the rewards in this .cs file does not seem to be the same as the order in .sfs files. I assume it is necessary for ContractConfigurator to know this order and I haven't found where this is in the source.

You won't find that here - ContractType and the stock contract config are loosely related at best.  The stock logic for saving to the config file puts all the rewards into a comma separated list (which Contract Configurator doesn't touch or know about).  Contract Configurator only needs to interact with the individual fields on the Contract class after they've been loaded.

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