Jump to content

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


nightingale

Recommended Posts

1 hour ago, nightingale said:

I couldn't reproduce this.  Contract Configurator doesn't do anything special with the completion messages - that's all stock KSP.

Ok, thanks for trying.  I'll see if I can narrow it down some more this evening.

 

Link to comment
Share on other sites

For those interested, I've posted a bit of a blog post about the contract generation & mission control overhaul that I'm currently working on over at the Nightingale Softworks Development Thread:

For contract authors - I'll have some more info on this  when I'm ready to do a pre-release (hopefully in the next few days), as these changes have the possibility of impacting existing contract packs.  None of them will be broken, but there may be work for you to make it look the way you want (such as providing a contract agent where there isn't one today, or overriding the default requirement text).

Edited by nightingale
Link to comment
Share on other sites

Okay, I think the Mission Control changes are far enough along to do a contract authors only pre-release.  If you are not currently creating contracts using Contract Configurator, then this pre-release is 100% unsupported.

First up, let's gather the troops.  Red rover, red rover, I call @tjsnh, @Kerbas_ad_astra, @Arachnidek, @CosmoBro, @severedsolo, @inigma, @linuxgurugamer, @Whitecat106, @Yemo, @Syntax, @maculator, @Volwen, @AlphaAsh, @Keniamin, @klefenz, @Whyren, @DMagic@DBT85@NathanKell & @pap1723 over.

For anyone unsure why they've been tagged, start by having a read of the following post for a brief overview of the changes underway with Mission Control & Contract Generation:

The changes are still underway, but the outstanding items are things that affect the players, and not the contract authors.  What's missing is:

  • Stock contracts don't show up in mission control
  • Need some summary-level info when contracts are collapsed so a player knows if it's worth expanding the group
  • Reputation limits on number of contracts offered has effectively been removed - need to add an alternate mechanism to make reputation meaningful
  • Auto-Accept contracts may need some work - I'm not sure the best way to display those (maybe not at all, if the aren't active?)

As such, I wanted to get this into your guy's hands ASAP (if you've read this far, you get to download the pre-release here).  This way contract authors have ample time to make the updates that are recommended based on the changes.  I've always striven to maintain backwards compatibility, and that is still the case.  No existing contract packs should break with these changes, but there are definitely going to be things that won't look quite right unless some small changes are made in contract packs.

My aim is to have the pre-release in the wild for 2 weeks before I release the official version.  That means that I'll release 1.15.1 as an official release with these changes on July 22nd.  Please don't release a contract pack that is only compatible with 1.15.x before that time (as I'm not going to support any players on the 1.15.0 pre-release).  If any of you want to try to time contract pack updates with me, then I can set a more precise time (otherwise I'll just release it on the 22nd when I'm ready).

Now, for the changes required.  One way to get things working is to download the pre-release, set your minVersion=1.15.0 in your CONTRACT_GROUP, load it up and fix all the errors/warnings.  Or for those who prefer reading (and understanding a bit more about what's changing :wink:), read on:

Recommended Updates

Contract Agent

The agent attribute has been added to the CONTRACT_GROUP, and it is highly recommended that you create a custom agent, as this is now used in the grouping lines.  Also, if you click on an group/agent line, it will display the agent information that was previous hidden behind an unintuitive right click of the agent logo.  So probably a good idea to fill out all the description fields on the agent config (I basically never did this in the past).  Similarly, the CONTRACT_GROUP.displayName field is prominently displayed, so it should ideally have a player-friendly name.

Requirement Text (title)

This is the big one.  In the new release, a player can click on a line in mission control that is tied to a CONTRACT_TYPE with no offered contracts.  They will be able to see a list of all requirements and whether the are Met/Unmet.  This way a player can look at a potential contract, decide they want to get the contract, and actively work towards it.  Most requirements have a default title, but the Expression requirement doesn't (or rather, it has a bad one just to maintain backwards compatibility).  You may also want to override the title when the default title is not what you want (to prevent spoilers, for example).

Generic Title/Description

Often contract types use expressions in the title/description.  However, when displaying a contract type in Mission Control, often those expressions won't resolve to a valid value (eg. "Build a space station around @targetBody"  won't work without @targetBody being set).  For these cases, the genericTitle and genericDescription can be set (eg. "Build a space station around a celestial body").

New Features

There's also a couple new features that may be useful for people to take advantage of.

SelectUnique

Part of the changes I did was around performance of the contract generation.  Contracts that take several tries to generate should be avoided.  Particularly the very common paradigm (that I myself have used many times) that looks something like this:

DATA
{
    type = Vessel

    uniquenessCheck = CONTRACT_ACTIVE
    theVessel = AllVessels().Where(<some criteria>).Random()
}

The problem with this expression, is that it will select a vessel that meets the criteria, then check if a contract has already been offered for the vessel.  If it selects the "wrong" vessel (on that already has a contract), then the contract won't generate.  Instead, the following should now be used:

DATA
{
    type = Vessel

    uniquenessCheck = CONTRACT_ACTIVE
    theVessel = AllVessels().Where(<some criteria>).SelectUnique()
}

This will apply the uniqueness check before making a selection, preventing the "wrong" vessel from being selected in this example.

DATA_EXPAND

This is similar to the DATA node, and is documented here.  In short, it allows a contract_type to get expanded/duplicated, so it's shown multiple times in mission control (with one variable changed for each instance).  An example of how to use this would be to have a single contract type that has Mun/Minmus variants, and have the two variants shown to the player in mission control (even when the contract can't yet be offered).

 

