#Kerbal Life-Support System (KLSS)

1 messages · Page 3 of 1

sudden oriole
#

github has 5x the compute time

#

And bigger group sizes

#

otherwise it looks alright

surreal bridge
#

Yeeted the stock ResourceFlowRequest shenanigans from my mod, was annoying and didn't provide anything useful
ResourceContainerGroup.RemoveResourceUnits is my new best friend

#

Made my code shorter and easier to understand too

#

Life-support supplies ignore cross-feed and stuff, but eh, makes everything way easier

solar yarrow
#

What's the difference between one and the other?

#

For Orbital Survey I've noticed that the ResourceFlowRequest tends to break on very high warp factors, 10000+ I think. So a better way would be nice

surreal bridge
# solar yarrow What's the difference between one and the other?

For KLSS: I want to be able to "ignore" overflow for waste resources, ie set their production to zero when full
With ResourceFlowRequest this didn't work well and it would require me sending multiple requests each time
With "direct resource editing" it works seamlessly

surreal bridge
#

I'm trying to figure it out too for my recyclers which are stock resourceconverters

solar yarrow
surreal bridge
surreal bridge
# solar yarrow What's the difference between one and the other?

Ah another difference: directly editing the ResourceContainerGroup should be less performance-intensive than using the ResourceFlow system (no need to compute flow graphs and stuff like that, an equal amount of the resource is taken from/ added to all containers on the vessel)

solar yarrow
#

