the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How are scrap categories calculated based on scrap components?

murarst

Active Member
Messages
214
Hi,
I've been wondering this for a long time and it has been an open question in quite some threads I've seen.
Does anybody know how these calculations work or can point me in the right direction to do some digging myself?
Thanks a lot.
 
Hi,
I've been wondering this for a long time and it has been an open question in quite some threads I've seen.
Does anybody know how these calculations work or can point me in the right direction to do some digging myself?
Thanks a lot.
I'm not sure I get the question but I think I got a somewhat answer. Every scapable piece of junk can be broken down into specific components. So based on the junk/raw materials you have those will factor into what components you have in that category. While it's gets crazy I like looking at the full view of my virtual storage. All 36 of them just to see what specific things I might need to help donate or make plots to produce.
 
If you meant "why does the 'total' not equal the sum of all the things underneath it", that's something that's been bugging me for a LONG time. The fix in the most recent major update regarding the Virtual Caravan Network (there was an incorrect minus sign in a single calculation) should've HELPED, but it still seems like there's a lot of "off by 1 rounding-errors" combining to mean those totals just don't make sense - or something, I can't figure it out.
 
If you meant "why does the 'total' not equal the sum of all the things underneath it", that's something that's been bugging me for a LONG time. The fix in the most recent major update regarding the Virtual Caravan Network (there was an incorrect minus sign in a single calculation) should've HELPED, but it still seems like there's a lot of "off by 1 rounding-errors" combining to mean those totals just don't make sense - or something, I can't figure it out.
Yep. That's what I mean. Sorry for the imprecise question.

So by design the totals should be the sum of the values stated next to the components?
And all discrepancies are due to bugs??

Not even sure how it is supposed to work because in my save the numbers are way off for all categories. (But that save is gone anyway I guess)
 
So by design the totals should be the sum of the values stated next to the components?
And all discrepancies are due to bugs??
That's what I was told when I asked about it during kinggath's Q&Astream a while back; his numbers were off too and he only controlled Sanctuary in that save. No idea what the "fix" would be or when it'd come.

I will try and remember to log a Proper Bug Report on it when I get home from work tonight.
 
Last edited by a moderator:
If you meant "why does the 'total' not equal the sum of all the things underneath it", that's something that's been bugging me for a LONG time. The fix in the most recent major update regarding the Virtual Caravan Network (there was an incorrect minus sign in a single calculation) should've HELPED, but it still seems like there's a lot of "off by 1 rounding-errors" combining to mean those totals just don't make sense - or something, I can't figure it out.
That's what I was told when I asked about it during kinggath's Q&Astream a while back; his numbers were off too and he only controlled Sanctuary in that save. No idea what the "fix" would be or when it'd come.

I will try and remember to log a Proper Bug Report on it when I get home from work tonight.
I looked into the ResourceManager a bit because of a PM I received, and it seems the SetSettlementVirtualResource function clobbers the totals of parent categories above it if it is called it's abBypassGroupHandling parameter set to false. It has one call as such in the ProduceSettlementVirtualResource function in ResourceManager. I'm not sure in what capacity ProduceSettlementVirtualResource is used, so it may actually be harmless, but it may be worth looking in to.

As an example, if SetSettlementVirtualResource is called on steel with abBypassGroupHandling set to false and a value of 100, it will call a function HandleSetSettlementVirtualResourceForGroupedStorage that will in turn call SetSettlementVirtualResource on all parent categories with the same value of 100. So it will set the building materials category to 100, then it will set the total scrap category to 100.
 
Just to document properly - this was the first screenshot I found that I knew that this "issue" was what was happening; that save ONLY owned that one settlement. As you can see from the Resources HUD, it SAYS I have 3273 total - the sum of the four categories beneath that actually adds up to 3271. ScreenShot125.png
 