I think that covers everything.  I've tried to add some warnings through the code to check for stuff that is no longer recommended and push authors towards the new functionality.  If there's anything that you think is missing, or if you run into any issues updating contracts for the new version, please let me know.

And finally I just want to let everyone know that I'll be out of country on a business trip next week - so I probably won't be as responsive as usual.

Link to comment
Share on other sites

I started looking at the new development version. Here is a feature request (no clue how difficult).

When the contracts are collapsed, perhaps have the ones with available contracts have a green icon or something similar. For my pack for example, I have 10 different sub-contract styles and it is a pain to have the player have to click through to see each one.

Thanks for the new features! I look forward to working with them!

Link to comment
Share on other sites

11 minutes ago, pap1723 said:

When the contracts are collapsed, perhaps have the ones with available contracts have a green icon or something similar. For my pack for example, I have 10 different sub-contract styles and it is a pain to have the player have to click through to see each one.

Yup, that's pretty much what this line is meant to cover:

  • Need some summary-level info when contracts are collapsed so a player knows if it's worth expanding the group

Most likely it will be just be a count of the Unavailable/Offered/Active contracts.  In addition, I may do some sort of read/unread type of thing, where there's a star or other thing to notify if there are new contracts that have been offered since the last time the player expanded that group.

Link to comment
Share on other sites

Just now, nightingale said:

Yup, that's pretty much what this line is meant to cover:

  • Need some summary-level info when contracts are collapsed so a player knows if it's worth expanding the group

Most likely it will be just be a count of the Unavailable/Offered/Active contracts.  In addition, I may do some sort of read/unread type of thing, where there's a star or other thing to notify if there are new contracts that have been offered since the last time the player expanded that group.

Count makes a lot of sense. Just something like 1 of 9 contracts available. Or, maybe better would be 3 columns of Available - Completed - Total

Link to comment
Share on other sites

So, I finally cleared all my validation errors in B&S and loaded it up, and I have some feedback:

So, I fired it up, and I couldn't understand why Crew Rotation contracts weren't generating, all the requirements were showing as "Met" - I timewarped a little and it showed when the others expired,  but maybe some visual feedback to the player that they just need to be patient, where all reqs are met?

It's also showing something I've suspected for a while, but haven't been able to prove - uniquenessCheck = GROUP_ACTIVE is not working. Every single one of those contracts is for the same Station. I know it's deprecated now, but not everyone is going to change over.

Also, I managed to break it by rejecting a contract (it clears after a short timewarp) - note the missing accept/reject buttons (just on the contract I rejected - others are ok)

IBMq9Ri.png

