Jump to content

[Minimum KSP: 1.12.2] Snacks! - Friendly, Simplified Life Support


Angelo Kerman

Recommended Posts

On 12/4/2020 at 1:39 PM, PocketBrotector said:

I've noticed that my kerbals are not actually consuming Snacks. After 1-2 weeks on a Mun mission, traveling between a command module, space station, lander, etc., all parts are still fully stocked with Snacks (and empty of Soil). No ISRU has been involved, and snack levels remain constant on all craft regardless of whether recyclers are present or running. Do I have something set up wrong, or is this a bug?

While looking through my save file for something unrelated, I stumbled upon the likely reason for this. (And looking back through my posts in this thread, I think I had the same issue, for the same reason, back in 2017, but never found out why until now.)

SnacksScenario is full of stock kerbal names ("Xyz Kerman"). But I'm using KerbalRenamer, which means my kerbals aren't using those stock names (instead e.g. "Jane Doe"). I'm guessing that the Snacks tracking data is generated for each kerbal before KerbalRenamer intercepts them and renames them; then Snacks loses track of them and they stop eating or getting hungry. Or something along those lines, anyway. 

@Angel-125, is there a good way around this issue? 

Link to comment
Share on other sites

58 minutes ago, PocketBrotector said:

While looking through my save file for something unrelated, I stumbled upon the likely reason for this. (And looking back through my posts in this thread, I think I had the same issue, for the same reason, back in 2017, but never found out why until now.)

SnacksScenario is full of stock kerbal names ("Xyz Kerman"). But I'm using KerbalRenamer, which means my kerbals aren't using those stock names (instead e.g. "Jane Doe"). I'm guessing that the Snacks tracking data is generated for each kerbal before KerbalRenamer intercepts them and renames them; then Snacks loses track of them and they stop eating or getting hungry. Or something along those lines, anyway. 

@Angel-125, is there a good way around this issue? 

Not easily. I'll have to look and see how KerbalRenamer works.

Link to comment
Share on other sites

  • 3 weeks later...

Since I'm almost done with DSEV Restocked, I'm looking at how to fix the EVA resource problem. As I mentioned before, I want to build a new cargo part that kerbals can take with them on EVA. Think of a lunchbox:

back-to-the-future-lunchbox_1024x1024.jp

but with something more kerbal related like @JustJim's Saga of Emiko Station:

Y5Nk5V8.jpg

Link to comment
Share on other sites

11 hours ago, Burning Kan said:

EVA l(a)unchbox? Remind my on a very old mod (2013)just in case u never see it and for inspiration,and of course thanks for all the effort u put in your mods.your skills are really astonishing.so here it is:

Q6HZfNwl.jpg

mod:

Peace BK

It's not quite the same. More like, you have an inventory slot for your EVA jetpack, parachute, and soon, a snack pack.

Link to comment
Share on other sites

Snack pack vVUEm1O.pngmmhhhh      

like this on the left? : adds 10(some) snacks(fit in kerbal inventory). right:The SnackPak! adds 30(more) snacks (dosnt fit in kerbal inventory)but on the back

SnackPak.png

mod is old and DL is death,sry

maybe two sizes,would be cool but i belive u will do it better then i can imagine-

peace

Link to comment
Share on other sites

@Angel-125 - in conversation with @Lisias, I've been trying (or rather Lisias has, because I lack the knowledge to contribute much) to figure out an issue that may or may not be caused by Snacks - but the problem can definitely be reproduced using Snacks (and not other mods, like USI LS, that also place stuff on the parts in question). I may be jumping the gun, but figured I would post here too in case you might have insight.

The problem arises with the combination of Snacks and inflatable habitation parts from Stockalike Station Parts Expansion Redux. Symptom is nullref-inducing, click-blocking, and PAW-mangling right click behavior on those inflatable parts while in the editor.

On a clean KSP install with only Module Manager, SSPXR (+dependencies, like B9 Part Switch and NF Props and such), and Snacks, you can reproduce the problem by doing the following:

  1. Enter the VAB, create a craft using any part.
  2. Attach radial attach points (or whatever) in symmetry to that part (has to be symmetry) - this is only to provide stack nodes that allow you to attach inflatable habs with converters in symmetry as well.
  3. Attach an inflatable SSPXR hab such as the "Winston" one-ended 1.25m inflatable hab (or others, including the hitchhiker or what have you) to those radial attach points' stack nodes - use symmetry.
  4. Right click on one of the Winstons (or whatever) you just placed; PAW is mangled/shortened and you can no longer right click on any other parts.
  5. If you exit the VAB and return to it, reloading the autosaved craft, you will be able to right click on the inflatable parts, inflate/deflate, etc., but if you try the same process again, same result (at least for me).

