#Space Warp

1 messages · Page 5 of 1

timber cedar
#

o

#

nononono

#

noon

#

ononnonononononononono

#

i think remove munix mod

wicked wyvern
#

I need to think like the average user

#

aka IQ in negative values

#

in order to do testing

timber cedar
#

ofc ofc

#

i guess it is equal

#

i hate this

wicked wyvern
#

I don't blame you

late condor
#

to out smart the smartest prey, yuo must think like them

#

behave like them

#

eat like them

#

put your coffee cup into your computers coffee tray

timber cedar
#

...

timber cedar
#

your computer has a coffee tray

#

i think cpu cooler

late condor
#

oh shit, you guys might be to young to even know lol

timber cedar
#

:D probably

timber cedar
#

xd

#

yeah ik that

#

i didnt really use it as a coffee tray

wicked wyvern
#

I remember installing games from 4 CDs

#

though I barely ever used floppy disks

timber cedar
#

i dont know where it is rn

#

but i have this

#

big stack of cds

#

like 500

#

one of these

late condor
#

I got rid of mine years ago

wicked wyvern
late condor
#

I have a single external cd rom stuffed in a drawer somewhere for when I need to install an OS from a cd

wicked wyvern
#

with all the coolest programs and games for Windows 98

late condor
#

Oh you have the Quake Shareware CD? 😉

timber cedar
#

i mean i have windows 10h on cd

wicked wyvern
#

I guess not all the coolest then

timber cedar
#

:D

wicked wyvern
#

I don't think that would fit on a CD, right?

timber cedar
#

dvd

wicked wyvern
#

right

timber cedar
#

yeah

late condor
#

Cd, dvd, bd, whatever

#

Disc media

timber cedar
#

average betamax user ^

#

copium

late condor
#

Its going out

wicked wyvern
#

Blu-ray was such a fad

#

I don't think I ever used one

late condor
#

No, if I was a Betamax user I'd have mentioned hddvd

timber cedar
#

xdd

#

yeah

timber cedar
wicked wyvern
#

like why burn stuff on a disk

timber cedar
#

we had a blu-ray compatible reader

wicked wyvern
#

when you can buy a 1 TB USB

late condor
timber cedar
timber cedar
late condor
#

Appropriate course or action in these trying times

timber cedar
#

^

storm quail
#

Sent a pull request

#

Wait its Rexicons github lol

#

Unless rexicon is you Cheese 🤔

timber cedar
#

:D

#

im rexicon

#
Follow all the same steps in the :ref:`Addressables Loading` documentation for making assets addressable, but make sure that the sprites runtime name is :code:`<partName>_icon.png` and the prefabs runtime name is :code:`<partName>_icon.png`
#

this is what you changed?

#

merged

wicked wyvern
#

the prefab's runtime name is ___.png?

storm quail
wicked wyvern
timber cedar
#

🤷 idk what any of these docs do

wicked wyvern
timber cedar
#

@wicked wyvern can you verify some readme stuff for me

sacred jasper
#

partname.prefab I think

timber cedar
#

anytime spacewarp has a patch

#

jkjk

wicked wyvern
#

me and the boys on our way to update our mods for the newest SpaceWarp version

timber cedar
#

fr

wicked wyvern
timber cedar
wicked wyvern
#

(dw we love you cheese vaultpeter )

timber cedar
#

^

#

almost 2k members i should apply for mod klueless

wicked wyvern
#

it's been slowing down but yeah, should be there in a couple of days or so

little bay
#

you can write a patcher and just hook the loading stuff yourself

timber cedar
#

average aaron response
do it your self nooooooooo

little bay
#

<3

wicked wyvern
#

smh why didn't I think of it before

#

I already wrote a patcher to load UITK assemblies

little bay
#

but yeah they load before the chainloader starts

#

so you can effectively mod bepinex itself during that time

timber cedar
wicked wyvern
#

nice, that's pretty much what I needed

#

I assume I can use Harmony within the patcher still?

little bay
#

yeah

wicked wyvern
#

oh yeah it's literally in the 2nd paragraph lol

little bay
#

you just can't reference any game or Unity DLLs

wicked wyvern
#

I should read first and then ask questions

timber cedar
#

is there a harmony for unreal games

timber cedar
little bay
timber cedar
#

:C
how to mod unreal game

little bay
#

you can still use hooks

#

just not in the same way

#

because there's no IL to abuse

timber cedar
#

madge

#

i need to mod a unreal game

little bay
#

but yeah just do

public static class Patcher
{
    // List of assemblies to patch
    public static IEnumerable<string> TargetDLLs 
    {
        get
        {
            Harmony.CreateAndPatchAll(typeof(Patcher).Assembly, "SpaceWarpPatcher");
            return Array.Empty<string>();
        }
    }

    public static void Patch(AssemblyDefinition assembly)
    {
        // empty method, bepinex just needs to see it
    }
}
#

ez

timber cedar
#

so you can still use harmony

little bay
#

not on the game itself

#

everything else is fair game

timber cedar
#

...

#

what else is there that isnt the game

little bay
#

BepInEx

#

the Mono runtime system libraries

#

thats about it

timber cedar
#

this wouldnt let me insert an imgui element onto the screen

#

would it?

little bay
#

why would you want to do that so early anyway

#

the game window isn't even open at the point this happens

timber cedar
#

ikik, but is there any point later that i could

little bay
#

...

wicked wyvern
#

just about any time

little bay
#

OnGUI?

timber cedar
sacred jasper
#

I'll work on this kinda stuff tomorrow when Im free

sacred jasper
#

I have arisen

timber cedar
#

:D

#

going to be very productive now

gilded kettle
#