My KSP is also crashing alot since I installed it, however I'm not willing to point the finger at CC for that, because the log is saying it's to do with D3DDevice being lost (probably cuz I have KSP in the background while I'm combing contracts)

Also, where a Data node is populated by more than one line, and a title is used, the title is duplicated

Example:

DATA
{
	type = Kerbal
	targetKerbal1 = (some expression)
	targetKerbal2 = (some other expression that excludes targetKerbal1)
	title = Selecting Crew to be returned home
}

Results in "Selecting Crew to be returned home" being shown twice (as below)

lE9nPNG.png

 

Also: How will it handle old style active contracts when users upgrade? Will they be preserved until they finish them? Or do I need to do a major version bump?

 

Edit: Another issue, for some reason MissionControl is refusing to show the details for K files: EP1: Strange Things  Looking at the log, it looks like it fell over checking for REQUIREMENT - TechResearched part = turboFanEngine. Contract linked above, Log here. Not raised a github as not sure if it's due to the new changes, or an old issue that hasn't been reported.

Edited by severedsolo
Link to comment
Share on other sites

8 hours ago, severedsolo said:

So, I fired it up, and I couldn't understand why Crew Rotation contracts weren't generating, all the requirements were showing as "Met" - I timewarped a little and it showed when the others expired,  but maybe some visual feedback to the player that they just need to be patient, where all reqs are met?

I'm going to keep an eye on this one, but not sure if I need to do anything yet.  If you load it up on an existing save, the first contract generation pass may take a bit (even on a slow machine we're probably only talking in the 5-10 seconds range).  So if you go immediately to Mission Control, you may see still still showing up.  It could happen after coming back from a mission where it causes a bunch of new contracts to be valid too...  so might need to do something (not sure what yet).

8 hours ago, severedsolo said:

It's also showing something I've suspected for a while, but haven't been able to prove - uniquenessCheck = GROUP_ACTIVE is not working. Every single one of those contracts is for the same Station. I know it's deprecated now, but not everyone is going to change over.