I tried patching a resource onto the SSPXR parts thinking it could be HabUtils inflater thing somehow interacting with resources - no problem there. Inflate/deflate works fine, right click works fine etc. inside and outside editor.

I also tried using USI-LS, which patches its 'Start  Habitation' module thing on to SSPXR inflatable parts as well. Couldn't reproduce the problem.

Log here: https://www.dropbox.com/s/klfc5pud6w52m1l/SSPXRClickProb_KSP.log?dl=0

MM cache here: https://www.dropbox.com/s/gp0a08g113bl6fi/SSPXRClickProb_ModuleManager.ConfigCache?dl=0

EDIT: Sorry, I should have bothered to test other non-inflatable parts. It does not have to be an inflatable part; this also occurs with things like the PTD-5 Sunrise Habitation module. It just needs to be a part with Snacks stuff applied (a converter, seems like) and also B9 switchable stuff.

Edited by AccidentalDisassembly
Link to comment
Share on other sites

7 hours ago, AccidentalDisassembly said:

@Angel-125 - in conversation with @Lisias, I've been trying (or rather Lisias has, because I lack the knowledge to contribute much) to figure out an issue that may or may not be caused by Snacks - but the problem can definitely be reproduced using Snacks (and not other mods, like USI LS, that also place stuff on the parts in question). I may be jumping the gun, but figured I would post here too in case you might have insight.

The problem arises with the combination of Snacks and inflatable habitation parts from Stockalike Station Parts Expansion Redux. Symptom is nullref-inducing, click-blocking, and PAW-mangling right click behavior on those inflatable parts while in the editor.

On a clean KSP install with only Module Manager, SSPXR (+dependencies, like B9 Part Switch and NF Props and such), and Snacks, you can reproduce the problem by doing the following:

  1. Enter the VAB, create a craft using any part.
  2. Attach radial attach points (or whatever) in symmetry to that part (has to be symmetry) - this is only to provide stack nodes that allow you to attach inflatable habs in symmetry as well.
  3. Attach an inflatable SSPXR hab such as the "Winston" one-ended 1.25m inflatable hab to those radial attach points' stack nodes - use symmetry.
  4. Right click on one of the Winstons (or whatever) you just placed; PAW is mangled/shortened and you can no longer right click on any other parts.
  5. If you exit the VAB and return to it, reloading the autosaved craft, you will be able to right click on the inflatable parts, inflate/deflate, etc., but if you try the same process again, same result (at least for me).

I tried patching a resource onto the SSPXR parts thinking it could be HabUtils somehow interacting with resources - no problem there. Inflate/deflate works fine, right click works fine etc. inside and outside editor.

I also tried using USI-LS, which patches its 'Start  Habitation' module thing on to SSPXR inflatable parts as well. Couldn't reproduce the problem.

Log here: https://www.dropbox.com/s/klfc5pud6w52m1l/SSPXRClickProb_KSP.log?dl=0

MM cache here: https://www.dropbox.com/s/gp0a08g113bl6fi/SSPXRClickProb_ModuleManager.ConfigCache?dl=0

Thanks for the detailed bug report, I was able to reproduce the issue and fix it. :) I should have a new update this weekend.

Link to comment
Share on other sites

This issue has been reported in the past but nothing has been done to fix it, apparently. 

When you first open the Snacks menu your game slows down - permanently. NOT just to calculate initially. It's either a memory leak or I don't know. Either way, I consider this mod broken for me. oh well

Link to comment
Share on other sites

1 hour ago, Splendid said:

This issue has been reported in the past but nothing has been done to fix it, apparently. 

When you first open the Snacks menu your game slows down - permanently. NOT just to calculate initially. It's either a memory leak or I don't know. Either way, I consider this mod broken for me. oh well

I haven't seen that issue. But there are other mods out there. Have fun. :)

12 minutes ago, AccidentalDisassembly said:

Huzzah! Thanks for looking into it.