so spacewarps wiki says that all parts should be under the default assets, but can they not be?

#

i think that it would be better if each part had it own .addressable file

#

that way i could just export the part that i want instead of exporting all of them everytime

sacred jasper
#

Fixed version checking

wicked wyvern
#

awesome

#

will you do the mod toggling on/off or should I get started on it?

sacred jasper
#

you can get started on it

timber cedar
#

as we still have almost the same file system

#

"click button" generate .ignore
"unclick" delete .ignore

#

obv in the spacewarpmanager just ignore mods that have a .ignore

wicked wyvern
timber cedar
#

never even seen it

#

what is it

wicked wyvern
#

basically functional/query-style abstractions for for/foreach cycles

timber cedar
#

huh

wicked wyvern
#

here's an example from the benchmark

timber cedar
#

looks function oriented :D

#

but i see what you mean

#

.map is best waifu

wicked wyvern
#

similar to something like calling myArray.forEach(item => ...) in Javascript

timber cedar
#

^

old vault
timber cedar
#

:D this wont affect millisecond performance

wicked wyvern
#

the specific method in question is not something that should be called in a loop anyway

timber cedar
#

itll be eaten by the variation in frame time

old vault
#

And yes, it definitely matters.

wicked wyvern
#

yeah but it's just bad practice to fetch parts like this every Update cycle

old vault
timber cedar
#

munix where are you trying to use this?

#

what part of the code

wicked wyvern
#

me nowhere

timber cedar
#

oh

wicked wyvern
#

i'm just commenting about a GitHub issue

timber cedar
#

ah

#

kk

wicked wyvern
#

but I see your point

#

I just think that realistically this specific method implementation won't have much performance impact, since using it outside of the game loop will only result in negligible one-time performance loss and using it in a game loop will be bad with or without Linq

old vault
#

From my experience in KSP 1, there are many cases where you need to iterate over all parts or all modules. And caching isn't always a viable option.

late condor
#

Unity doesn't handle garbage collection the best, and linq produces garbage

wicked wyvern
#

fair, I don't have any real experience with that

late condor
#

Its not a big deal if you're using linq occasionally on stuff like user initiated actions, but it becomes a big provlem if used in any kind of loops or automated systems

#

The problem here is that this is an api, and its not predictable when the code will be called

#

If someone decides to use it in a loop, it will take a massive shit on the GC and cause problems that were entirely avoidable by writing more verbose code

wicked wyvern
#

Sure, I see your point, wasn't aware of the GC issues

#

Shouldn't be an issue making a quick PR to fix it then

late condor
#

I see that got said all that already lol

old vault
#

It's not just a GC issue. Allocations are slow in themselves. Your method is not just 2x or 3x slower than a discrete for loop, it's an order of magnitude slower.

#

And while the overhead is indeed small, these things pile up very quickly.

late condor
#

I tend to group allocs with gc tbh

wicked wyvern
#