SetSettlementVirtualResource is used to keep the categories in sync for the sake of players being able to downgrade their difficulty without losing resources. So for example, if I start a game in Survival mode, and I find it's too much to deal with all those components, I can switch to category or scrap level and my totals won't vary (or they won't if we sort out this bug).

ProduceSettlementVirtualResource only uses it to correct found negative numbers, as some earlier bug in the mod was producing negatives that it shouldn't have.

Uncertain why the numbers would become desynced, likely some math error somewhere, but could also be the native problem with papyrus that the game is willing to drop queued function calls when the script lag gets too bad. In the short term, I may just rig it to do the math and correct things at the category levels during the daily update loop.
 
I'm not sure I can be trusted to test this stuff at this point; this was on a save only started ~24 hours ago (on v1.0.11a), only settlement with anything built in it is the modded Sanctuary here. I hit the hotkey I have set to toggle the resource HUD's "mode" by accident, and got this view - what in the HECK is going on with those numbers? I was only playing on Categories level, too, and hitting that key switched the HUD to readout in Components level; or at least it's trying to, no idea how it thinks I have negative 26 Glass, or how 7 Gold somehow equals 4 Rare Materials...
 

Attachments

  • ScreenShot142.png
    ScreenShot142.png
    2.9 MB · Views: 14
Hi interesting that this happened on a new save.
Yeah, I also noticed that sometimes I can toggle the HUD to display a "too detailed" scrap level. If I have to guess I'd say it happens mostly when I fast travel to a settlement and start doing stuff immediately.
I wonder if whose numbers are the actual numbers SS2 works with in the background or just gibberish.
 
Last edited:
I've been pondering the occurrence of these errors on new games. Could it be that the MCM values are putting in presets before acquiring the tape from the questline? Which, from what I've seen, default to hardcore prior to receiving the tape from the quest line. I'm wondering if the MCM values that can be seen/adjusted for SS2, prior to getting the tape via the questline, are not in whole being reset/overridden by the wizard during the first use of the tape later.
 
Last edited:
Hi.
Not entirely sure what you mean and how it relates to virtual resources. Did you mean point 2 below?

As far I have seen there are five issues described here on the forums connected to the virtual resources not matching up.

1) Virtual resources being added rather than substracted when there aren't enough in the current settlement and they have to be pulled from the network. This is (probably) fixed in 1.0.12.
2) on off setting for upkeep cost in MCM (and possibly holotape?) not respected.
3) Upkeep cost only being added to the "bill" when building or upgrading a plot but not removed, when the plot is scrapped, upgraded or changed. This leads to horrendous upkeep cost being paid for plots not even existing anymore.
4) A bug in the code where the function for updating the components counts clobbers the grand totals.
5) upkeep cost not being paid even though there are enough resources available leading to plots and vanilla items constantly breaking.

Any more I've missed? @yaugieLC @msalaba @spacefiddle
 
@murarst I apologize I didn't realize I quoted your post. I've removed the quote from my post.

I've often been wondering if all of the initial settings within the MCM aren't being overwritten/reset (whichever the case may be) when you run the holotape wizard for the first time on a new game. If, for instance, I change a setting in MCM prior to receiving the holotape does that setting actually get honored moving forward. Providing I pick the same difficulty level that the setting would have fell in during the wizard.

Looking at MCM prior to getting the holotape you can notice that the settings seem to default to hardcore component level mode. If someone makes the change after getting the holotape in the wizard to move to scrap categories (or even scrap only) the settings appear to change in the holotape. But are they really being honored on the back end? My current thinking is that they're not all being written/reset correctly, and the game is chugging along using the base settings from MCM. This seems to be confirmed by the reports from users saying that the costs for maintenance are still relying on component level items, even though they have plenty of items in the corresponding scrap category.

Granted, everything I've mentioned is hear-say as I have not had time to test my theory yet so I might just be babbling up the wrong tree. lol

I guess my basic question is whether or not this is something that can be tested? Does SS2 need MCM for functionality? Remove MCM from the mix, and see if the numbers line up.

EDIT: My brain is slow, if people on consoles are seeing the same issue(s) then MCM couldn't be contributing / causing the issue(s). Correct?
 
Last edited:
Ah I see. No worries.
For sure some settings of MCM relating to SS2 are not properly set or read. That seems to be a fact.
If it does go as far as being related to the initial setup, I don't know. To me it's really hard to tell if the numbers displayed in the HUD are actually the numbers SS2 works with or are just gibberish from script lag or other issues.
Right now there are so many different issues contributing that the easiest route is probably to wait until some bugs are ironed out and to see what the result is.

But yes: if console users do not see the same issues then it might be related to MCM. I did not follow if the issues I listed are pc only.
 
2) on off setting for upkeep cost in MCM (and possibly holotape?) not respected.
This bug is due to the MCM setting being incorrectly labeled. "AutoPay Plot Upgrade Costs" in MCM under "Upgrade" should be "AutoPay: Plot Costs"
Could it be that the MCM values are putting in presets before acquiring the tape from the questline?
All settings are stored as Global Variables. Both MCM and the holotape displays the settings value based off the value of the Global Variable. If the config wizard changes any settings, that change should be reflected in MCM or the holotape immediately.
 
Top