In addition to this fix, I'm zeroing in on what to do with EVA resources. In my testing, one thing I've noticed is that despite setting Snacks and Fresh Air to specific values, the game treats them as if they had the same amounts as the EVA Propellant- and reduces them all when the jetpack fires. I've been trying various approaches including a dedicated Snack Pack cargo part that holds the resources, with varying success. This morning, I also realized that most of the time, a kerbal steps out for just a few minutes, does something, and then goes back inside. As a result, it's not often when they will consume life support resources while on EVA. That got me thinking- do we really need them to have EVA resources on their person?

Given the above use case, if we just assume that a spacesuit has about a day of life support, all I really need to do is keep track of when the left their vessel, and how long they've been outside. If you leave them outside for more than a day, then you'll have problems. But if not, and you just go outside for an hour or two, then the kerbal can consume some "reserved" resources or some such when he/she goes back inside.

I think that would simply things and get around the KSP bug.

Link to comment
Share on other sites

11 minutes ago, Angel-125 said:

There are others out there. Have fun. :)

In addition to this fix, I'm zeroing in on what to do with EVA resources. In my testing, one thing I've noticed is that despite setting Snacks and Fresh Air to specific values, the game treats them as if they had the same amounts as the EVA Propellant- and reduces them all when the jetpack fires. I've been trying various approaches including a dedicated Snack Pack cargo part that holds the resources, with varying success. This morning, I also realized that most of the time, a kerbal steps out for just a few minutes, does something, and then goes back inside. As a result, it's not often when they will consume life support resources while on EVA. That got me thinking- do we really need them to have EVA resources on their person?

Given the above use case, if we just assume that a spacesuit has about a day of life support, all I really need to do is keep track of when the left their vessel, and how long they've been outside. If you leave them outside for more than a day, then you'll have problems. But if not, and you just go outside for an hour or two, then the kerbal can consume some "reserved" resources or some such when he/she goes back inside.

I think that would simply things and get around the KSP bug.

That makes sense, IMO. No need to calculate/track/resource-ify stuff beyond that; how would you even eat a snack in a spacesuit anyway? :) (Fresh air being a different question, but presumably all spacesuits have air tanks, because, otherwise... death and stuff.)

EDIT: I guess the one use case I can think of is sending a kerbal in a spacesuit into orbit and beyond, no craft, but somehow with a backpack of supplies. Which is fun(ny), but... maybe not typical enough to bother cooking up a whole workaround.

Edited by AccidentalDisassembly
Link to comment
Share on other sites

Just now, AccidentalDisassembly said:

That makes sense, IMO. No need to calculate/track/resource-ify stuff beyond that; how would you even eat a snack in a spacesuit anyway? :) (Fresh air being a different question, but presumably all spacesuits have air tanks, because, otherwise... death and stuff.)

Exactly. I can see a kerbal go outside for several hours, then come back inside and grab a meal or three. For Fresh Air, I'm not quite sure how to handle that, other than the timer. Updating a cargo part's resources is relatively straightforward when the kerbal is in scene and running around. It gets harder when you're focused on, say, a vessel around Duna, and your kerbal is in Kerbin orbit. I can consume resources but I need helpers to update the cargo part. I do have a prototype working for that, but I've also realized that players aren't going to be frequently checking their inventory to see how much of a resource they have left. So I think the timer is the way to go.

Link to comment
Share on other sites

13 minutes ago, Angel-125 said:

That got me thinking- do we really need them to have EVA resources on their person?

Maybe it could pull from a nearby vessel?

Peehaps within a certain distance, out of which, the kerbal has a specific amount of time away from the safe zone. 
Maybe they lose their ability to use the pack after that?

Link to comment
Share on other sites

Just now, Spaceman.Spiff said:

Maybe it could pull from a nearby vessel?

Peehaps within a certain distance, out of which, the kerbal has a specific amount of time away from the safe zone. 
Maybe they lose their ability to use the pack after that?

Maybe. The Shuttle EMU had support for 8 hours with a 30 min backup. To me, that says "timer" for the resource. So I could have a part module or setting somewhere that defines how long an EVA resource lasts. I already have

SNACKS_EVA_RESOURCE
{
	resourceName = FreshAir
	amount = 1.0
	maxAmount = 1.0
}

That node tells Snacks what resource to include and how much to include when a kerbal goes on EVA. I could also specify something like "consumptionTime" and a value like 8.5, to let Snacks know how long the resource lasts. So I could see:

