Jump to content

[1.2.2] Ioncross Crew Support v1.26.0 (Starwaster's branch) - Jul 7, 2016


Starwaster

Recommended Posts

Thank you Starwaster. That resolved the issue, at least until the bug can be fixed.

I've found the source of the bug; there's null ref errors being generated when Ioncross tries to create and move resources to the EVAing Kerbal. Since it's never successful, it keeps on trying. It's like he's standing there with the hose gushing O2 into space while he vapidly stares into the middle distance, forgetting to attach the hose to his backpack.

The thing that worries me is that I might have introduced this bug with my refactoring because I don't remember it happening before. Or if it was, nobody ever mentioned it :(

So when I get a chance I'm going to load up with the original version and if I can't reproduce then I'll just rollback. Unfortunately then I'll have to go back and re-fix the bugs that I fixed before. But that's the problem with trying to pick up other people's code :(

Link to comment
Share on other sites

I've found the source of the bug; there's null ref errors being generated when Ioncross tries to create and move resources to the EVAing Kerbal. Since it's never successful, it keeps on trying. It's like he's standing there with the hose gushing O2 into space while he vapidly stares into the middle distance, forgetting to attach the hose to his backpack.

The thing that worries me is that I might have introduced this bug with my refactoring because I don't remember it happening before. Or if it was, nobody ever mentioned it :(

So when I get a chance I'm going to load up with the original version and if I can't reproduce then I'll just rollback. Unfortunately then I'll have to go back and re-fix the bugs that I fixed before. But that's the problem with trying to pick up other people's code :(

If you try and older version and the bug isn't there, can't you just compare the older version with the new and look at the changes that were made? That might help you determine where the null ref error is coming from.

Link to comment
Share on other sites

If you try and older version and the bug isn't there, can't you just compare the older version with the new and look at the changes that were made? That might help you determine where the null ref error is coming from.

Of course!

Link to comment
Share on other sites

Progress: As you can see, Jeb has oxygen resources during EVA now. (this wasn't happening before and the Ioncross EVA functions would continue to move oxygen over to the EVAed Kerbal until there was none left)

What's still not working is that resources are not moved out of the Kerbal when he enters a ship. Apparently that part wasn't finished but it should be 1-5 lines to make it happen.

Un97zy4.png?1

Edited by Starwaster
Link to comment
Share on other sites

I can verify that kerbals take 0.5 units of O2 when they go on EVA now. And it gets used up while they're doing the EVA. And it looks like they do put back any unused O2 when they return from EVA. So it looks like you got that issue resolved.

This next I'm not sure is an issue or simply me not understanding how the system is supposed to work. I've had an expedition at Mun now for around 5 days, plus the time it took to get to Mun, so nearly 7 days all told. The ship I sent includes a landing module with a capsul, and a command module with a Mobile Processing Lab. 1 Pilot in the capsule. 2 Kerbals in the MPL. After 7 days of activity I still have 20.0 O2 in the Capsule (with 0.11 CO2) and 40.0 O2 in the MPL (with 0.08 CO2). Do the scrubbers continue to run until the CO2 limit is reached before you actually start "losing" O2? Seems like the O2 use rate, Scrubber rate ad CO2 production rate need some tuning. The way it stands now I think I could keep a Kerbal alive in a powered capsule for months, meaning there is never a reason to include any of the other life support modules.

Link to comment
Share on other sites

I can verify that kerbals take 0.5 units of O2 when they go on EVA now. And it gets used up while they're doing the EVA. And it looks like they do put back any unused O2 when they return from EVA. So it looks like you got that issue resolved.

This next I'm not sure is an issue or simply me not understanding how the system is supposed to work. I've had an expedition at Mun now for around 5 days, plus the time it took to get to Mun, so nearly 7 days all told. The ship I sent includes a landing module with a capsul, and a command module with a Mobile Processing Lab. 1 Pilot in the capsule. 2 Kerbals in the MPL. After 7 days of activity I still have 20.0 O2 in the Capsule (with 0.11 CO2) and 40.0 O2 in the MPL (with 0.08 CO2). Do the scrubbers continue to run until the CO2 limit is reached before you actually start "losing" O2? Seems like the O2 use rate, Scrubber rate ad CO2 production rate need some tuning. The way it stands now I think I could keep a Kerbal alive in a powered capsule for months, meaning there is never a reason to include any of the other life support modules.

Sorry I missed this;

Something doesn't sound right there... you should definitely see O2 being depleted. CO2 should not build up unless the scrubbers are turned off. Right click the capsule to turn them on.

So basically your Kerbals are generating CO2 without breathing O2? I'm definitely not seeing that behavior.

Link to comment
Share on other sites

Wow, Ioncross is under development again? Thank you, so so much!

Yup, I'll be checking out Ioncross today under 0.24 and seeing how it behaves. If necessary I'll release an update to get it working with 0.24. If nothing immediate is necessary then I'll post that and I'll be investigating the issue that chrisl reported. Though I'm pretty sure that I've previously verified that O2 levels deplete as they should and CO2 levels only accumulate when scrubbers are turned off.

Link to comment
Share on other sites

Sorry I missed this;

Something doesn't sound right there... you should definitely see O2 being depleted. CO2 should not build up unless the scrubbers are turned off. Right click the capsule to turn them on.

So basically your Kerbals are generating CO2 without breathing O2? I'm definitely not seeing that behavior.

Actually, I think what is happening is every time I return from EVA, more O2 is put into my capsule then was taken out. I ran a 5 day flight where I didn't do any EVA and it appeared that O2 and CO2 did what was expected. Then I ran another flight where I did several EVAs. If I left the capsule has 19.95 before the EVA, it would be back to 20 after returning from the EVA. So I did some EVA testing with the MPL. Had one Kerbal do the EVA and while he was out, I'd switch back to the ship. What I noticed is that every time a Kerbal does an EVA, he's taking 0.5 O2 with him. I thought from the cfg file that Kerbal's were supposed to take 1.0 so I'm wondering if the code is taking 0.5 but returning 1.0 which would explain why I seemed to never be using up O2.

This was all done under 0.23.5. I've got Ioncross on my 0.24 install but haven't progressed far enough in my new game to really be using O2. Soon as I do (or maybe I'll just start up a test game) I'll run more tests.

Link to comment
Share on other sites

Actually, I think what is happening is every time I return from EVA, more O2 is put into my capsule then was taken out. I ran a 5 day flight where I didn't do any EVA and it appeared that O2 and CO2 did what was expected. Then I ran another flight where I did several EVAs. If I left the capsule has 19.95 before the EVA, it would be back to 20 after returning from the EVA. So I did some EVA testing with the MPL. Had one Kerbal do the EVA and while he was out, I'd switch back to the ship. What I noticed is that every time a Kerbal does an EVA, he's taking 0.5 O2 with him. I thought from the cfg file that Kerbal's were supposed to take 1.0 so I'm wondering if the code is taking 0.5 but returning 1.0 which would explain why I seemed to never be using up O2.

This was all done under 0.23.5. I've got Ioncross on my 0.24 install but haven't progressed far enough in my new game to really be using O2. Soon as I do (or maybe I'll just start up a test game) I'll run more tests.

hrrm ok I'll check it out

Link to comment
Share on other sites

Got to a point where I could test my theory. This first image was taken after just over 5 days in orbit without a single EVA. My oxygen reads 19.67.

806F1F744498C438E17614806408A8099C740D2D

I then took a quick EVA and another screen shot after reboarding the ship. Notice that my Oxygen is back at 20.00.

48B00C46877AD88FB556AD84FF9D39982992E39A

So I advanced time again. Next shot is about 10 days later and my Oxygen is down to 19.34.

B9511C5774416E137534DC776E35AA242F6C39E4

And immediately after a short EVA, this next shot shows it's back up to 20.

DB38293194414AF7558E855BB920E6C289E52EEF

So one last sequence, I move to a higher orbit so I can advance time more rapidly. This next screen shot shows that after just shy of 49 days in space (with the two brief EVA's previously mentioned), I'm down to 17.93 Oxygen.

4AAA831924A7AE7A2D98CA638AF21A58723FA013

But after one final brief EVA, this last screen shot shows that I'm back up to 20 Oxygen.

D11491E0577EA0C41BF628AC36E93CF05C19D648

I'm not at a point where I can fly a ship with multiple Kerbal's but I'm certain (from older tests) that when I send a Kerbal on EVA, he takes 0.5 Oxygen with him. But when he returns to the ship, he somehow manages to fully restore the ships O2 supply.

Also, I'm pretty sure I read one of the component descriptions that said a Kerbal uses 1 unit of O2 per day. But the last two images are 34 days after the previous EVA and I've only managed to use 2.07 Oxygen. At that rate, without going EVA to resupply my O2, a Kerbal in a standard capsule with only 20 units of Oxygen can last 319 days, 2 hours, and 20 minutes. Give or take a few minutes. :) That seems exceedingly excessive.

Link to comment
Share on other sites

yeah, i have the same issue as chrisl!

Oh and also... one kerbal needs 0.2 Oxygen per Day? So the default MK1 pod (20 o²) contains oxygen for full 100 days? This is kinda freaky, maybe u should consider setting those pods lower like from 20 to 0,4 ? :P

Link to comment
Share on other sites

I agree, a capsule by itself shouldn't carry enough O2 for a third of a year. Going over the resource consumption is a priority. I want for it to go by O2 mass with humans as a base but scaling it to 1/3 - 2/3 as I see Kerbals as having a comparable metabolism as humans but with much less tissue mass.

Previously I had a custom config file for Ioncross that I played with but I don't have it around right now... if I can dig it out of my old computer I'll probably use it as a base.

Another thing is that the CO2 threshold will get a lot lower. IRL, CO2 concentration starts getting dangerous at 10%. From the looks of things, that's what Ioncross was aiming for except that would be 10% of the capsule's volume of air, and not its storage. And 20 O2 would surely have to be how much it has in its tanks, not how much is floating around the cabin. So CO2 will get lethal if it builds up at all, but for that to mean anything, then we'd have to go by some sort of cartridge (resource based) and if you run out you can't scrub CO2, or else you better have lots of greenhouses. Turns out that plants aren't really that great at removing CO2 for us, there has to be a LOT of plant mass per human. (which is why we have to stop screwing over our rainforests...)

If anyone has any suggestions on the CO2 issue, definitely want to know what people think. Right now, CO2 scrubbing is pretty much free as long as you have electricity. Its only purpose that I see it having right now is to have a waste product to recycle.

So, yeah, have to figure out how much kerbals actually need per O2 mass (and then convert that to volume since KSP's resource system is volume based), O2 capsule stores need to get lowered, and capsule size figured out. (will likely assume a standard amount of volume based on crew cap which should work for most parts)

Although, config work also has to take a backseat to actual bug fixing, and the EVA thing qualifies

EDIT:

Ok, I decided to get some exact numbers on the EVA issue and conducted some rather extensive tests in which I gave Jeb a years supply of snacks, a Mk1 pod and fired him into solar orbit. Don't worry, the snacks will NOT run out before the oxygen.

Promise.

I ran his oxygen all the way to zero(0), which took about 321 Kerbin days or 80 of our days. (remember, Kerbin's days are only 6 hours long). Henceforth, we will only concern ourselves with our time units since that's ultimately what Kerbal resource consumption will be based on.

First, before Jeb ran out of O2, I took him on EVA a few times and then jumped back to the pod. Jeb took exactly 1 volume unit of O2 with him every time. Just as when I originally tested the EVA oxygen .

When reentering the pod, he deposited 8.99 volume units of oxygen. I guess the brief time he was out he used up 0.01.

9 seems like kind of an odd number, but that's what it is. The good news is, the code that handles EVA resources being returned to the ship is all mine, so it shouldn't be too hard to figure out where the bug is. I suspect it's an error in conversion because EVA resources (as handled by Ioncross) are virtual resources, not real ones. O2 was removed from the ship but it didn't move to Jeb, it just got deleted. Then the system converts that into a percentage. 1 unit of O2 is 100% EVA O2. It's not the way I would have done I had designed the system but that's what it was and so I kept it that way. After this I might go back and make it real resources. Seems to me it would be harder to make mistakes like this it were that way.

EDIT #2:

Wow. I think I found the problem. I'm detecting when Jebediah is boarding the capsule via an event that gets called when Kerbals board a ship. It's being called at least 6 times every time Jeb boards..... I should have known, I've seen signs of this before from other mods or even stock KSP where a game event is being called more than once.

Edited by Starwaster
Link to comment
Share on other sites

Well, that would explain why more then 1 unit of O2 is being "returned" to the ship. :)

As for how much O2 a kerbal should user per Kerbal day, I think 1.0 is good. That gives a standard Mk1 pod 20 days worth of O2 which is plenty. If you need more then that, add an Oxygen module. It also gives a Kerbal on EVA a full Kerbal day of O2 which is more then enough. I honestly wouldn't get too complicated with volumetrics and such. One of the reasons I picked IonCross was it's relative simplicity. I liked the idea of needing to pay attention to Oxygen without having to get too detailed.

As for CO2, I'm not sure how great an idea cartriges would be. I would think that would add an additional coding complication. Besides, if your capsule comes with 20 Kerbal days of O2 (as an example) then you'd expect it to also have 20 Kerbal days worth of CO2 scrubbing cartridges. That said, increasing the power cost for the scrubber wouldn't be bad. Right now the Mk1 uses something like 5/hr to power to CO2 scrubber, which is pretty insignificant (.0014/s) compared to the SAS module's 0.24/s cost. Increase the electric charge for the scrubber by a significant amount (say .2-.5/s) and I think you'll make CO2 monitoring more of a concern.

Link to comment
Share on other sites

Well, that would explain why more then 1 unit of O2 is being "returned" to the ship. :)

As for how much O2 a kerbal should user per Kerbal day, I think 1.0 is good. That gives a standard Mk1 pod 20 days worth of O2 which is plenty. If you need more then that, add an Oxygen module. It also gives a Kerbal on EVA a full Kerbal day of O2 which is more then enough. I honestly wouldn't get too complicated with volumetrics and such. One of the reasons I picked IonCross was it's relative simplicity. I liked the idea of needing to pay attention to Oxygen without having to get too detailed.

As for CO2, I'm not sure how great an idea cartriges would be. I would think that would add an additional coding complication. Besides, if your capsule comes with 20 Kerbal days of O2 (as an example) then you'd expect it to also have 20 Kerbal days worth of CO2 scrubbing cartridges. That said, increasing the power cost for the scrubber wouldn't be bad. Right now the Mk1 uses something like 5/hr to power to CO2 scrubber, which is pretty insignificant (.0014/s) compared to the SAS module's 0.24/s cost. Increase the electric charge for the scrubber by a significant amount (say .2-.5/s) and I think you'll make CO2 monitoring more of a concern.

Cartridge scrubbers wouldn't require any 'coding' at all, not in the sense I think you mean it. It would be a config change and the addition of a new resource. On a related note, one thing I want to do is release a set of configs that simplify Ioncross even further. They would be optional for those that find even Ioncross to be 'too intense'. (yeah... I saw that said about 'existing life support mods' somewhere). Basically it would turn O2 and CO2 into 'Lifesupport' and 'Waste' and consumption would definitely be at the 1 per day that you suggest, but it would be a Kerbin day so that those who just play stock could jump right in and not get confused by anything. Waste would not have deadly results for buildup and wouldn't even be visible to the player. Its sole purpose would definitely just be something to give the Recyclers something to feed on so that you could just stick them on your ship and Lifesupport would last longer without anything confusing to new players.

Conversely, I want to do set of configs that are a little more complex, for advanced users, but I haven't really thought much about specifics.

And I think a new LSS resource is in order too.... Snacks. If snacks are not present aboard the ship, it becomes uncontrollable as the Kerbals drop into a catatonic state until someone brings them a fresh supply of snacks. In fact, a new contract type is in order too.... snack run!

Now then... it is update time. This should fix the EVA issue, including Kerbals consuming O2 while on Kerbin. (you did notice that didn't you?). If this works out ok (still in testing over here so please try it out and tell me how it works for you) then I'll be pushing this for download and updating the front page.

EVA Fix and Release Candidate for 0.24

Edited by Starwaster
Link to comment
Share on other sites

*chuckle* No, I hadn't noticed that they were using O2 while sitting on Kerbin. Then again, I don't have them sitting on Kerbin very often. I did notice that the air vents haven't been automatically opening when in an atmosphere (I believe they did in an older build) but didn't see that as a huge issue. I've downloaded the RC and will test it tonight. I'm out of town for part of the week, though, so may not get to report more findings (good or bad) until later in the week.

Link to comment
Share on other sites

Wow... i love the Idea of having "Lifesupport" Ressource that would get consumed 1 per kerbin day! That would make it so clear and easy to see how much days u got left without any electic algae thingy :D Thats also a reason that disturbed me in TAC, besides the 5 ressourced with confusingly high numbers....

I never noticed that O2 consuption on Kerbin... im more the "spacy" kinda player, i guess :D

Well.... i will keep an eye out for bugs while kerbals suffer in lack of O² :D

Link to comment
Share on other sites

OK, not really sure when or why the vent thing started... it might be related to the way I changed how they get added in. It's a problem with persistence and the way they're being loaded in and saved originally and I had to change part of that because Module Manager kept killing the modules in the save file. In the short term I'm probably going to go in and set certain variables so that they're saved to the save files, but it shouldn't be necessary because they're not variables that are even supposed to change once they're added to the part, but for whatever reason, it looks like Ioncross doesn't think the vents are automatic. (vents, FYI are just generators that are configured a certain way to add resources)

Edit: Ok, after careful scrutiny of my log files, I can see that Ioncross clearly thinks that the vents ARE supposed to be automatic when it loads in their information, so why isn't it applying that? Grrrrr.

Edit: Testing fix for atmospheric vents. Will push to Github for you guys to test it after I check it out here.

Edited by Starwaster
Link to comment
Share on other sites

Hi Starwaster,

Do you have any interest in changing to 1 unit = 1 liter?

There's a couple of reasons I'm asking. First up I want to create a IonCross pack for Universal Storage and even though I can convert it to use your units, liters is easier. Second, It would help with compatibility with other mods that use the same resources, if everyone is using the same units.

If you were interested in doing so I've already some some research for another mod and have information on usage rates taken from NASA sources, shares here:

http://1drv.ms/1kjbfeU

Link to comment
Share on other sites

Hi Starwaster,

Do you have any interest in changing to 1 unit = 1 liter?

There's a couple of reasons I'm asking. First up I want to create a IonCross pack for Universal Storage and even though I can convert it to use your units, liters is easier. Second, It would help with compatibility with other mods that use the same resources, if everyone is using the same units.

If you were interested in doing so I've already some some research for another mod and have information on usage rates taken from NASA sources, shares here:

http://1drv.ms/1kjbfeU

Where it makes sense, yes. For things like compressed gasses, such as O2, it doesn't make a lot of sense to do it that way. Right now, O2 and CO2 are the only resources being used so O2 will be compressed and CO2 I don't intend to treat as a real resource as I want it to represent a concentration of CO2 in the cabin's air volume.

The mod also has food and water which are currently unused. Those can definitely be liters but I have to change the density because it's set to something strange, at least for water.

Also guys, hitting a snag in testing. First mission I loaded up broke. Frozen camera, Inc = NaN so I'm not sure what happened there. Might have been some 0.24 glitch. Continuing testing.

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