(to be fair it's not mine, i was just interested in why you thought it was so bad)

sacred jasper
#

it shouldnt be called often, why would someone loop it for one...

late condor
#

Its a smell more than outright bad, in an api it can lead to systemic issues if a lot of people use it

wicked wyvern
#

But I also see the other side of the argument

wicked wyvern
#

You can't make people not call it in a loop

late condor
#

What matters is, someone will, even though they maybe shouldn't, and if that happens to turn out to be something popular, then it will look like its spacewarps fault

#

Perception control is valuable

sacred jasper
#

i considered linqs performance and thought itd be a non issue in the intended use case

wicked wyvern
#

I would do the same honestly

#

But I guess it makes sense to think about these things more in terms of what (possibly nonsensical) uses it might have for other people

sacred jasper
#

the intended use case for this is at load time
as for ienumerable i had no clue

old vault
sacred jasper
#

@gilded kettle can explain better

wicked wyvern
#

basically afaik the use case this was specifically made for was to edit part definitions and their modules during game loading

late condor
#

If you want to design it specifically for that, put in control code to enforce it

#

But tbh, that will be more work than just reformatting the code to not use linq

timber cedar
#

if you guys are still talking about the linq performance, its basically non-existent until you start reaching the hundreds of thousands of elements

#

you shouldnt worry about those kind of functions

wicked wyvern
#

the API does not provide access to a vessel's parts to be clear

#

the specific instances of them

timber cedar
late condor
#

Its definitely much more impactful than that in my experience, and I'm a big fan of using LINQ

wicked wyvern
#

only the general definitions of parts

timber cedar
#

what are the benifitis of linq other than saving 4 lines of code

late condor
#

I use linq anywhere i can, but I've had plenty of code that was slow, in unity, specifically because of linq that wasn't some gigantic liqn operation happening thousands of times

late condor
timber cedar
#

its more expressive than a literal for loop??

wicked wyvern
#

I can't honestly imagine any use case where you would need to fetch part definitions other than at game load time

late condor
#

Tbh, I dont even know how to argue that

timber cedar
#

:D i understand ^

wicked wyvern
#

I'd get it if we were talking about parts that can change on the fly, aka actual instances of parts on a vessel in either the VAB or in flight

late condor
#

I'm just speaking from general unity experience to be absolutely clear

#

I definitely don't know the context well

wicked wyvern
#

I just think that that may be where @old vault and I misunderstood each other

late condor
#

If this code can absolutely not be used in a situation where it could be called hundreds of times in a loop, then its not an issue

wicked wyvern
#

they just get loaded when the game starts

#

and that's it

#

afaik

timber cedar
late condor
#

I absolutely love linq, best thing ever, just needs to be considered carefully in unity

old vault
gilded kettle
old vault
#

But I also stand by my stance that LINQ should be nowhere near game-loop code.
Even in initialization methods or one-shoot events, this can pile up and contribute to slower load time, stutter on those events, etc.
And yes, LINQ is slow, garbagey and should be avoided in those contexts.
If it wasn't, there wouldn't be massive efforts from the .NET team to try to replace and speedup its internals.
And there wouldn't be many popular projects that try to reimplement it with structs and using various other techniques to improve its performance.
Also, something to keep in mind is that Unity isn't running on modern .NET / CoreCLR but on the Mono runtime, where many such high level API suffer from even more performance issues.

wicked wyvern
#

Yeah to be fair I absolutely forgot to take Mono into account

gilded kettle
#

im so confused 😭

old vault
#

To quote the official "Fixing Performance Problems" unity guide :

LINQ and Regular Expressions
Both LINQ and Regular Expressions generate garbage due to boxing that occurs behind the scenes. It is best practice to avoid using these altogether where performance is a concern.

wicked wyvern
#

😆

gilded kettle
#

good lmao, i was distracted with TUX

wicked wyvern
#

and I'm thinking this should actually be done differently

#

like a single .ignore file with the names of all the dlls not to load

#

or something similar

#

since BepInEx plugins (even without a swinfo.json file) are also displayed in the Mod List UI

#

and they don't have to have separate folders technically

#

but it still makes sense to allow unloading them, because why not

#

we'll be patching BepInEx classes anyway to do it

#

so might as well allow it for any plugin

timber cedar
#

that could work yeah

#

whatever easiest

#

this isn’t supposed to be something performanced

old vault
#

For reference on the LINQ discussion, here are some quick and dirty BenchmarkDotNet results for various implementations of the method :

| Method           | Runtime  | PartCount | Mean      | Ratio | Gen0   |
|------------------|----------|-----------|-----------|-------|--------|
| For              | .NET 6.0 | 10        | 1.375 ns  | 1.00  | -      |
| ForEach          | .NET 6.0 | 10        | 1.617 ns  | 1.18  | -      |
| StructEnumerable | .NET 6.0 | 10        | 2.256 ns  | 1.64  | -      |
| LINQ             | .NET 6.0 | 10        | 26.503 ns | 19.27 | 0.0014 |
|                  |          |           |           |       |        |
| For              | Mono     | 10        | 1.630 ns  | 1.00  | -      |
| ForEach          | Mono     | 10        | 14.007 ns | 8.59  | -      |
| StructEnumerable | Mono     | 10        | 13.271 ns | 8.14  | -      |
| LINQ             | Mono     | 10        | 61.134 ns | 37.48 | 0.0174 |
|                  |          |           |           |       |        |
| For              | .NET 6.0 | 500       | 1.390 ns  | 1.00  | -      |
| ForEach          | .NET 6.0 | 500       | 1.619 ns  | 1.17  | -      |
| StructEnumerable | .NET 6.0 | 500       | 2.246 ns  | 1.62  | -      |
| LINQ             | .NET 6.0 | 500       | 26.955 ns | 19.40 | 0.0014 |
|                  |          |           |           |       |        |
| For              | Mono     | 500       | 1.716 ns  | 1.00  | -      |
| ForEach          | Mono     | 500       | 14.066 ns | 8.18  | -      |
| StructEnumerable | Mono     | 500       | 12.251 ns | 7.14  | -      |
| LINQ             | Mono     | 500       | 62.616 ns | 36.46 | 0.0174 |

There are 4 implementations :

  • For is a direct iteration using nested for loops
  • ForEach is a direct iteration using nested foreach loops
  • StructEnumerable is a foreach loop over a custom struct IEnumerable
  • LINQ is the original (actually made a bit better by using .Any() instead of .Count() > 0)
#

The StructEnumerable is functionally equivalent as the LINQ one (can be implemented as a helper extension method)

#

And the Gen0 column is representative of how much time is spent due to GC memory allocations.

wicked wyvern
#

what we've learned from this is that Mono sucks munley

old vault
#

Yep, it does. Unfortunately, we are stuck with it 😛

sacred jasper
#

mono is that bad

#

?

old vault
#

Mono is missing more or less entirely the last 5-6 years of improvements that went into .NET
And even ignoring that, it has always been quite behind even in the late .NET Framework days...

sacred jasper
#

@wicked wyvern any updates on mod toggling?

wicked wyvern
#

yeah, have most of the work done I think, but I'll have to finish it tomorrow since it's really late

sacred jasper
#

so that might add a bit of work

#

not necessary for first implementation but a qol thing

wicked wyvern
#

would be nice to have for 1.1, for sure

gilded kettle
#

probably X606 should add on the forum's spacewarp post the "how to update to 1.0.0"

gilded kettle
#

yeah but its not on the forum post i think

timber cedar
#

theres a forum?

wicked wyvern
#

KSP forums

gilded kettle
#

https://forum.kerbalspaceprogram.com/index.php?/topic/213036-space-warp/
It does say the wiki is your friend but people tend to just skip whats not in bold letters

little bay
#

for most garbage collectors its barely more than a pointer bump, unless it has to go and get more memory from the system

timber cedar
#

need text wrapping in modmanager

wicked wyvern
#

or just trunc it tbh

#

with an ellipsis at the end

timber cedar
#

sry

#

i menat trunc

#

my mistake

#

... at end

gilded kettle
#

does 1.1.0 have a ETA? i have some improvments to the Colors and if its close i'll make them tomorrow

timber cedar
#

sometime this year i think

#

idk like 3 days / a week??

#

no there is no eta

timber cedar
#

@sacred jasper can i do a full code reformat and cleanup on the 1.1.0 branch

#

all the dumb unused vars and incorrect whitespaces

#

unsed imports

sacred jasper
#

Sure

#

Just pr it

timber cedar
#

kk

#
public static void Initialize(SpaceWarpPlugin spaceWarpPlugin)
    {
        Logger = spaceWarpPlugin.Logger;

        Path.GetDirectoryName(spaceWarpPlugin.Info.Location);

        AppbarBackend.AppBarInFlightSubscriber.AddListener(Appbar.LoadAllButtons);
        AppbarBackend.AppBarOABSubscriber.AddListener(Appbar.LoadOABButtons);
    }
#

what

#

Path.GetDirectoryName(spaceWarpPlugin.Info.Location);

#

what

#

???????

timber cedar
#

@wicked wyvern

timber cedar
#

whoops

#

rider decided to just push instead of pr

#

thx rider

#

i guess this doesnt do anything

#

ok i reverted

timber cedar
#

@sacred jasper there is pr now

#

still compiles 👀

little bay
#

@timber cedarbad PR

#

very bad

#

you renamed the harmony patch parameters

timber cedar
#

xd srry

#

that part was automated not me

little bay
#

could've at least tried to launch the game :p

timber cedar
#

i did

#

it launched

#

100% works

#

:p

little bay
#

no this absolutely should have yelled at you for this

#

harmony does not support what you changed

timber cedar
#

xd vc

#

watch

#

i swear it works

#

i think

#

i dont swear

#

put im 99% sure

little bay
#

if you are building and running what is in this PR

#

that is impossible

timber cedar
#

xd just look

little bay
#

this show throw an exception immediately once SpaceWarp loads

#

the game will probably load fine

#

but there will be an error in the log

timber cedar
#

all the menus work

little bay
#

and no mods will work

timber cedar
#

and i can use mods

#

xd

#

bro

#

get in here

#

u see?

little bay
#

yes

timber cedar
little bay
#

ConfigurationPatch or ColorsPatch

timber cedar
#

this?

little bay
#

yes

timber cedar
#

ok

#

u see it

little bay
#

yes

timber cedar
#

currently only one mod

#

i can add more later xd

#

maybe its a bad example mod

#

errors are about gui and lang missing

#

not me

little bay
#

send the bepinex log

timber cedar
little bay
timber cedar
#

idm fixing it ^

#

okok

#

so its not game breaking

#

thats why i didnt notice

#

i gotchu

little bay
#

harmony should kill you for that, i dont know why it isn't

timber cedar
#

void KSP.Modules.Module_Color::OnInitialize() with 0 prefixes, 1 postfixes, 0 transpilers, 0 finalizers

#

this

#

it fixed auto

#

but yeah never good to have that

little bay
#

fixed auto?

timber cedar
#

idk im making shit up

#

i assume thats what postfix is

#

oh

#

maybe its the name of the function

#

nvm

#

i see now

#

idk i dont harmony much

#

good i think?

little bay
#

same exception is still there

timber cedar
#

oh

#

xd

little bay
#

ColorsPatch

timber cedar
#

i might know what it is

little bay
#

needs to be __instance

timber cedar
#

like that?

little bay
#

yeah

#

should be fine now

timber cedar
#

its gone

#

is this supposed to be here?

little bay
#

is what supposed to be there

timber cedar
#
[Error  :  HarmonyX] Failed to patch virtual Type[] System.Reflection.Assembly::GetTypes(): System.Exception: Parameter "typeException" not found in method virtual Type[] System.Reflection.Assembly::GetTypes()
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x007ae] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.<WriteFinalizers>g__WriteFinalizerCalls|39_1 (System.Boolean suppressExceptions, HarmonyLib.Public.Patching.HarmonyManipulator+<>c__DisplayClass39_0& ) [0x0003c] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteFinalizers (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x001c1] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x0023c] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
little bay
#