- A resource like Snacks is consumed when the kerbal returns to the vessel depending upon how many snack cycles he/she missed, if any.

- A resource like Fresh Air is consumed on a timer, with the potential to delay or reset that timer if the kerbal has something like an air cylinder cargo part that provides extra air.

Link to comment
Share on other sites

1 hour ago, Angel-125 said:

- A resource like Snacks is consumed when the kerbal returns to the vessel depending upon how many snack cycles he/she missed, if any.

- A resource like Fresh Air is consumed on a timer, with the potential to delay or reset that timer if the kerbal has something like an air cylinder cargo part that provides extra air.

I like both of those ideas - the logic seems sensible to me, e.g.:

  1. Kerbals can last for X hours/days (user defined via difficulty setting maybe) on EVA without food (and/or without a fresh air resupply or other resources) - cargo parts with relevant resources increase total hours/days before penalties on EVA.
  2. Beyond X hours/days, penalties apply according to settings (reputation loss, fainting, death...), or something like that.
  3. Kerbal becomes absolutely voracious after EVA if snack cycles missed & no snacks in cargo part, attacks the snack cart upon reentering a vessel, making up for missed snacks by consuming <appropriate quantity>.
  4. Kerbal refills suit (so it's always ready to go) upon reentering craft as well, so X Fresh Air (or whatever other resources are enabled/used) are consumed after EVA, depending on how much time the Kerbal spent outside (representing how much air, oxygen, water, whatever was depleted from the suit during that time). Cargo parts (air canisters or whatever) are also refilled during that time, so resources are consumed according to Total Original Capacity (including cargo parts) * Time Spent on EVA / Max EVA Time (defined by settings and/or reasonable max time per unit of air assumed to be in suit and augmented by cargo part, etc.). Maybe.

 

Edited by AccidentalDisassembly
Link to comment
Share on other sites

1 hour ago, AccidentalDisassembly said:

I like both of those ideas - the logic seems sensible to me, e.g.:

  1. Kerbals can last for X hours/days (user defined via difficulty setting maybe) on EVA without food (and/or without a fresh air resupply or other resources) - cargo parts with relevant resources increase total hours/days before penalties on EVA.
  2. Beyond X hours/days, penalties apply according to settings (reputation loss, fainting, death...), or something like that.
  3. Kerbal becomes absolutely voracious after EVA if snack cycles missed & no snacks in cargo part, attacks the snack cart upon reentering a vessel, making up for missed snacks by consuming <appropriate quantity>.
  4. Kerbal refills suit (so it's always ready to go) upon reentering craft as well, so X Fresh Air (or whatever other resources are enabled/used) are consumed after EVA, depending on how much time the Kerbal spent outside (representing how much air, oxygen, water, whatever was depleted from the suit during that time). Cargo parts (air canisters or whatever) are also refilled during that time, so resources are consumed according to Total Original Capacity (including cargo parts) * Time Spent on EVA / Max EVA Time (defined by settings and/or reasonable max time per unit of air assumed to be in suit and augmented by cargo part, etc.). Maybe.

 

I think I finally hit on how to make this work:

Each astronaut already has astronaut data associated with it, and it's pretty robust. I'm testing out a way to add resources to that data. When a kerbal goes EVA, those resources are replenished as they are now. I'll also have a resource helper that will display the current/max amounts in the part action window. Essentially, this setup avoids the stock resource display/burn bug and moves the output to the PAW. If it turns out that Squad fixes the eva resource display/usage bug, then I can undo the changes.

Link to comment
Share on other sites

Snacks 1.26.0 is now available:

Changes

- If a kerbal on EVA consumes a resource and it dips below minimum safe levels, then the player will receive a warning message.
- In Debug mode, the Snack Time button will become available in the Snacks flight app window.
- Fixed Snacks App Window not updating resource values properly after snack time.
- Fixed NRE generated when opening the Snacks window and there is a kerbal on EVA.
- Fixed issue where EVA resources were consumed when the jetpack is used. NOTE: Use the in-flight Snacks window to see the EVA kerbal's resources, they're no longer
visible in the Resources window due to the stock EVA resource consumption bug.
- Fixed crash issue that occurs when placing parts with crew capacity in symmetry.
- Fixed issue in Snacks App Window where kerbals on EVA would display their crew count.

Link to comment
Share on other sites

On 3/16/2021 at 6:31 AM, delta5 said:

Can I use stockalike station parts redux to make more snacks? Or is there a mod that adds a greenhouse that works with this mod?

Spacedock link is here:

https://spacedock.info/mod/767/PSA Greenhouse

I haven't gotten around to updating the compatibility info. PSA Greenhouse is a pure parts mod - so it's compatible up through 1.11.2. If you do use it, and find any issue with balance re: Snacks, let me know and I'll update it and post a new version on Spacedock.

Link to comment
Share on other sites

I am facing a strange problem. Resource bars in VAB are flipping positions when selected for parts with snacks inside. When I change thrust or fuel amount for Flea booster, you can see in command pod resource bars are flipping, too.
ImrKN2e.gif

I've uninstalled everything, then freshly installed Kerbals from Steam, then installed only Snacks (I just enable death option for career). The problem happens on both manual extracted ZIP and CKAN installation. KSP is the newest actuall (I installed it today), snacks is 1.26.

It is not gamebraking, but very annoying. Did anyone else face such a problem? Are you Angel-125 able to reproduce it?

EDIT: I've made a sanity check and I replaced snakcs 1.26 with 1.25.2. Now the bars work without any problem!

Edited by Glassius
Link to comment
Share on other sites

Also getting two funny behaviors related to Snacks!, @Angel-125 - or rather the first one seems to be for sure, and the second one is just... I don't even know:

EDIT: First one might just be CCK doing its thing, but second one is definitely Snacks-related:

Behavior 1: when Snacks and CCK are installed, several parts don't appear under their normal categories (Utility, Pods, whatever), and instead only appear under the Life Support category. These include (so far, that I've seen):

  1. the Mk3 Shuttle cockpit (should also show in Command/Pods)
  2. the Mk2 crew cabin (should show up under Utility too)
  3. Lynx life support bag, container, and module (which should also show up under 'Rovers', probably)
  4. The 2-crew Mobile Processing Lab from the ScienceLabInfo mod (should also be under Science)
  5. The PPD-12 itinerant service module from SSPXR (should be under Utility too, I think)
  6. OPT K and J mobile labs (which should be under Science too)

By contrast, parts that DO appear in more than one category (as they should, in both Utility and in Life Support, for ex.) include these:

  1. SSPXR's Volleyball, Winston, and Eclair inflatable habitation
  2. SSPXR's 1.25m Sunrise and Star hard-sided hab modules

(This is on a career save, so there are probably other parts affected like this, but I don't have everything unlocked/researched.)

Behavior 2 that may have nothing to do with Snacks at all, or maybe it does I can reproduce with only Snacks and ModuleManager installed on clean KSP 1.11.2 with BG and MH: when alt-copying parts in the editor (same very modded career game), I can alt-copy many parts with expected results (copy of part appears picked up under mouse cursor). However, some parts (such as SSPXR habitats, greenhouse, the Hitchhiker..) perform a magic trick when alt-copied, and one of two things happens: a) the part gets duplicated, but placed centered, unattached in space and not 'picked up' by the mouse - UNDER the VAB floor!; or b) if the part has been rotated in the editor and THEN copied, it will appear slightly ABOVE the VAB floor. Visually, the copied parts sometimes do not appear transparent (as they normally do when floating unattached in space), but are in fact neither attached nor selected.

This made me think maybe, somehow, in some way, whatever fix was made regarding Snacks! + alt-copying SSPXR parts could be having an impact here because *I THINK* the common denominator is that all of the parts that get sent under the floor when copied have crew capacity, and all of the ones that copy with expected beahavior have only resources/converters/whatever, but no crew capacity.

Log: https://www.dropbox.com/s/1y2o4wd8f93l43f/ksplog_snackscategoryandcopying.log?dl=0

 

Edited by AccidentalDisassembly
Link to comment
Share on other sites

@AccidentalDisassembly I believe that behavior is from CCK itself. The OPT labs tag themselves as cck-lifesupport items (reflecting their possessing Snack Processors) so that they appear in CCK's life support items category, but CCK itself removes them from their original categories so they only appear in the categories bundled with CCK. Snacks! doesn't have a config to move parts other than its own.

2 hours ago, AccidentalDisassembly said:

the part gets duplicated, but placed centered, unattached in space and not 'picked up' by the mouse - UNDER the VAB floor!

This has happened to me a lot, and typically happens only with crewed parts, but I don't remember if I had Snacks! installed when that happens.

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