This was a pretty good one actually.  The uniquness check for vessels is a bit special, because it uses the vessel id to check.  However, before a contract is serialized (eg. before the save happens), it hasn't converted it over to the ID.  So what you end up with is it compares the id against the vessel itself, and doesn't get a match.  If you save and re-load the game, remove all contracts but one, the checks actually start working (but they stop again if you cancel all the contracts.

So yup, the new system badly exacerbated an existing bug.  Fixed for 1.14.1 and 1.15.1 releases (still leaving the option open for a 1.14.1 release without the MC changes).

8 hours ago, severedsolo said:

Also, I managed to break it by rejecting a contract (it clears after a short timewarp) - note the missing accept/reject buttons (just on the contract I rejected - others are ok)

Ah yes.  The old contract is still in the "pre-loader" when it redraws the contracts, so it's got a link to a contract in a weird state.  This will be fixed when I fix up the decline/cancel UI (right now it just lazily redraws all the contracts, which causes the player to lose the state of which groups are expanded).

8 hours ago, severedsolo said:

My KSP is also crashing alot since I installed it, however I'm not willing to point the finger at CC for that, because the log is saying it's to do with D3DDevice being lost (probably cuz I have KSP in the background while I'm combing contracts)

Scary, but agreed it's probably not me. :D

8 hours ago, severedsolo said:

Also, where a Data node is populated by more than one line, and a title is used, the title is duplicated

Example:


DATA
{
	type = Kerbal
	targetKerbal1 = (some expression)
	targetKerbal2 = (some other expression that excludes targetKerbal1)
	title = Selecting Crew to be returned home
}

Results in "Selecting Crew to be returned home" being shown twice (as below)

lE9nPNG.png

Ah yes, I had been thinking that you would be forced to do different titles and different data nodes for these, but I can see how that would get messy pretty quick.  I've changed it so that it now merges all the duplicate lines (and does a logical AND of all the conditions it merges).

8 hours ago, severedsolo said:

Also: How will it handle old style active contracts when users upgrade? Will they be preserved until they finish them? Or do I need to do a major version bump?

Should be unaffected.  How active contracts are stored remains unchanged.

8 hours ago, severedsolo said:

Edit: Another issue, for some reason MissionControl is refusing to show the details for K files: EP1: Strange Things  Looking at the log, it looks like it fell over checking for REQUIREMENT - TechResearched part = turboFanEngine. Contract linked above, Log here. Not raised a github as not sure if it's due to the new changes, or an old issue that hasn't been reported.

Fixed, bug in the new stuff (good catch, by the way).  If you want to test out any of my changes, just grab the .dll from the MissionControl branch.

Link to comment
Share on other sites

Cheers man. just grabbed the latest build, all seems to be good. New stock stuff looks good too!

Just for your peace of mind - I chucked it into an existing save just to see what would happen, am pleased to report the world didn't end. (It was basically ok, reporting a few wrong numbers for offered contracts, but can't say that wasn't because they are "old style".

Link to comment
Share on other sites

By popular demand (@Yemo & @severedsolo), the Available tab is back with a flat listing of all available contracts (the grouped view is still the default under a tab called 'All').

Going to try to do another pre-release for tonight, the last change is one that @Whitecat106 had asked for that I'd totally forgotten about - sort order for contracts and child contract groups.  Stay tuned for that.

Link to comment
Share on other sites

6 minutes ago, nightingale said:

By popular demand (@Yemo & @severedsolo), the Available tab is back with a flat listing of all available contracts (the grouped view is still the default under a tab called 'All').

Going to try to do another pre-release for tonight, the last change is one that @Whitecat106 had asked for that I'd totally forgotten about - sort order for contracts and child contract groups.  Stay tuned for that.

Wait, I think you misunderstood. I meant a grouped view, but where only groups with available contracts are displayed, all those groups are "open", and within those groups only the available contracts are displayed.

Sorry, should have expressed myself more clearly.

 

edit: And this view should be the default, to minimize necessary clicking for default players.

Edited by Yemo
Link to comment
Share on other sites

3 minutes ago, Yemo said:

Wait, I think you misunderstood. I meant a grouped view, but where only groups with available contracts are displayed, all those groups are "open", and within those groups only the available contracts are displayed.

Sorry, should have expressed myself more clearly.

Oh I see what you were asking for now. :P

It's a bit more work to do it that way, but still a possibility.  I'm going to leave as-is for the next release, as there's stuff that wasn't in the original pre-release that mitigates a bit:

  1. There's an indicator saying how many offered contracts are within the group, so it's pretty easy to see the groups without offered contracts.
  2. The ones with "unread" contracts are in bold.  So you can tell which groups have contracts that are new since the last time you looked in that group (opening the group keeps the new ones bolded, but marks them all as read).  I think it's fairly intuitive, but let me know your feedback onceyou check it out.

YXcglIs.png

 

Link to comment
Share on other sites

3 minutes ago, nightingale said:

Oh I see what you were asking for now. :P

It's a bit more work to do it that way, but still a possibility.  I'm going to leave as-is for the next release, as there's stuff that wasn't in the original pre-release that mitigates a bit:

  1. There's an indicator saying how many offered contracts are within the group, so it's pretty easy to see the groups without offered contracts.
  2. The ones with "unread" contracts are in bold.  So you can tell which groups have contracts that are new since the last time you looked in that group (opening the group keeps the new ones bolded, but marks them all as read).  I think it's fairly intuitive, but let me know your feedback onceyou check it out.

Hm, looking at the screenshot, maybe your initial understanding is even better than what I actually meant.

Totally flat view without the group tabs, just all available contracts in a list (like stock), but instead of ordering them by "stars", they are ordered by "group", just without displaying the group.

That would result in an overview of the actual contracts without any need for clicks and with the least amount of scrolling. Which imho are the 2 most relevant comfort criteria.

Link to comment
Share on other sites

It's actually pretty good as it is with the latest dev version (IMO), you can look at available and not be overwhelmed, but still be able to go through and pick complementary missions to go with it, kinda best of both worlds.

I have a bug report, which you may or may not be aware of: At the moment, Mission Control levels (as in, can only accept 2/7/Unlimited contracts) are not respected, and you can select as many contracts as you like. However, after a scene change, if you are over the limit, no further contracts can be accepted.

Edited by severedsolo
Link to comment
Share on other sites

Heyo. You may remember the problem I posted about a while ago, where an extra DLL in another mod was causing contract configurator to choke on my contracts, resulting in them getting stuck in contractpreloader.

I just this week got a new computer, installed the latest KSP and mods from scratch... and it's happening again, exactly as before. It may or may not be CC's fault, but this seemed like the place to start. Any thoughts?

 

https://www.dropbox.com/s/qr4hhh47mfwax5i/quicksave.sfs?dl=0

 

https://www.dropbox.com/s/23twp0fmg8sjtkn/output_log - Copy.txt?dl=0

 

 

Edited to add: It appears that this may AGAIN have been not caused by your mod. A few other outdated mods were being references in the exceptions CC was throwing, and removing those SEEMS to have resolve it. Sorry for the false alarm

Edited by Tokamak
Link to comment
Share on other sites

7 hours ago, Yemo said:

Hm, looking at the screenshot, maybe your initial understanding is even better than what I actually meant.

Totally flat view without the group tabs, just all available contracts in a list (like stock), but instead of ordering them by "stars", they are ordered by "group", just without displaying the group.

That would result in an overview of the actual contracts without any need for clicks and with the least amount of scrolling. Which imho are the 2 most relevant comfort criteria.

Right now I'm using the stock sort in that view, but sorting it the way you've described sounds way better.  Fairly easy change, so I'll do that.

6 hours ago, severedsolo said:

I have a bug report, which you may or may not be aware of: At the moment, Mission Control levels (as in, can only accept 2/7/Unlimited contracts) are not respected, and you can select as many contracts as you like. However, after a scene change, if you are over the limit, no further contracts can be accepted.

I haven't looked at contract limits yet - so I wasn't aware of the bug, but probably (hopefully) would've run into it.

Link to comment
Share on other sites

Pre-release build 1.15.1 is up.  <Usual red warning lights about this being a contract author-only pre-release>.

The main reason I did another pre-release was to get the changes for sortKey out, which is a new field to allow customizing the sort order of contracts within a group (or groups within a child group).  See details on the wiki pages for Contract Type and Contract Group.  Stock contracts are now mostly working, and there's a bunch of stuff around helping the player figure out which contracts to actually look at (details in the last page of the thread, feedback is welcome).

A quick summary of what's missing/broken in the pre-release:

  • Hitting cancel/decline may mess up mission control.  At the very least it will collapse all expanded groups
  • No logic around contract limits yet
  • Lots of missing art for the stock agents 
  • Still need to give a bit more thought on auto-accept contracts.
Link to comment
Share on other sites

8 hours ago, nightingale said:

Pre-release build 1.15.1 is up.  <Usual red warning lights about this being a contract author-only pre-release>.

Hey, I just checked out this new version and while switching back and forth between the All tab and the Available tab, I came up with another suggestion:

With many contract packs installed and no rng/slots to restrict the number of total contracts, it is still very scroll heavy. Also, the current vertical alignment of the "stars" makes it harder to distinguish them, if they are not grouped together.

1. Alternative: Therefore I propose using half-height contracts in the "Available" tab, like they are used in the "All" tab. With "stars" aligned horizontally and the agency logo at 1/4 the size, where the red "X" are displayed at the moment.

2. Alternative: I m not sure about this (since it again increases vertical space requirements), but perhaps if the "groups" were half-sized as well, then the whole mechanic of the "All" tab could be used for the "Available" tab. With the difference that all groups are opened by default but only the available contracts are displayed. Thus groups with only 1 available contract would take up as much vertical space as a former "full-size" contract (group height + height of 1 contract, both half the height of a former full size contract), but every additional contract from a group would only take up half the vertical space. And it would still allow for the "closing" of groups as well as give the better grouping indication from the "All" tab without taking up so much vertical space.

Edited by Yemo
Link to comment
Share on other sites

2 hours ago, hargn said:

Is there a way into CC to have a contract parameter based on a resource consumption?
It could be useful for the contracts I want to write.

Check HasResource and HasResourceCapacity.  If neither of those meet your needs you'll have to be more specific as to what you're looking for.

Link to comment
Share on other sites

1 hour ago, nightingale said:

Check HasResource and HasResourceCapacity.  If neither of those meet your needs you'll have to be more specific as to what you're looking for.

I mean the instantaneous resource consumption, the derivative of the resource quantity by seconds.
For a contract, a want to know if the vessel consumes power or if the power reserve is growing due to solar panels.

Else, I'm looking for a function to get the current vessel instance. Does CurrentVessel().ResourceQuantity(ElectricCharge) work to get the resource of the current vessel ?

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