Equal meaning, if you want to take 10 resources and you have 2 tanks, do you remove 5 from each or 10 from each?
(p.s. I didn't have time yesterday to try this)

surreal bridge
#

It's nice for LS and stuff like Electric Charge where we don't really care about container priority and stuff like that

#

But for stuff like fuel the flow requests are definitely needed (well they were made for that I think)

#

Regarding the high time warp issues, I still haven't found a configuration that is stable at warp >=100 000x :/

solar yarrow
#

Alright, that's good to know! Yeah, it's not crucial for EC to follow priority. Would be nice one day when we get to RO playmodes where you have to min/max resource utilization, but good enough for now.

surreal bridge
#

hmmm I broke my Unity

#

I tried setting up my stuff by taking inspiration from the SW Template UI project but I might have borked something along the way

atomic geyser
#

Probably it's just called multiple times

#

iirc

surreal bridge
#

If I remove the factory from my control Unity loads fine

#
using UnityEngine.UIElements;

namespace KerbalLifeSupportSystem.Unity.Runtime
{
    /// <summary>
    ///     Life-Support UI entry horizontal divider
    /// </summary>
    public class LifeSupportEntryDividerControl : VisualElement
    {
        private const string ClassName = "ls-entry-divider";

        public LifeSupportEntryDividerControl()
        {
            AddToClassList(ClassName);
        }

        public new class UxmlFactory : UxmlFactory<LifeSupportEntryDividerControl>
        {
        }
    }

The control for reference

silver jungle
#

huh that's weird

surreal bridge
#

Do I need to add the asmdef from the UI template? Where does this come from?

silver jungle
#

Unity sometimes spazzes out when you don't have asmdefs for your code (especially when using ThunderKit and imported KSP2) and messes up the load order

#

so I just use them out of habit for everything

#

you can just make one by right clicking in the folder with your code in Assets and creating an Assembly Definition

surreal bridge
#

that worked!

#

thank you!

silver jungle
#

gotta love Unity

#

lol

atomic geyser
#

😄

surreal bridge
#

UI rework taking longer than I thought, maybe because I want to add some features and I haven't touched UI code in a long while ahah

atomic geyser
#

awesome!

surreal bridge
surreal bridge
silver jungle
#

Nice! Those are all things that I'm definitely planning to implement in UITK 3.0

#

All the custom controls!

atomic geyser
silver jungle
#

it will be much better now that we actually have a solid foundation for UITK in 2022.3

#

I kinda didn't want to get into the custom controls a lot because of how buggy the UITK preview package was

#

and now the devs are also working on unifying the game's UI more and more, so that also helps me a lot

#

not having to pick from 5 different styles

surreal bridge
surreal bridge
# surreal bridge

some more progress, I'll need to look into Click Through Blocking and Input Locking for all of that stuff

silver jungle
#

input locking is built into UITK for KSP2

#

click through blocking will be added in the next release, for now you can use @atomic geyser's extension method

#

I might as well make a 2.5 release with just the click through blocking, it's a very useful feature, no reason to wait for 3.0 with it

surreal bridge
#

(don't know how extensions and stuff like that works)

silver jungle
#

I specifically call it only for text fields

#

but you can call the method on other elements yourself

surreal bridge
silver jungle
#

They are! You can just add a method to any (non-static) class

#

the DisableGameInputOnFocus method is an extension for VisualElement

#

so you can use it with anything

#

though it relies on the element having FocusIn and FocusOut events

#

if those don't happen, then it won't do anything

west gate
#

I've run into a problem where an inactive vessel that used to be self-sufficient (with enough greenhouses and recyclers to maintain infinite time) will start to show a finite time in the life support window. But the strange thing is that even though it has a specific timeperiod left, the counter doesn't go down over time even when the game is not paused. If I go to the vessel, turning on and off the recyclers don't seem to have an affect on the life support window, which still shows the constant time left. when the recycler is on, there is an unfilled {u1} token in the water output. See the screenshot below:

#

if I try to do a quick save and restore at this point~~, the game hangs.~~ I'm able to reload, and the {u1} artifact goes away, but the ship still doesn't seem to be calculating KLSS statistics and toggling the recycler again brings back the {u1} artifact.

#

The work around I have found that seems to work is to:

  1. Restore from before I went to the affected vessel.
  2. Crate a replacement vessel in the VAB
  3. Teleport the replacement vessel to the problem vessel
  4. Kerbals go from the old vessel to the new one via EVA
  5. Go to tracking station and delete the bad vessel
#

I've had this happen a number of times. Would a save game be helpful? I could give you one that has it before I went to the affected vessel if that would help

#

BTW I love this mod! I really like the extra parts and having the additional design considerations to satisfy the kerbal's needs. Thanks so much for it!

#

Here's my save game in case it is helpful. Affected vessel is Starship-9.

surreal bridge
#

Thanks for the report and savegame, I'll look into it!

surreal bridge
#

more UI progress

#

(work on my mods is slow 'cause motivation is not very very high)

atomic geyser
surreal bridge
#

I think the controls are done, now to tie all of this with some nice logic

sudden oriole
#

I need a grid table for my markdown renderer

west gate
#

Looks awesome!!

surreal bridge
#

Hmmm my UI asset bundle is 46MB now, did something change with UitkForKsp2?

silver jungle
#

yep, fonts for Chinese, Japanese and Korean

#

they're each around 15 MB

surreal bridge
#

Ohh I see

silver jungle
#

the workaround is to never directly reference the font assets, instead use the provided variables

#

that will make sure the fonts don't get copied

sudden oriole
#

And a few restarts of unity after changing that

surreal bridge
#

Yeah I saw that variables tend to make the UI Builder very unstable for some reason

silver jungle
#

really?

#

I haven't seen anything like that

#

in the UI Builder, specifically

surreal bridge
#

Don't know if it's variables, but I have been having issues where unsaved progress was deleted when saving because of some Font warnings

silver jungle
#

that usually only happens to me when some of the USS or UXML is changed from outside of Unity

#

as for the font warnings, honestly no clue why these happen I think it's basically whenever the font atlases get updated because you added some new text to the UI, and so the newly used characters get added to the pre-computed portion of the (otherwise) dynamic atlas

surreal bridge
#

Hmmm I think my multi-project setup is broken, I'll take a look at the template again

surreal bridge
#

Hmmm everything is very broken, I'll probably move to a clean new project

surreal bridge
#

huh

#

also appbar icon is gone??

silver jungle
#

oof

#

any errors for that Assembly.LoadFrom call in your plugin?

surreal bridge
#

oh wait

#

forgor to call it 🥹

silver jungle
#

oh lmao

#

that would do it

#

it's there in the template, but I assume you just copied over the plugin file with your own

surreal bridge
#

I copied the snippets of code I needed

#

And forgot this line lol

#

alright that's better, but now to find out why it's opened by default

silver jungle
#

well, it is unless you hide it in the code when you first load it

surreal bridge
#

Ohh okay, imma just add a lsMonitorController.IsWindowOpen = false; then

#

that's better

#

some styling needs fixing

#

also I'll add a "show empty vessels" toggle

#

and maybe a "show active vessel on top"

atomic geyser
#

These toggles would be definitely useful

#

PS: I think on your top bar there is a Flex Shrink: 1 setting which is shrinking the tabs & search field

#

iirc if you set flex-shrink: 0 it should keep its height

surreal bridge
silver jungle
#

there are the ones with the .toggle class

#

though it seems like they're mostly getting rid of this style of toggles with the UI unification, so I'll probably try to rework them to look like the other type

silver jungle
#

yeah that's the new(er) ones

surreal bridge
#

more progress, need to get filtering & sorting trigger done next

#

also increase opacity a bit

#

ugh the old UI was so ugly in comparison x)

radiant jay
#

It's wierd to have a colored logo

woven badger
solar yarrow
#

Join the Dark Side

woven badger
#

I mean, really...

woven badger
surreal bridge
#

I like my color logo nooooooooo
Only 2 colors, not much data needed

atomic geyser
woven badger
solar yarrow
#

Your biological and technological distinctiveness will be added to our own.

#

And we managed to cross the franchises, that's a big no no, bad leonardfactory 🙂

woven badger
#

"I'm Homer of Borg! You will be assim... Oooh! Doghnuts!"

atomic geyser
#

I said that knowing that I was crossing a line I shouldn't cross

#

😄

solar yarrow
atomic geyser
#

LOL

silver jungle
surreal bridge
#

ok switch statements with patterns are pretty cool

sudden oriole
#

C#'s pattern matching is quite useful

silver jungle
#

C# is awesome

sudden oriole
dim basin
#

Java isnt that bad its pretty similar to me

silver jungle
#

it's basically C#'s uglier cousin

#

and a bit of a boomer

dim basin
#

Isnt kotlin jus tlike a newer version of it

silver jungle
#

not really

#

it's a completely different language

#

just like Scala

surreal bridge
#

Hmmm I upgraded my KLSS project to C# 12 and now it looks like changes to my code don't affect the mod in-game

silver jungle
#

and all of them run on JVM

dim basin
#

scala????

silver jungle
#

similarly to how C#, VB and F# are all very different languages that all run on .NET

surreal bridge
dim basin
silver jungle
#

we use it in SpaceWarp just fine

dim basin
#

or javascript

silver jungle
#

all you need to do is have .NET 8 installed

#

and you can use any C# 12 features

silver jungle
#

are you rebuilding the solution?

surreal bridge
#

Pretty sure I am?

silver jungle
#

(as opposed to just building)

surreal bridge
#

ah

silver jungle
#

you might also want to delete the build and dist folders, and then run nuget restore

#

just to clean stuff up

silver jungle
#

since sometimes VS can just decide it doesn't need to rebuild everything

sudden oriole
#

I map ctrl-shift-f9 in rider to force rebuild

silver jungle
#

same

surreal bridge
#

I think I broke smthg

silver jungle
#

what's that before?

surreal bridge
#

how tf did I break save loading

silver jungle
#

huh

#

how did you

surreal bridge
#

I just upgraded my projects to C# 12 nooooooooo

silver jungle
#

how did you do that?

#

just installed .NET 8 and this happened?

surreal bridge
#

installed .NET8
changed stuff in the csproj
use upgrade-assistant tool thingy

silver jungle
#

there shouldn't really be any need to change the csproj to be honest

#

well, that is if your LangVersion is set to latest

#

it will just automatically go from supporting 11 to 12

#

and I have no clue what the upgrade assistant thing is

surreal bridge
#

found the issue, I was setting TargetFramework to 8.0 ><

surreal bridge
#

I think I got everything working as it should!

silver jungle
#

Mono doesn't support the newer .NET releases afaik

#

so we must build it as .NET Standard 2.1

surreal bridge
# west gate

Hmmm Starship-9 doesn't seem to have enough EC production to keep all the recyclers running

west gate
#

ah, try using infinite electricity. I have an unpublished mod that you don't have that has a generator as part of it. Pretty sure that isn't the problem... things are locked and don't count down. It isn't just that it isn't recycling.

#

if you aren't able to replicate it with infinite electricity maybe it is an interaction with my mod, but I don't think so

#

I suspect it has something to do with having multiple ships launched based on the same blueprint because I have only seen it when I have more than one team out

surreal bridge
#

Hmm okay I was able to reproduce the issue on the Mk2 vessel

#

water: u1 same as you
I'll look into it right away

west gate
#

awesome! thank you!

west gate
#

since you haven't had the issue on your game, maybe it's somehow related because I have easier settings set?

surreal bridge
#

I am having issues in my game

#

Some stuff is very wrong

west gate
#

ok, great! replicating an issue is usually the hard part

surreal bridge
#

But since I am using the game's stock ResourceConverter for recyclers I don't know what's on me and what's on the game being broken ><

west gate
#

I am not sure it is the resource converters. I've used those too in patch only mods. Even if the resource converter is off, it isn't counting down once it has the issue. It's like something on the consumption side is exceptioning out

surreal bridge
#

I am not seeing the issue of "time not counting down" however

west gate
#

Even on a ship that already has the {u1} issue? If you turn off all converters??

west gate
#

ok, that is strange.

surreal bridge
#

What I'm seeing in the ls monitor is flickering between infinity and some time

#

Sometimes

#

And sometimes it changes based on if I'm time warping or not

west gate
#

That is what happens for me when it is working, but then it freezes to something non-infinite when the converters do the {u1} thing, regardless of whether they are enabled

#

I just had it happen on one again. This time I just had one team out, but I undocked some satellites and was positioning them when it transitioned from working (with the flickering as you described) to stuck. When I switched back the converters output section did not have the issue, but when I toggled it off and on, it did.

#

Could it have something to do with starved converters? I'm not sure, but this might be what happens: I start out, and forget to turn on the recyclers. Then I enable them, typically at around 120% of what I need to keep up. Slowly over time the recycler catches up recycling the CO2 and waste water. It might be when it transitions to the flickering and then I toggle between vessels when the error occurs that somehow corrupts something to do with the vessel and from then on, consumption and recycling are both frozen. Not 100% sure of the timing here, but that is about what happens in my experience

surreal bridge
#

By turning all recyclers off, letting EC recharge, and then turning then back on I have stabilized the situation aof a vessel

west gate
#

were you ever able to replicate the freezing of the count down timers?

surreal bridge
#

No

west gate
#

Hmmm.... let me see what I can do on my side. I'm going to uninstall my mod in case it is causing a problem and switch on infinite electricity to see what I experince then.

surreal bridge
#

I think I'll first push a new release of KLSS with the new UI, then you could try it again with the new version

west gate
#

Were you able to replicate the {u1} issue independently of my saves?

surreal bridge
#

I have never seen it elsewhere, let me try some stuff

surreal bridge
west gate
#

I add resource converters to specific parts. I actually used your code as a ref, and wonder if I did something wrong like use an id from KLSS by accident but I thought I found everything. I'm disabling it and will see whether I can reproduce it without it. I have a hunch I've sent you on a wild goose chase and will update you shortly

#

Hmmm... so unfortunately removing my mod and cycling the converters didn't resolve the issue. Maybe it isn't my mod, but some other mod? Which of the following mods do you not have in your game:

#

I also have CommNext in addition to the above, but I had the issue before I installed that one.

#

As for how I use converters, I have this cheaty patch that adds converters to some fuel tanks. This stuff is lifted directly from KLSS. I think I moved everything KLSS specific out of it, but if you want to take a look here it is.

#

but like I said I removed this patch from the game and still couldn't cycle the converters to resolve the issues

surreal bridge
#

Yeah if you're not modifying KLSS's recyclers I don't see how this could cause any issues

surreal bridge
west gate
#

nope, just shamelessly lifted from yours but not using KLSS tiems

#

So EC is stuck at the highest value, maybe it is related

#

it isn't going down when I toggle

surreal bridge
west gate
#

I am definitely not producing enough if the converters are using the power

#

but I do have a little generation that is on that would handle other stuff

west gate
#

I took out all mods except the following and I still can't recover my save that is already having the issues. In the save I sent you that was Starship-9. Note that Mk2 and Starship-13 were not experiencing the issue in the save game I sent to you. Even with only these mods, I still don't show starship-9 as counting down after carefully stopping all recyclers including the greenhouse and composter. So I'm at a loss and think we should drop it until/if someone else reports the issue.

#

If that happens and I can be of help with testing stuff, feel free to reach out. Thanks for looking at this!

surreal bridge
#

@olive sinew thank you btw for your translations for this mod, I have a few more strings to be localized if you have the time:

Key,Type,Desc,English,Chinese (Simplified),French
KLSS/Notifications/ResourceGraceStarted,Text,,"A vessel has run out of ""{0}""",,"Un vaisseau est à court de ""{0}"""
KLSS/Notifications/ResourceExhausted,Text,,"A Kerbal on board ""{0}"" has died from lack of ""{1}""",,"Un Kerbal à bord de ""{0}"" est mort de manque de ""{1}"""
KLSS/UI/AppBar/Title,Text,,Life-Support,,Support de vie
KLSS/UI/Monitor/Title,Text,,LIFE-SUPPORT,,SUPPORT DE VIE
KLSS/UI/Monitor/FilterVessels,Text,,Vessels,,Vaisseaux
KLSS/UI/Monitor/FilterKerbals,Text,,Kerbals,,Kerbals
KLSS/UI/Monitor/FilterBoth,Text,,Both,,Tout
KLSS/UI/Monitor/HeaderName,Text,,Name,,Nom
KLSS/UI/Monitor/SettingShowEmpty,Text,,Show empty vessels,,Voir vaisseaux vides
KLSS/UI/Monitor/SettingActiveOnTop,Text,,Active vessel on top,,Vaisseau actif en haut
surreal bridge
#

Oh god while testing I saw what the Mohole was called in French and uh I don't know what to do with the info
"Mohorifice", like it makes sense but it's weird

silver jungle
surreal bridge
radiant jay
#

orifice is kind of a hole

olive sinew
surreal bridge
untold fox
#

ok someone make a sequal to deep freeze, sleeper ships would be epic

#

sleeper ship to laythe, land and thaw out the crew, use their onboard supplies to survive for a year, freeze them and return them to kerbin

west gate
surreal bridge
dull arch
#

Question: is there a way to see life support estimates for a ship while in the VAB?

surreal bridge
dull arch
surreal bridge
#

Let me know if it doesn't behave as expected

dull arch
surreal bridge
surreal bridge
#

Will try to set up part variants for the three types of specialized storage parts tmrw (the tiny, the Toblerone and the Cygnus)

sudden oriole
#

Alright
Well itll be at least a few hours till I can get Spring Cleaning on CKAN, so that at least doesnt put a time pressure on me

atomic geyser
#

How silly.. like if we wouldn't find something else

#

/s

sudden oriole
#

Just ping the netkan wrangler role

radiant jay
#

And i know this isnt your job , but there's a bug that allows you to control your vessel even without vessel control

surreal bridge
radiant jay
#

#1208120894254358608 message
Could this be possible someday ?(maybe with Interstellar update?)

surreal bridge
#

Yeah that's definitely possible, but I'll keep that for later yeah

surreal bridge
#

hmmm I think I broke something

#

ah yeah I see many issues lol

#

better lol (some stuff got wonky when copy/pasting game objects in unity

sudden oriole
#

So the separate reentry meshes are working properly

#

?

surreal bridge
#

Yup

surreal bridge
#

6 fewer parts in the OAB letsgo

#

@olive sinew sorry to bother you, I have a few new entries to localize if you have time at some point

Key,Type,Desc,English,Chinese (Simplified),French
KLSS/Variants/TankType,Text,,Tank Type,,Type de Stockage
Parts/Subtitle/KLSS_storage_0v_radial,Text,,Portable Supplies Storage,,Stockage de Provisions Portatif
Parts/Description/KLSS_storage_0v_radial,,,The PSS-10 is an extra small radially attached supplies pack. Perfect for quick rover expedition on another world.,,Le PFS-10 est un petit pack de provisions attaché radialement. Parfait pour les expéditions en rover.
Parts/Subtitle/KLSS_storage_2v_radial,Text,,Triangular Supplies Container,,Conteneur de Provisions
Parts/Description/KLSS_storage_2v_radial,,,The TFC-300 is a medium size radially attached supplies container. This is the kind of chocolate-shaped storage space you'll need for your inter-colonial resupply missions.,,Le TFC-300 est un conteneur de provisions attaché radialement. Ce conteneur de la forme d'une fameuse barre chocolatée est parfait pour réapprovisionner vos colonies.
Parts/Subtitle/KLSS_storage_2v_1x2,Text,,Medium Supplies Storage,,Stockage de Provisions Moyen
Parts/Description/KLSS_storage_2v_1x2,,,The MWS-200 is a medium-diameter supplies storage module. This is what was used on the famous Kygnus resupply vessel.,,Le MFS-200 est un module de stockage de provisions de taille M. Notablement utilisé pour le vaisseau Kygnus.

(you can either send them here where you can or submit a PR on the repo, whatever is easiest for you)

radiant jay
olive sinew
surreal bridge
#

@sudden oriole quick Premonition question: is it possible to access and modify an instance's private fields in a postfix patch?

sudden oriole
#

and from there publicization is the recommended way to access stuff

surreal bridge
silver jungle
#

having the Publicize="true" attribute on your KSP2 GameLibs reference

#

so that you can see and modify private and protected fields

surreal bridge
#

Thank you!

#

hmmm light dark magic

sudden oriole
#

gray magic

surreal bridge
#

When on EVA, being on strike will only prevent from doing experiments I think, otherwise it'd doom them if they can't move to a pod

surreal bridge
#

Urgh the function checking if an experiment is possible is horrible too

surreal bridge
#

hehe no more science if kerbal is hungy

radiant jay
#

So Tim is No Crew

surreal bridge
radiant jay
#

he can still move

#

?

surreal bridge
#

otherwise he could never be saved

radiant jay
#

well another vessel could dock to his

#

not this one but still...

surreal bridge
#

If he's in a vessel he can't control it

#

He can only move in EVA

radiant jay
#

another vessel can dock to his without the control of the vessel to be rescued

surreal bridge
#

He cannot control the vessel he's in

#

But he can move in EVA

sudden oriole
#

So

#

If you start losing food

#

Just eject kerbals?

radiant jay
#

sounds like that

surreal bridge
sudden oriole
radiant jay
#

and on planets ?

surreal bridge
radiant jay
#

well you wont drift

surreal bridge
radiant jay
#

if there's no food just kick everyone out

surreal bridge
surreal bridge
#

@olive sinew sorry to bother you again, should be the last time for this update, but I've got one final localization item:

Key,Type,Desc,English,Chinese (Simplified),French
KLSS/Notifications/ResourceExhaustedStrike,Text,,"A Kerbal on board ""{0}"" went on strike from lack of ""{1}""",,"Un Kerbal à bord de ""{0}"" est en grève à cause d'un manque de ""{1}"""

You can send the Chinese version here directly when you have the time 🙇‍♂️

olive sinew
radiant jay
#

Kerbal's are translated into 乘员?

surreal bridge
#

Now onto writing up the release notes

sudden oriole
#

Ah shit

#

Im going to have to update the deps on ckan

surreal bridge
sudden oriole
#

Have to eat breakfast first

#

But ill be fine

radiant jay
#

only shows food amount

silver jungle
#

well, because it only can be one variant at a time

#

and food is the default one

#

to see the other capacities, just put the part somewhere in your workspace and switch the variant to see the values in the part manager

radiant jay
#

but this it tech tree view

#

i dont have that part yet

silver jungle
#

oh

#

well, either way, it's a question for #1208120894254358608 rather than this mod

#

the mod can't control the information shown in the statistics for variants

radiant jay
#

oh right

#

srry

silver jungle
#

well, I think the idea is to provide some sort of a way to see in the R&D (and VAB part picker, since it's the same popup, really) what stats the other variants have

sudden oriole
#

That should be possible i suppose