oh

#

oh

#

also FixGetTypes

#

forgot about that one

timber cedar
#

ah kk

#

same file?

#

or

little bay
#

the file is called FixGetTypes

timber cedar
#

a

little bay
#

but yeah normally harmony yells at you like this when that happens

timber cedar
#

^

little bay
#

and it should stop the mod from loading entirely

#

i'm not sure why it didnt here

timber cedar
#

my refactoring was just too good

#

i see the issue now tho

little bay
#

oh

timber cedar
#

didnt know that was needed

#

?

little bay
#

make the consts in SpaceWarpPlugin public again

#

yeah those two

#

they're meant for people to use

timber cedar
#

yeah i got that :D

little bay
#

no idea why rider thinks you can do that

#

they're public API

timber cedar
#

because noone ever uses them outside of the file

#

namespace ^

little bay
#

rider doesn't know that

#

this is a library

timber cedar
#

🤷

little bay
#

thanks for not making that obvious in the suggestion itself rider

timber cedar
#

yeah

#

i dont really like to auto apply

#

but there were like 500 "add _ to var name" warnings

#

easier to just fix after

little bay
#

lmao

timber cedar
#
[Error  :Space Warp] System.NullReferenceException: Object reference not set to an instance of an object
  at SpaceWarp.AssetHelpers.LoadLocalizationFromFolder (System.String folder) [0x00001] in C:\Users\david\Documents\KSPMods\SpaceWarp\SpaceWarp\AssetHelpers.cs:31 
  at SpaceWarp.Patching.LoadingActions.LoadLocalizationAction.DoAction (System.Action resolve, System.Action`1[T] reject) [0x00018] in C:\Users\david\Documents\KSPMods\SpaceWarp\SpaceWarp\Patching\LoadingActions\LoadLocalizationAction.cs:23 
#
[Error  :  HarmonyX] Failed to patch void KSP.Game.StartupFlow.LandingHUD::Start(): System.Exception: Parameter "instance" not found in method void KSP.Game.StartupFlow.LandingHUD::Start()
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x007ae] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePostfixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x001a5] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00234] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
#

these are the two left

#

i can read them now :D

#

or not

#

is that last one from us?

#

oh

#

no i see now

#

and the top one is from translations

#

okok

#

looks good?

little bay
#

except for that last one, yeah

#

honestly

#

just right click on one of the [HarmonyPatch] attributes

#

hit find usages

#

and just go through them that way

#

to make sure we get them all

#

higher up in the right click menu

#

if its got no parameters its probably fine

timber cedar
#

should rename to colourspatchs

#

yeah i just want to check

little bay
#

what do you think i am

#

european?

#

can't believe this

timber cedar
#

:D

#

i give up xd

#

it should be fine

little bay
#

i have no idea if that spelling fix is because the devs misspelled it or because we misspelled it

#

the "metallic" one

timber cedar
#

yeah

#

💀

#

ahhahahh

little bay
#

just get rid of those parameters actually

#

they aren't even used

#

lmao

timber cedar
#

i wanted to do that

#

but maybe they will get called later

#

and someone will have an error

little bay
#

then they can get added back later

timber cedar
#

:D ^

#

ill remember that to reply to it later

little bay
#

its not like they're public API

#

they're harmony patches

timber cedar
#

true

#

but some tired sw dev will have a headache

little bay
#

they should read the harmony docs

#

:P

timber cedar
#

:p

#

the REDACTED mod is actually great

#

whats a mod that has appbar use?

little bay
#

what do you mean

timber cedar
#

nvm

#

found one

#

oh wait

#

watch

#

bruh its recompiling

#

holdon a minute

#

:D

little bay
#

is your computer okay

timber cedar
#

no

#

its dying

#

i have two ides

little bay
#

why is it only compiling one crate at a time

timber cedar
#

?

#

its always like that

#

wdym

#

???

#

you can compile more than one at a time

little bay
timber cedar
#

oh

little bay
#

my PC complies like

timber cedar
#

yeah

#

mines doing that

little bay
#

12 crates at once

timber cedar
#

look

#

its just truncated

little bay
#

oh

#

weird

timber cedar
#

idk why

#

🤷

#

i could report another rust issue

#

later tho

#

21gb target folder

#

💀

#

i have a compiled version

#

u watch?

little bay
#

yeah

timber cedar
#

xd or not

#

i guess it doesnt work that way

#

cant open dev compiled targets

#

:C

#

some clown "redstone" keeps like removing my cargo.lock file

#

which causes it to recompile everything

little bay
timber cedar
#

xd

#

what year is that from

little bay
#

no idea

#

its whatever is on your master branch

timber cedar
#

i think thats like 0.0.1

little bay
#

i just cloned it to see how long it would take to build

timber cedar
#

current repo ^

#

its in no way stable xdd

#

not going to be for a while

#

itll probably open a window?

#

aaron look

little bay
#

looks nice

timber cedar
#

watch

#

:D

#

cul

little bay
#

its going to be pretty hard to succeed ckan though

timber cedar
#

we arent trying to xdd

little bay
#

your words, not mine

timber cedar
#

not mine either

#

redstones

#

i dont think its a successor in any way

#

just a cool project to work on

#

either way

#

appbar also still works

#

u see any other issues with the code?

little bay
#

seems fine

#

but i'm also very tired

#

its 4am

timber cedar
#

xd

#

i should use github copilot to comment every line

little bay
#

...i'm going to bed

timber cedar
#

xd ok

#

can we push?

#

merge ^

little bay
#

should be fine

#

i think

#

probably

timber cedar
#

eh its a dev branch

#

can always rollback

#

cheese is gonna pull tomorrow and see like 36 files changed

#

quick question are the parts info stored in a .json file?

#

i think they are in the appdata

timber cedar
#

^

wicked wyvern
timber cedar
#

but where

#

idk i dont play ksp2

wicked wyvern
#

KSP2_x64_Data/StreamingAssets/aa/StandaloneWindows64

timber cedar
#

ok thx

gilded kettle
#

i hate that cuz every change to the parts' config has to go through a loading screen now :(

timber cedar
#

yeah

wicked wyvern
#

oh lord

#

I just pulled all your changes into the branch I was working on

#

💀

gilded kettle
#

also, could we ditch the current path system in the future? Its impossible to get different image extensions them reliably

timber cedar
#

gl merging

#

god be with you

#

sowy :D

gilded kettle
#

maybe store something like TryGetAsset<Texture>(path), allowing for paths with the same name

wicked wyvern
#

huh why was this split

timber cedar
#

idk

#

u fixer that

wicked wyvern
#

refactoring of the refactoring

timber cedar
#

the name of the pr is "3rd pass"

#

this is like 4th time now

#

tomorrow im gonna need to do another like 2 refactors

#

the code is just so badly formatted xdd

timber cedar
#

i think we need linux like system

#

patches

#

patch manager

#

no prs

#

prs bad

wicked wyvern
#

Re: formatting - I think for a community project of this scale, it would not be a bad idea to set some coding standards

#

That people have to adhere to if they want to merge their PR

wicked wyvern
#

@sacred jasper I have to say I severely underestimated the difficulty of preload patching BepInEx

#

I thought for some reason that a simple Harmony patch would do it but it seems like it has to be done with Mono.Cecil

#

and the "docs" for that are the least helpful thing ever

late condor
#

Why are you trying to preload patch bepinex?

wicked wyvern
#

the goal is to allow to toggle whether to load a plugin (after restart) or not

sacred jasper
#

Renaming wont work cuz haha file in use :3

wicked wyvern
#

yeah lol

#

I immediately realized and deleted it

late condor
#

Hmm

wicked wyvern
#

the other option is just to Destroy the plugin after it was already loaded and leave the responsibility of cleaning up after themselves in OnDestroy to the mod devs

late condor
#

I feel there is more options here

wicked wyvern
#

totally possible

#

these were just the two we discussed prior

timber cedar
#

wait but what’s the issue

#

just check if it’s in the .ignore file?

wicked wyvern
#

The issue is that the loading of the DLLs no longer happens in SpaceWarp

#

BepInEx does it and it doesn't have any capabilities to not load certain DLLs

#

We'd have to patch it

#

Which you can't do using a Harmony patch since those get run after BepInEx already starts loading DLLs

timber cedar
#

ahhh

#

ok i see now

wicked wyvern
#

So the option i was thinking of was a preload patcher for the BepInEx binary

#

But it's much more complicated than I anticipated

#

The only patcher I've written so far just took some DLLs and replaced them with a different version

#

That was basically two lines of code

#

This would require to patch some methods and create new ones from within the AssemblyDefinition

timber cedar
#

any way to give space warp priority when bepinex loads?

wicked wyvern
#

Haven't really thought about that

#

Does Awake run as soon as BepInEx loads the DLL in?

timber cedar
#

no clue :P

late condor
#

You might try asking on the bepinex discord

#

Or prod Aaron incessantly

wicked wyvern
#

Seems like I'm seriously behind the times, everything has a Discord server these days munley

late condor
#

Everything has a discord, thats a fact lol

wicked wyvern
#

This was the first one I joined other than my WoW guild kekw

#

I thought it was a platform for gaming VC mostly

late condor
#

I have my thunserkit discord, a friend group discord, a family discord, and a personal discord....

#

Which I use to store notes about things and links and stuff

late condor
#

Cant be older than me can ya (i mean in the ksp world, you definitely can)

#

I'm definitely rocking the buschemi

wicked wyvern
#

Hehe

#

I guess I'm just out of the loop more than anything

timber cedar
#

💀

late condor
#

Lol, you're just a kid

wicked wyvern
#

Am i an embarrassment for my generation?

late condor
#

Ive got nephews older than you

timber cedar
#

what generation even is that :D
i think to late for last gen

late condor
#

Thats gen z

timber cedar
#

and too early for this gen

wicked wyvern
#

Millennial through and through

timber cedar
#

hm yeah i think its called gen z

#

idk

#

whats after gen z

wicked wyvern
#

"Researchers and popular media use the early 1980s as starting birth years and the mid-1990s to early 2000s as ending birth years" from the wiki on Millennials

late condor
#

Yeah you're definitely a gen z, at 25

timber cedar
#

im almost gen alpha 👀

#

ew

#

im ashamed

late condor
#

Omg I'm an old fart, when did this happen

wicked wyvern
late condor
#

Pew research ends millennial at 96

wicked wyvern
#

And at the very least i don't feel like a part of that crowd at all kekw

late condor
#

But the reality is that generations are very loosely defined

wicked wyvern
#

Yeah

#

It's not really a meaningful label in any way

late condor
#

But my nieces are all gen z, and they are 20 to 24

timber cedar
#

so you must have the most experience with coding klueless

late condor
#

Maybe in terms of years, but Aaron really knows his stuff

#

My knowledge is, more abstract :p

timber cedar
#

aaron just reads the docs 💀

wicked wyvern
late condor
#

Yeah. But he remembers them :p

wicked wyvern
late condor
#

I always read the docs every time I'm coding because I cant remember that stuff

timber cedar
#

never read the docs unless im at least 10 hours in

wicked wyvern
#

Maybe that's why your refactor gives me like 10 exceptions that weren't there before

late condor
#

The first thing I do when I'm using something else is find the docs for whatever I'm working on, so I have it on hand

timber cedar
#

i think u problem becuse code runs perfectly

#

very clean

wicked wyvern
#

Time to see if my broken ass laptop manages to work long enough to get something done on this 3 hours long train ride

#

The integrated GPU is dying and I need it for work kekw

timber cedar
#

:D

#

should have dual gpu like me

wicked wyvern
#

I do

timber cedar
#

so you have either 0 battery

#

or

#

0 performance

wicked wyvern
#

But the internal GPU powers the laptop screen

#

While the external has the HDMI port

timber cedar
#

ik

wicked wyvern
#

So when the integrated GPU bugs out, I can only use an external monitor

#

Which i don't have on a train

timber cedar
#

^

#

where settings

#

do this

wicked wyvern
#

Not for my laptop

timber cedar
#

o

wicked wyvern
#

I don't have Optimus

timber cedar
#

i meant to select the gpu

#

and just connect to power supply

wicked wyvern
#

Optimus is what allows you to switch the GPU afaik

timber cedar
#

and not the "NVIDIA GPU" option ^?

wicked wyvern
#

Yeah got that too

#

But not the option you showed above

timber cedar
#

?
how

wicked wyvern
#

Well then what page exactly in the settings is it supposed to be on?

#

I can look

timber cedar
wicked wyvern
#

Nope, don't have that tab at all

timber cedar
#

xd

wicked wyvern
#

It's just not a thing on most laptops

timber cedar
#

idk then

wicked wyvern
#

The display is just driven directly by the integrated GPU

#

And it then sends over requests to the external one for more complex rendering

#

Is how i understand it works

#

But there's no way to just directly connect the screen to the external one

timber cedar
#

get second laptop
use as external display

wicked wyvern
#

5head move

#

Do you by any chance have a 1660 Ti or 1650?

timber cedar
#

3050

#

:P

wicked wyvern
#

That's weird then, i don't even see support for that in the list

timber cedar
#

i have unstable laptop

wicked wyvern
#

I have a 3060

timber cedar
#

^

wicked wyvern
#

Wtf is that an ultrabook with a gaming GPU?

timber cedar
#

yes.

#

it works

#

really goddam well

wicked wyvern
#

😳

#

Mine is just a classic fatass gaming laptop

timber cedar
#

:D

#

it doesnt say price

wicked wyvern
#

It's like 4 kg

timber cedar
#

but it was 1k

#

for 32gb
1tb

wicked wyvern
#

Of what

timber cedar
#

$

wicked wyvern
#

Mine was like 1600

timber cedar
#

:P

#

its quite unstable though

#

not stable centos 7 machine

#

this is like 12 hours of battery life

wicked wyvern
#

It even has a better CPU and all that

#

how

timber cedar
#

probably best steal of my life xdd

#

got it last black friday

#

30% off

wicked wyvern
#

Ok, at least that makes a bit more sense

timber cedar
#

ye

gilded kettle
#

would it be ok for me to add a ReloadAsset on the assetManager? that would allow for hotswapping textures w/o reloading the game

timber cedar
#

i mean sure

#

if it works 👀

gilded kettle
#

it should, i'll just replace the entry of the path with the new texture

#

i mean its suposed to be that easy....

timber cedar
sacred jasper
#

Why has this become a reaction image

timber cedar
#

we've imortalized u

#

its your catch phrase now

sacred jasper
#

Just because I speak in archaisms that yee use not does not make it my catch phrase

timber cedar
#

verily I doth apprehend the import of yond terms, yet I electeth not to employeth them for their antiquity.

#

i think that’s the limit of my shakespeare knowledge

sacred jasper
#

I'm not sure what I should work on in terms of Space Warp

wicked wyvern
#

I'll happily leave it to you to figure out the preload patcher for BepInEx munley

sacred jasper
#

Aight bet

#

When I am feeling better though

wicked wyvern
#

What I have right now is basically the UI back to what it was with the toggles + saving the info to a file

#

Not very useful

#

If we can't get BepInEx to read it

sacred jasper
#

Gotcha

#

Im assuming it uses bie guid

wicked wyvern
#

Well

#

I was also thinking about that

sacred jasper
#

Assemblyname also works too

wicked wyvern
#

Can't use BIE GUID very easily since you'd have to load the assembly for that

#

For mods with swinfo.json we can just parse that

#

But displaying currently disabled BIE only mods would be tough

#

Since there's no metadata outside of the assembly

gilded kettle
#

this will be fixed next update right?

sacred jasper
#

Yrs

gilded kettle
#

idk if its worth it changing then

sacred jasper
#

Oh the text clipping, yeah Ill fix that

#

My brain went to the red

timber cedar
#

uh

#

are u ok

#

that sounds like aneurysm

sacred jasper
#

I meant i immediately focused on the red

timber cedar
#

what even is that?

#

failed mod?

#

or out of date

#

oh its "unsupported"

#

im gonna make the Mods and Unmanaged Mods retractable

#

for large lists

#

python builder.py doesnt export to the non compress file anymore

timber cedar
#

done

sacred jasper
#

It has to?

#

It compresses that folder

#

And keeps it

timber cedar
#

yeah

#

u see

#

no update

#

doesnt do it

#

nv

wicked wyvern
#

did you check the actual files inside?

timber cedar
#

mv

#

nvnvmvv

#

nvmnnmvnm

#

vn

#

nvnv

#

mvmnvmvnmv

#

mn

#

mn

#

mnmvmnvmn

sacred jasper
#

Windows is wierd like that

#

Bruh

wicked wyvern
timber cedar
#

ok

#

ok

#

okkookko

#

smart guy

sacred jasper
timber cedar
#

cheese look at pr?

sacred jasper
#

Cheese sick but I shall look

timber cedar
#

:C

#

very sad that cheese is sick

sacred jasper
#

Why does this change code in the harmony patch?

timber cedar
#

?

#

it was a commit i forgot to add yesterday

sacred jasper
#

Ohh

timber cedar
#

its like 70 lines of code

#

ist good?

sacred jasper
#

Yee

#

Just accept it as i no at computer

timber cedar
#

kk

#

👍

little bay
#

you actually can't use Cecil, even if you wanted to

wicked wyvern
#

could you maybe show me a quick example of a Harmony patch inside a preload patcher?

#

i kinda gathered from this that I can't

little bay
#

you can't patch the game with harmony during a preloader

#

bepinex itself is fair game

wicked wyvern
#

oh wtf I totally missed that, sorry

#

thanks a lot, that makes it 1000x easier

little bay
#

preloaders work by editing the assembly before it's even loaded

#

which is why you can't use harmony, it works on loaded assemblies

sacred jasper
#

But BIE would already be loaded?

little bay
#

bepinex is already loaded, so you couldn't patch it with cecil even if you wanted to

#

but harmony still works fine

wicked wyvern
#

will the preload patcher be called before any assemblies are loaded by BIE?

little bay
#

it's not documented that way because you're meant to patch the game with a preloader, not bepinex

#

but like

wicked wyvern
#

sorry, I have like 0 insight into BepInEx

little bay
#

nothing stops you

sacred jasper
#

Preload kinda has to

little bay
#

it's called immediately when bepinex loads

wicked wyvern
#

yeah it makes sense

#

I'd just rather make sure

little bay
#

this is before even unity loads

sacred jasper
#

The plugins require the assembly csharp to be loader

wicked wyvern
#

alright then, I guess I'll finish it myself cheese

little bay
#

but yeah, don't feel bothered to pester me about stuff lmao

#

that's why I'm here

sacred jasper
#

So this will be the second bepinex thing sw is patching

little bay
#

it's not like I'm making any mods :p

wicked wyvern
#

much appreciated

sacred jasper
#

The first being config manager

wicked wyvern
#

yeah but that's technically a mod

little bay
#

I mean, there are other ways to do this

#

I personally think requiring OnDisable is better

sacred jasper
#

2.0 thing

#

Would break mods

little bay
#

but if you don't want to do that, then you don't have many other options

wicked wyvern
#

yeah I think it would be too unreliable

#

there will 100% be some mods that don't do it

#

and then we'd have the game full of Harmony patches and whatnot from "disabled" mods

little bay
#

personally I think disabling mods is completely a mod manager job if you're going to require a game restart anyway

#

there's not really a difference in UX if both are just a checkbox and both require a restart

#

then, if mod managers eventually do want to support disabling mods in them, you'll have two ways to disable mods

sacred jasper
#

Then the mod manager should just use the same way :3

little bay
#

syncing mod manager state with game state sounds like a nightmare

#

also means you'll never be able to change how it works, since the implementations have to always be in sync

timber cedar
#

is there no built in .ignore for bep

wicked wyvern
#

nope

timber cedar
#

that sounds like a bit of an oversight

wicked wyvern
#

it has no way to disable dlls without renaming them when the game is not on

timber cedar
#

hm

#

i guess this is the easiest solution

wicked wyvern
#

that's why I want to patch that in with Harmony

timber cedar
#

it sounds way to complicated

#

hm

#

yeah

#

just move the mod folder on load

sacred jasper
#

Munix knows what they are doing

wicked wyvern
#

oh btw I don't care about pronouns too much but you can just call me he 😆

timber cedar
#

who even mentioned pronounds

#

xd

#

i feel like this is still a violation

#

you can skip the eula

wicked wyvern
#

I just thought I'd clarify since I know cheese and some others refer to me as they

#

which again I don't mind

sacred jasper
#

I refer to literally anyone as they out of habit unless told not to

wicked wyvern
#

yeah I usually do at least until I'm certain of what to use

#

seems like a common courtesy these days

timber cedar
wicked wyvern
#

although for example in Czech there's literally no other way to refer to someone other than he/she, and I've never even seen any attempts at gender neutral terms

sacred jasper
timber cedar
#

splash screen

#

she released a new version

wicked wyvern
#

that seems fine to me, the mod itself doesn't remove them or make impossible to see the logos

#

it's up to the user to do

#

so to me it reads as fine

#

but i'm not a lawyer

mossy kraken
#

Unsure about this one

timber cedar
#

yeah thats fine now, no issue with that

#

but the eula skip

wicked wyvern
timber cedar
#

on first boot you can skip it with this mod

sacred jasper
#

Ill assume for the benefit of the doubt, that Dakota has talked to her.
If she posts it here, I will confirm that with dakota

timber cedar
#

^ same here

#

just wanted to mention it

#

not a call for action 🤣

wicked wyvern
#

I've launched the game like hundreds of times at least so I forgot lol

timber cedar
#

yeah

gilded kettle
#

could we make so that .cfg files get read too? we store the string[] or smth

#

i'd like to have custom settings for each part for Colors

timber cedar
#

there is a configuration manager for that?

#

for literally that purpose

gilded kettle
#

oh what

#

didnt know

#

can it read custom paths or just under configs?

timber cedar
#

this is how it works

#

best example i could find

#

we need to add to the example mod

#

that is bad exmaple @gilded kettle

#

i didnt realize he hasnt updated the repo in three weeks

#

xd

gilded kettle
#

lmao ok

#

but is there any docs?

timber cedar
#

i guess no

gilded kettle
#

or smiliar that i can look at

#

:S ok

timber cedar
#

im trying to find an example :D

gilded kettle
#

Its ok i tho we can wait for him to updated the repo, i dont need it for now

#

the shader editing isnt even finished yet lmao

timber cedar
#

still need docs about this

#

@sacred jasper the configuration manager is broken in 1.1.0
known?

sacred jasper
#

whuh

timber cedar
#

yep

#

its empty when you open it

#

maybe my refactoring :O

#

lemme check

sacred jasper
#

did you remove the patch......

timber cedar
#

which patch

sacred jasper
#

the config manager one

timber cedar
#

idk probably

#

im sure its something dumb

#

im fixing it now

little bay
#
private static void Thing([HarmonyArgument("__result")] ref ReturnType res)
{

}
#
public int Thing { get; set; }
#
.field private int32 '<Thing>k__BackingField'
sacred jasper
#
unsafe class ExampleClass
{
    public int IntProperty { get; set; }
    public double DoubleProperty { get; set; }
}

unsafe static void Main(string[] args)
{
    ExampleClass example = new ExampleClass { IntProperty = 42, DoubleProperty = 3.14 };

    TypedReference intRef = __makeref(example.IntProperty);
    int* intPtr = (int*)*(IntPtr*)&intRef;
    Console.WriteLine($"IntProperty value: {(*intPtr)}");

    TypedReference doubleRef = __makeref(example.DoubleProperty);
    double* doublePtr = (double*)*(IntPtr*)&doubleRef;
    Console.WriteLine($"DoubleProperty value: {(*doublePtr)}");
}
little bay
#

I'm pretty sure that doesn't work how you might think

#

if it even compiles

timber cedar
#

💀

#

aaron based