Project-RimFactory-Revived icon indicating copy to clipboard operation
Project-RimFactory-Revived copied to clipboard

(Bug report) SOS2 Compability Digital storage and archival storage

Open Autumnlight02 opened this issue 1 year ago • 13 comments

Describe the bug

A clear and concise description of what the bug is.

To Reproduce Reproducibility: ? Steps to reproduce the behavior:

  1. Create an ship on the planet.
  2. build an archival storage on it
  3. Put inside of that archival storage 500 stacks of items.
  4. Launch ship into orbit

Expected behavior All the items stay in the container

Actual Behavior If you have 500 Item stacks it will drop 150. 350 are kept in the archival storage, 150 are dropped from where you launched. The same issue happens if you move the ship mid orbit

Screenshots If applicable, add screenshots to help explain your problem.

Rimworld (please complete the following information):

  • RimWorld Version: 1.5 (newest)
  • PRF Version: 2
  • Type: compability
  • Severity: low

Modlist (please complete the following information):

  • Does this problem exist if only prf is installed: yes (since its related to a block of it)
  • Do you know what mod conflicts?: sos2

Additional context

Autumnlight02 avatar Sep 16 '24 12:09 Autumnlight02

Relates to / Duplicate of #776

I Still can't reproduce that report After the launch everything is fine. image

Save file before Launch TestShip.zip

Sn1p3rr3c0n avatar Sep 16 '24 16:09 Sn1p3rr3c0n

And you had +500 items and an archival storage? @Sn1p3rr3c0n | it only happens if you have +150 +200 item stacks in an archival storage unit (cannot check with your ship atm)

Autumnlight02 avatar Sep 16 '24 17:09 Autumnlight02

1358 Items in the Archival Storage Unit 767 Items in the Digital Storage Unit

Sn1p3rr3c0n avatar Sep 16 '24 17:09 Sn1p3rr3c0n

@Sn1p3rr3c0n just to confirm (sorry if I am annoying) meaning different item stacks, as in => my stack limit for steel is 750 and I had 400 stacks of it in my archival storage unit, and it dropped 150 * 750. (I use orgestack as well)

Autumnlight02 avatar Sep 16 '24 17:09 Autumnlight02

yes of course i'm referring to Stacks.

Please feel free to load the save and verify yourself.

Sn1p3rr3c0n avatar Sep 16 '24 17:09 Sn1p3rr3c0n

Will do so, this means then this is a three way incompability with another mod, and I run 750 mods sigh I dont think I will find out what the hell causes it

Autumnlight02 avatar Sep 16 '24 17:09 Autumnlight02

More details on these storage buildings compatibility:

  • there is a confirmed issue when Haute meals form Vanilla Cooking Expanded - Haute module are stored in Archival Storage unit, then dropped on ship takeoff: https://github.com/KentHaeger/SaveOurShip2/issues/102

I've found custom Despawn handlers: this https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStorage.cs#L191 and this https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStoragePowerd.cs#L92

For compatibility, looks like they should have just default base behavior in relation to stored items when despawning during ship move. That can be achieved by checking ShipInteriorMod2.MoveShipFlag field, which can be reasonable easy done with reflection and without adding mod dependency.

I've looked at the possibility of changing thing at Save Our Ship 2 side, but that looked more complicated.

So what do you think of supporting move ship flag in DeStawn methods?

Bqr1s avatar Apr 30 '25 02:04 Bqr1s

I'm most certainly not opposed, adding a flag check sounds very reasonable.

What I'm missing atm is how we arrived at the conclusion that such a flag check would fix anything. Both overrides just handel extra Logic before running the base.

https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStoragePowerd.cs#L92-L102 just destroys stored things on deconstruct. I'd assume you don't despawn stuff in the deconstruct mode.

https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStorage.cs#L191-L201 This is more plausible to require a flag as it spawns stored items. but i am unsure why it would spawn one thing instead of all (unless those are despawned first?)


As for VCE-Haute I'm uncertain how this relates. is this connected to the things above? is this handled by the VE Team or should we look at it

Sn1p3rr3c0n avatar Apr 30 '25 05:04 Sn1p3rr3c0n

@Bqr1s hmm from what I can see those functions don't get called at all?

Dll + Changes for refrence ProjectRimFactory.zip

Sn1p3rr3c0n avatar Apr 30 '25 07:04 Sn1p3rr3c0n

VCe - Haute is connected in a way that Archival storage dropping it's contents results in stuff left at the original ship position on ship move/takeoff, but with VCE-haute meals there are log errors mentioned in the issue, in addition to stuff dropped. So it looks like if stuff dropped is fixed, VCE - Haute issue should be fixed too.

As for despwan calls, when ship takes of or moves around on the map, buildings at old ship location are despawned as part of the process. I guess, that required extra explanation.

Thank you very much for the build, looks like the change that should hopefully fix things, I'll have a look at that soon.

Bqr1s avatar Apr 30 '25 12:04 Bqr1s

@Sn1p3rr3c0n I've got your patch working with a slight change from get field to property getter method call.

changesUpdated.patch

Attached the changed patch. I've tested it, and mod compatibility support worked, ship took off without dropping Archival Storage contents.

Bqr1s avatar May 03 '25 00:05 Bqr1s

a slight change from get field

uff that's where i messed up.

I think i will leave https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStoragePowerd.cs#L92-L102 as is. Since you DeSpawn with the default of Vanish nothing will change there. no point in adding dead code

Sn1p3rr3c0n avatar May 04 '25 17:05 Sn1p3rr3c0n

Nice, I am taking a break atm of this game, but I am happy to see y'all working on this and fixing issues <3

Autumnlight02 avatar May 06 '25 01:05 Autumnlight02