#Space Warp

1 messages Ā· Page 2 of 1

hollow cypress
#

must be some witchcraft or something

#

anyways

sacred jasper
#

If you want a bug to be fixed, at least respond civilly to someone who is actually investigating the bug

hollow cypress
#

im civil until ppl start gaslighting me

sacred jasper
#

How are they gaslighting you?

hollow cypress
#

first he pretends the issue doesnt exist, now he claims he spent the last 2 hours investigating a single method call

little bay
#

we were confused about what BepInEx issue you were talking about

wicked wyvern
#

did you even read the reply?

little bay
#

then he said the issue he has been looking at may or may not be related to BepInEx, not that it is a BepInEx issue

#

he does not know

sacred jasper
little bay
#

because he hasn't found the cause

wicked wyvern
#

also I've spent way more than 2 hours at a time on debugging a single method call

#

more than a single work day sometimes

#

does it mean I'm gaslighting my employer?

hollow cypress
#

gaslight away

sacred jasper
#

They actually just left the server over this?

wicked wyvern
#

anyway...

sacred jasper
#

This is the dumbest thing I've seen?

#

A critical misunderstanding of how debugging works

wicked wyvern
#

omg that actually made me lol for real

#

also I don't understand feeling entitled to getting a random person who's not the author/contributor of the library to debug your code ASAP

late condor
#

Well, they didn't ask, I took it upon myself

wicked wyvern
#

but I know I missed the start of the conversation so I don't presume to know the context

wise swift
late condor
wicked wyvern
#

it doesn't seem like there should be "tons" of changes if this is done right though

#

mostly just file structure and initialization base class/attributes

late condor
#

I converted StageInfo over, and bootstrapped a lightweight SW for what it was using, if I could compile it, or anything else for that matter, it should work

sacred jasper
#

Honestly I still don't understand why they left the server

late condor
#

we are all gaslighting them </s>

#

I'm still gonna try to figure this out, this is maddening

wicked wyvern
#

can't worry too much about every random person and their feelings

little bay
late condor
indigo valve
#

yo this furry rp

#

is already wild

little bay
#

i mean

late condor
#

okay well sure, but the end result is, you move stuff out of the Initialized Method into, Awake, or start, wherever is appropriate, and you replace the ModAttribute with a BepInPluginAttribute

#

from a mod dev perspective

#

right?

#

like, call me out if I'm wrong

wicked wyvern
#

is there a need to get rid of the logging interface?

late condor
#

oph, I was wrong, I left out inheriting from BaseUnityPlugin instead of Mod

wicked wyvern
#

could it perhaps be just a pass-through thing to BepInEx/whatever else, in that case?

late condor
#

I mean, you could but you'd just be adding a layer that doesnt' need to be there except for a small amoutn of backwards compat, but thats being discussed on the github issue

wicked wyvern
#

yeah I guess you can't please everyone

#

some people will want it as clean as possible, some as BC as possible

wise swift
#

perfect world, I dont have to change anything.

late condor
#

I mean a harsh reality is, if people are gonna be upset about the BC here, then they are going to have a bad time for the rest of the year

sacred jasper
#

BC?

late condor
#

there is a reason the vets all signed that post

#

Backward Compat

sacred jasper
#

Oh I realized that immediately

wicked wyvern
#

also, we're literally on the first EA release, chances are, some of the API mods use today will be already obsolete in weeks/months

#

so change is inevitable with the state of the game

late condor
#

its literally day 5?

wicked wyvern
#

very much the reason why the collective KSP 1 Modders forum post said what it said: it's too early for them to commit to modding, since everything will break anyway

solar crystal
#

For one the vets didnt all sign that post, a handfull of well respected moders did. there are many veterans here, already using spacewarp to. Also...can someone explain to me why the vets asking the devs to hurry up with official modding support has anything to do with us changing to beepinex. I mean....they still just want official support, neither version matters to them. This whole arguement is silly. Question: What does switching to beepinex offer me as a mod developer?

craggy musk
#

hey not the right channel

#

put that in the funni 6 hour

sacred jasper
wise swift
wicked wyvern
sacred jasper
wise swift
sacred jasper
solar crystal
#

and follow up question, Why would i still use spacewarp as a dependency and deal with all our recompiles and such after. I just want it put into the explain like im 5 words. Because if the answer is just a library for a quick add part method and some (slightly ) easier gui (like one harmony patch easier) gui stuff...Im not sure why id use it, and ive been developing the thing

wicked wyvern
#

at worst, the way it's done now might actually be breaking stuff for some people, as seen from the many posts throughout the server

sacred jasper
#

The exact same reason space warp was being used.

solar crystal
#

so our plan than is to essentially try to be the common api between modders and beepinex for ksp?

sacred jasper
#

Space warps only selling point was its abstractions

wicked wyvern
#

why try to reinvent the wheel (dll loading/patching) when you can focus on the game-specific stuff

#

and use an established library for the loading

candid sorrel
#

would there be a unified intallation/loading method for vanilla bepinex plugins and plugins that use spacewarp?

sacred jasper
wicked wyvern
#

well at least they'd go in the same folder and people wouldn't have to ask which one to use

solar crystal
#

spacewarp would just be another beepinex mod you add that is a dependency of yours.

wise swift
#

so whats the point of spacewarp then?

sacred jasper
#

This has been answered no less than 3 times already

#

To provide KSP 2 specific abstractions for mods to use

median pendant
median pendant
#

if you're complaining about migrating, keep in mind it's like 5 lines of code

wicked wyvern
#

as a community-maintained unofficial KSP 2 API without having to rely on game devs and their release schedule to fix the API

wise swift
little bay
#
wicked wyvern
#

also whenever a KSP API that has a SpaceWarp abstraction changes, you just need to update one library, not XYZ mods

sacred jasper
little bay
#

those are all bepinex mods that provide APIs for other mods to use

sacred jasper
#

And this makes it easier for that to be done

solar crystal
#

I mean...were basically a harmony mod that provides an api for others to use already. That is our strategy ,this is just a backend change. Spacewarp kind of always was a common api, it just needed to load itself first.

little bay
#

yeah

little bay
#

thats the point

sacred jasper
#

It also gives more direction to space warp project so we aren't doing two things at once

wicked wyvern
#

also, as a point for why not have two concurrent mod loaders: just read through the forums and see how many confused users there are who don't know whether to install one or the other, or both, and how, and which mods to put into which folders, and why all that is necessary

#

same even here

#

in the Discord

#

I answer like 10 of these questions daily

#

and we're just at the start

candid sorrel
#

I think this is kind of a no-brainer. In terms of pure mod loading spacewarp offers nothing over an established mod loader. The utility always came from game-specific abstractions / api.

sacred jasper
#

It's why its been brewing in my mind since 0.2.5

median pendant
#

In other words, the sum is better than its parts

little bay
wicked wyvern
#

yeah I honestly don't see any really good reason for keeping it the way it is other than backwards compatibility

little bay
#

to replace the current config stuff

#

just with a skin

wicked wyvern
#

and that doesn't seem like a strong enough argument considering the pros of the other way

sacred jasper
#

It also say gives us easy access to a well built configuration system, and GUI that can easily be skinned with our space warp stuff for one point in its favor

#

Oh, and some bepinex stuff allows for hot code reloading (don't know how easy it is to use though)

sacred jasper
#

@pastel urchin - A person ahead of their time
#ā“mod-support message

pastel urchin
#

whuh

#

is something happening

sacred jasper
pastel urchin
#

ok so basically

#

bepinex but with the spacewarp features

#

amazing

sacred jasper
#

SpaceWarp as a dependency that bepinex mods can use\

pastel urchin
#

ic

little bay
#

@sacred jaspercompletely through bepinex

little bay
#

i have since fixed the UI skin, it seems to be loading a bit too late for some reason? so I'm just grabbing it constantly now kekw

visual marlin
#

@little bay Please fork/pull when you get up so we can review šŸ™‚

#

Great job last night

visual marlin
#

Bless

#

Thank you

sacred jasper
#

@little bay is it ready to be pulled in?

sacred jasper
lime plaza
sacred jasper
#

Other thing we should do is write up a conversion document before we make the first prerelease with this

sacred jasper
#

@lime plaza to bring the question here
Why would introducing a png loading system introduce technical debt

lime plaza
# sacred jasper <@177073258716200961> to bring the question here Why would introducing a png loa...

The proper process is to use an asset bundle, this is a shortcut used to decrease TTM, the definition of tech debt. I understand there are mods for whom that is their only icon, but there will be mods for which that is not the case, and they will still use it.

I'm going to stop pushing against it, but I'd like it marked obsolete, or at the very least, where its mentioned in tutorials, mention you can load from an asset bundle, because the current one just says "use this function" with no explanation.

alpine tendon
#

That is a semantic argument

sacred jasper
sacred jasper
#

I somewhat agree, but the asset loading system was already being designed with more than asset bundles in mind
Its the reason we have
assets/bundles
vs
assets/x.bundle

lime plaza
#

I’m also worried about having a mod who decides loading their icon every frame is a good idea

sacred jasper
#

Why in the name of fuck would any mod do that...

#

Also all assets are preloaded with the asset system

#

So if we add an assets/images folder, it will preload all the assets

lime plaza
lime plaza
alpine tendon
#

You would have to lack the most basic understanding of computer storage and memory to do that

lime plaza
# sacred jasper Explain?

Just feels off to have ā€œhere are the 50 folders you can put stuff into that we will load from automaticallyā€

#

Also, specifically for the icons, you will need a way to find a reference to them

sacred jasper
#

mod_id/images/icon.png or something like that

lime plaza
sacred jasper
# lime plaza I have no idea how that system works

It essentially caches all loaded assets into a dictionary lookup with a path of
mod_id/(bundle_name)/(path in bundle without assets/bundle_name) for bundles
And then
mod_id/images/(image path) if we are going to add image loading

lime plaza
#

It would make my mod simpler lol

sacred jasper
#

But its meant to make asset referencing extremely simple (and fast)

#

The only issue with assets is that they must all derive UnityEngine.Object at the moment, which I suppose is fair

sacred jasper
#

@lime plaza would you agree now that you understand it slightly better that it is a useful abstraction

sacred jasper
sacred jasper
rancid silo
#

thnx

late condor
#

Hmm, there are some ways you could build assetbundles st runtime, im not sure how viable it is

#

But for stuff like loading flat icons. It might be doable to have SW build a master bundle any time icons are loaded by it, so that future loads can take less time, as its more efficient to load 1 bundle than N pngs

wicked wyvern
#

if anything, I think it'd be most helpful to have an easy way to build bundles without requiring full Unity install

#

not sure how viable that is though

late condor
#

Out of the box, I'm not sure that there is anything that is easy, but there are ways

#

If you're just loading some images into a bundle, thats one thing

#

If you're trying to compose assets and put those into a bundle its just complicated

#

And you're much better off using unity

wicked wyvern
late condor
#

Tbh, images might even present some issues, I'd have to dig into it

wicked wyvern
#

how problematic even is loading at most like a few hundred 24x24 pngs without using bundles?

late condor
#

I'm thinking of the problem at scale so each of those reads carries a lot fo overhead, if you're ONLY dealing with those 100 to 200 images, then you're not going to suffer much, but realistically, you're loading a bu ch of other bundles, maybe other file types

#

It adds up quick and each individual read carries rhat overhead

#

For players with a lot of big mods you're going to quickly reach ksp1 load timea

wicked wyvern
#

yeah I guess it's difficult here to draw the line between ease of use and performance

late condor
#

So the name of the game is, reduce the number of reads

#

In a perfect world, all mods pack everything into addressable bundles and those bundles are loaded when needed, and unloaded when not

#

But you cant realistically expect all mod devs to make the right choices on when those times are, nor that they will use addressable bundles over plain old assetbundles

wicked wyvern
late condor
#

So the next best thing is for SW to let mods load icons from disk via SW, but then behind the scenes, instead of loading the icons from disk, you cache a list of icons and compare them to the current cached bundle.
If there's new additions, you update the bundle with those additions and then just load the bundle instead and provide a way through SW to retrieve those icon sets

late condor
wicked wyvern
#

yeah that's what i meant

late condor
#

You can see this in ksp2 constantly

#

Within the VAB when you grab a part you haven't yet used on your vehicle, and you see the pink box, thats PROBABLY addressables getting loaded

sacred jasper
late condor
#

Therer is also bugs there

#

Edited because, I haven't actually inspected the code, but its the most likely thing I see as happening there

wicked wyvern
#

There seems to be a bug specifically on SpaceWarp for BepInEx where people get all procedural parts not loading in and they stay as the pink boxes

late condor
#

Yeah, I believe that's because of that ReflectionTypeLoadExcepti9m that occurs during plugin loading

#

But I haven't setup my debugging configuration yet, so I can't actually investigate, and yall are moving away from that anyways

wicked wyvern
#

yeah

#

it doesn't make too much sense to spend a lot of time working with the current version while the switch is happening

#

I'm holding off on writing my mod, too

#

even though the changes should be minimal

sacred jasper
#

@little bay I am going to mark your pr as ready to review, and pull it in so I can start working on stuff

little bay
sacred jasper
little bay
#

but tbf I don't think it ever did?

#

also, the only reason LoadIcon got thrown into the void is because i didn't know where to put it

#

it was a really dumb method too

little bay
#

like loading images is... fine

alpine tendon
little bay
#

but the way it did it was bad

#

it should require more than that

#

"icons" are not standard within SpaceWarp to my understanding

#

icon.png is not a convention

#

whoever wrote this code

Ā Ā Ā Ā publicĀ staticĀ SpriteĀ LoadIcon(intĀ sizeĀ =Ā 24) 
 Ā Ā Ā Ā { 
 Ā Ā Ā Ā Ā Ā Ā Ā stringĀ folderPathĀ =Ā Path.GetDirectoryName(Assembly.GetCallingAssembly().Location); 
  
 Ā Ā Ā Ā Ā Ā Ā Ā returnĀ LoadIcon(Path.Combine(folderPath,Ā "icon.png"),Ā size); 
 Ā Ā Ā Ā }

just kinda came up with that I think

alpine tendon
#

yes, but what's wrong with that?

#

I'm not trying to defend it btw, three people have said they don't like it so it's fair enough, I just don't understand

little bay
#

if SpaceWarp does something like this it should be standard to always have an icon.png in the root

alpine tendon
#

well it's in the tutorial

sacred jasper
#

No creation of asset bundles

little bay
#

(I also almost never like using GetCallingAssembly, but maybe that's just me)

alpine tendon
#

how would the mod author retrieve the sprite?

sacred jasper
wicked wyvern
sacred jasper
#

Also again, space warp caches assets (that aren't using addressables) internally in memory

#

Something that likely could be changed in the future to cache into an asset bundle without breaking any of the API

wicked wyvern
#

yeah I guess since the public API wouldn't need to change, it isn't a priority

sacred jasper
#

@alpine tendon

alpine tendon
#

I rather meant how is the mod author going to retrieve the texture

sacred jasper
alpine tendon
#

and an overload of that function that performs the sprite creation would be preferable to providing a texture to sprite function

#

that's already a one line thing

lime plaza
#

You can facade addressables

#

It’s how flags work

sacred jasper
#

The problem with storing it as a png, is that its a better idea to load it as a texture2d and cache that then convert it

alpine tendon
#

how much better?

sacred jasper
#

And I can overload the toolbar functions that convert a texture2d to a sprite

#
// Register the mod's button on the SpaceWarp application bar.
Toolbar.RegisterAppButton(
    "Example Mod",
    "BTN-ExampleMod",
    // Example of using the asset loader, were going to load the apps icon
    // Path format [mod_id]/images/filename
    // for bundles its [mod_id]/[bundle_name]/[path to file in bundle with out assets/bundle]/filename.extension
    // There is also a try get asset function, that returns a bool on whether or not it could grab the asset
    AssetManager.GetAsset<Texture2D>($"{SpaceWarpMetadata.ModID}/images/icon.png"),
    ToggleButton
);

@alpine tendon inline icon generation

alpine tendon
#

Very nice šŸ‘

sacred jasper
#
// This requires an `icon.png` file to exist under [plugin_folder]/assets/images
#

<@&1078770539688112168> <@&1079271050644303922> the experimental-bepinex-library branch is the branch for submitting prs for the bepinex conversion, it currently contains a working conversion to bepinex

lime plaza
sacred jasper
lime plaza
sacred jasper
#

So we should work on that soon

lime plaza
#

I’m tempted to try my hand at harmony patching and make lang data loading not dumb as hell

lime plaza
visual marlin
#

@lime plaza in the src for custom-flags you have a package reference to "E:\Programming\KSP2\SpaceWarp\SpaceWarp\SpaceWarp.csproj"

#

Which also has a reference to KSP.game; and KSP.Modding;

#

What are those references? Trying to compile and it's giving me namespace errors

wise swift
wicked wyvern
#

@sacred jasper I tried building the experimental branch and the ExampleMod project to test if it loads, and while I do get Pre-initialization for plugin ExampleMod and Post-initialization for plugin ExampleMod, it doesn't show up in the mod list and does not seem to call OnInitialized

#

LateUpdate does get called fine

#

and this happens with procedural parts, similarly to the previously existing SpaceWarp BepInEx plugin builds

little bay
#

odd that you wouldn't get initialization

wicked wyvern
#

again the ReflectionTypeLoadException

little bay
#

init and postinit are literally added right next to each other

#

could you send the whole stacktrace

#

(also the mod list is completely broken currently, that's why it didn't show up)

wicked wyvern
late condor
little bay
wicked wyvern
#

huh, yeah that is weird

little bay
#

THEY DO GETTYPES ON ALL ASSEMBLIES TWICE?

#

AAAAAAAAA

#

I fixed one of these already

sacred jasper
#

Initialize might be throwing an error

little bay
#

I'll fix this in a few hours

sacred jasper
#

Tell me where and I'll fix it soon

little bay
#

I'm going to have to search for GetTypes usages in ACS to make sure I fix them all

lime plaza
late condor
#

Those should all be wrapped in a try catch for RTLE

little bay
#

I was going to make it an OptIn thing

#

like ror2 has

#

but yeah it should also do that

#

thank you for reminding me

visual marlin
#

It's not referenced in the SpaceWarp references ;;

lime plaza
visual marlin
#

TY

sacred jasper
#

Damn, building against the dev branch of sw

wicked wyvern
#

gotta live on the edge

little bay
#

live off the edge

#

run off the edge with the speed of an Olympian

sacred jasper
#

I have been thinking about clickthroughblocker, and I think the best option is to have it compiled as a BepInEx plugin that space warp depends on

wicked wyvern
#

Yeah that's pretty much one such part of the modular library system I was mentioning yesterday

#

it makes sense to have it separated

sacred jasper
#

It needs to be due to licensing

wicked wyvern
#

oh you're going to be doing a rewrite of the original?

#

makes sense tbh, no need to reinvent the wheel

sacred jasper
#

What I am currently working on\

little bay
#

oooo events are fun

#

what does that Event class look like

sacred jasper
little bay
#

I am going to murder

sacred jasper
#

I am thinking of changing it to a type of action
I need some kind of multicast action for that though

#

@little bay what would you recommend

#

Hot dayum though, KSP has a lot of states

little bay
#

uhhh that kinda depends

sacred jasper
#

I actually want to provide an argument too

little bay
#

how do you want this to work exactly

sacred jasper
#

I want this to be something that mods can subscribe to with a function that takes a GameStateEntered/ExitedMessage parameter

#

Essentially I'm splitting out the event handling that KSP provides into a bunch of separate events for mods to handle/subscribe to

little bay
#

I mean, you could literally just have

public static event System.Action<GameStateEnteredMessage> MainMenuStateEntered;
#

then you just invoke it (in the same class) with MainMenuStateEntered?.Invoke(enteredMessage); and it will invoke all the subscribed delegates

sacred jasper
#

Wait, it has to be in the same class?

#

the invocation?

little bay
#

yeah

#

outside classes aren't allowed to invoke the event

#

just subscribe/unsub

sacred jasper
#

Gotcha

little bay
#

you can just make internal methods that invoke the events to invoke them from elsewhere though

sacred jasper
# little bay you can just make internal methods that invoke the events to invoke them from el...

Kinda a jank way of doing this I think but

internal static void OnGameStateEntered(MessageCenterMessage message)
{
    GameStateEnteredMessage msg = message as GameStateEnteredMessage;
    switch (msg!.StateBeingEntered)
    {
        case GameState.Invalid:
            InvalidStateEntered?.Invoke(msg);
            break;
        case GameState.WarmUpLoading:
            WarmUpLoadingStateEntered?.Invoke(msg);
            break;
        case GameState.MainMenu:
            MainMenuStateEntered?.Invoke(msg);
            break;
        case GameState.KerbalSpaceCenter:
            KerbalSpaceCenterStateEntered?.Invoke(msg);
            break;
        case GameState.VehicleAssemblyBuilder:
            VehicleAssemblyBuilderEntered?.Invoke(msg);
            break;
        case GameState.BaseAssemblyEditor:
            BaseAssemblyEditorEntered?.Invoke(msg);
            break;
        case GameState.FlightView:
            FlightViewEntered?.Invoke(msg);
            break;
        case GameState.ColonyView:
            ColonyViewEntered?.Invoke(msg);
            break;
        case GameState.Map3DView:
            Map3DViewEntered?.Invoke(msg);
            break;
        case GameState.PhotoMode:
            PhotoModeEntered?.Invoke(msg);
            break;
        case GameState.MetricsMode:
            MetricsModeEntered?.Invoke(msg);
            break;
        case GameState.PlanetViewer:
            PlanetViewerEntered?.Invoke(msg);
            break;
        case GameState.Loading:
            LoadingEntered?.Invoke(msg);
            break;
        case GameState.TrainingCenter:
            TrainingCenterEntered?.Invoke(msg);
            break;
        case GameState.MissionControl:
            MissionControlEntered?.Invoke(msg);
            break;
        case GameState.TrackingStation:
            TrackingStationEntered?.Invoke(msg);
            break;
        case GameState.ResearchAndDevelopment:
            ResearchAndDevelopmentEntered?.Invoke(msg);
            break;
        case GameState.Launchpad:
            LaunchpadEntered?.Invoke(msg);
            break;
        case GameState.Runway:
            RunwayEntered?.Invoke(msg);
            break;
        case GameState.Flag:
            FlagEntered?.Invoke(msg);
            break;
        default:
            throw new ArgumentOutOfRangeException();
    }
}
#

I subscribe to these in bootstrappatch

wicked wyvern
#

might be a bit more readable at least with a dictionary?

little bay
#

i can make a GameInstanceAvailable event

#

so we don't start throwing a ton of shit into bootstrap patch

sacred jasper
visual marlin
#

Compiled new SW and new example mod, neither show up for me thinkEgg

visual marlin
#

Where are we at, I have the latest PR

sacred jasper
#

But I'd check the logs

visual marlin
#

I can certainly help

sacred jasper
#

@little bay @visual marlin I pushed through my changes if either of you want to work on stuff

visual marlin
#

Thank you!

lime plaza
sacred jasper
#

They won't show in the mods UI btw, that's currently busted

visual marlin
sacred jasper
#

It's not meant to

wicked wyvern
#

not on my machineā„¢ļø

visual marlin
#

Anyone able to hop in vc and make sure I'm not insane?

sacred jasper
visual marlin
#

No worries, anyone can do it

#

fetch the experimental-bepinex branch, pull it into VS2022, build it

#

Then I put the .dll in BepInEx\Plugins\SpaceWarp

sacred jasper
#

BepInEx logs?

visual marlin
#

Pulling it now with screenshot too

#
[Message:   BepInEx] BepInEx 5.4.21.0 - KSP2_x64 (2/24/2023 7:00:36 AM)
[Info   :   BepInEx] Running under Unity v2020.3.33.9525882    
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.21.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 1 plugins to load
[Info   :   BepInEx] Loading [Space Warp 0.4.0]
[Message:   BepInEx] Chainloader startup complete```
visual marlin
#

Yes

#

Nothing visual at all

sacred jasper
#

That's extremely odd

visual marlin
#

No sound either

sacred jasper
#

Ksp2 log?

visual marlin
#

I am going to clear everything, validate files, then check again real quick

#

Validate and load only BIE, works just fine.

#

Add the SpaceWarp.dll file and the same thing - no sound and no menu

visual marlin
#

KSP2.log: ```
[LOG 14:56:50.318] [System] ******* Log Initiated *******
OS: Windows 11 (10.0.22621) 64bit
CPU: AMD Ryzen 9 3900XT 12-Core Processor (24)
RAM: 32692
GPU: NVIDIA GeForce RTX 3080 (12107MB)
SM: 50 (Direct3D 11.0 [level 11.1])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, ARGBInt, RGInt, RInt, BGRA32, RGB111110Float, RG32, RGBAUShort, RG16, BGRA10101010_XR, BGR101010_XR, R16

Log started: Thu, Mar 02, 2023 14:56:50

sacred jasper
#

That's the entirety of it?????

visual marlin
#

Yup

#

Just freezes, no loading screen either

#

It never shows the loading bar "pumping dres" etc

sacred jasper
#

@little bay I think we might have messed something up in the harmony patching

wicked wyvern
#

I had that same thing happen a while ago

visual marlin
#

Finally, a contribution šŸ˜„

wicked wyvern
#

it was like at 0.2

#

when messing around with the BepInEx plugin

#

had no idea how to fix it, deleted BIE and SW and installed both again and it somehow fixed itself

sacred jasper
#

Great, a heisenbug

visual marlin
#

@wicked wyvern You said you compiled the latest version of SW?

wicked wyvern
#

actually I might be missing the latest commit, let me try again

visual marlin
little bay
#

why would the harmony patching do that

visual marlin
#

This one please

sacred jasper
visual marlin
#

I think so -- these are missing from the KSP2.Log immediately after the freeze

[LOG 15:01:58.293] Command Line Args:G:\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64.exe
[LOG 15:01:58.922] [UI] Primary EventSystem Selected: 'GameManager'(instance id: 205062)
[LOG 15:01:58.925] [UI] Localization sources updating
[LOG 15:01:59.065] [UI] Localization sources updating
[LOG 15:01:59.073] [System] Set Loading Optimizations completed in 0.0007s.
[WRN 15:01:59.245] [Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information. SteamManager
[LOG 15:01:59.447] [System] Creating Game Instance completed in 0.3692s.```
#

Maybe has something to do with this?

    SpaceWarp.Patching.BootstrapPatch+<>c.<PatchInitializationsIL>b__1_2 () (at <e9e72329d0674f39be44a94b85a7f415>:0)
    (wrapper dynamic-method) KSP.Game.GameManager.DMD<KSP.Game.GameManager::StartBootstrap>(KSP.Game.GameManager)
    (wrapper dynamic-method) KSP.Game.GameManager.DMD<KSP.Game.GameManager::Awake>(KSP.Game.GameManager)
[LOG 14:49:32.595] [UI] Localization sources updating```
little bay
#

is this latest commit

sacred jasper
#

Yes

#

It could've been me

little bay
#

if so, its because GameManager.Instance.Game.Messages doesnt exist yet

wicked wyvern
#

yep you're right

#

it is bugged

sacred jasper
#

Ah that's my fault then

wicked wyvern
#

but at least console shows log, while KSP2.log doesn't

little bay
#

these two lines need to happen later

wicked wyvern
little bay
#

well, to be precise, they need to be a part of the loading flow or patched onto something in the loading flow

#

GameManager.Instance.Game is what doesn't exist at this point, sorry

#

not GameManager.Instance.Game.Messages

visual marlin
#

Can I move them?

#

Wait, this is git. I don't need to ask

sacred jasper
#

Definitely should put out bootstrap events

#

To stop me from pulling this bullshit

little bay
#

i can put out that GameInstance exists event kekw

#

i'd just hook the GameInstance create FlowAction

sacred jasper
#

Lol yeah

#

Should likely publicly expose it

#

Put it into an API

little bay
#

I mean

#

most things should just use OnInitialized

#

which is late enough where everything is loaded

#

SpaceWarp itself can't do that though

#

well, actually

#

maybe it could?

#

I wonder if we could make SpaceWarp use BaseSpaceWarpPlugin

sacred jasper
#

We should actually

#

Means we could get rid of all the space warp specific loading

#

I was actually about to do that then decided it'd be weird, but now I realize it makes sense

little bay
#

thats way better

sacred jasper
#

Now space warp will show in the mod list lol

#

When we fix that

late condor
#

Is that really such a bad thing to see the common api in the mod list?

little bay
#

she's saying that as a good thing

late condor
#

oh my bad

sacred jasper
little bay
#

its just the mod list UI is broken

late condor
#

I totally interpretted that as "when we fix it showing up in the mod list"

little bay
#

figured

sacred jasper
#

Yeah, I didn't make that clear lol

little bay
#

i love it when my game's launcher refuses to launch

sacred jasper
#

PDlauncher was a mistakr

#

That is so obviously a move by the publisher

visual marlin
#

Please someone PR so I can test the fix

#

I dont wanna duplicate if Aaron is working on it šŸ™‚

little bay
#

i havent fixed the RTLE yet

sacred jasper
little bay
#

ReflectionTypeLoadException :p

#

i got one of them, the one in MessageDiscovery

#

but the PropertyDiscovery one is trouble since its in a static construtor

sacred jasper
#

Flashback to when I saw someone making a mod by trying to set a const field to false with harmony, which idk if possible or not

little bay
#

consts don't exist

#

well, they do, kind of

#

but if you ever use one in code, you aren't referencing the const

late condor
#

they are compiled away into literals

little bay
#

it copies the value in the const into the usage place at compile time

sacred jasper
#

Those were my thoughts

#

And someone was trying to use harmony to patch the const lol

sacred jasper
little bay
#

great question

#

i do not know the answer

#

it finds all classes marked with DiscoverablePropertyAttribute

sacred jasper
#

And that's why it rtles?

#

Autocorrect corrected rtle to take

little bay
#

yeah

#

cause it looks in every single assembly

#

not just Assembly-CSharp

sacred jasper
#

bruh

#

Is that necessary

little bay
#

i means mods can be included automatically

#

which is nice

#

at least its easy to fix globally

[HarmonyPatch]
internal static class FixGetTypes
{
    [HarmonyFinalizer]
    [HarmonyPatch(typeof(Assembly), nameof(Assembly.GetTypes))]
    [HarmonyPatch(typeof(Assembly), nameof(Assembly.GetExportedTypes))]
    private static Exception GetTypesFix(Exception __exception, Assembly __instance, ref Type[] __result)
    {
        if (__exception is ReflectionTypeLoadException rtle)
        {
            SpaceWarpManager.Logger.LogWarning($"Types failed to load from assembly {__instance.FullName}, continuing anyway.");
            SpaceWarpManager.Logger.LogWarning($"Exception: {__exception}");
            __result = rtle.Types;
            return null;
        }
        return __exception;
    }
}
sacred jasper
#

Is this gonna be in the next pr

little bay
#

yea

#
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
PhysicsSettings.get_DaysInYear () (at <8c5bdf369a8c45f68951f69eb825ef73>:0)
KSP.UI.Binding.UIValue_ReadNumber_DateTime.Awake () (at <8c5bdf369a8c45f68951f69eb825ef73>:0)
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass57_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
DelegateList`1:Invoke(AsyncOperationHandle`1)
UnityEngine.AsyncOperation:InvokeCompletionEvent()
#

i can't

#

how

wicked wyvern
#

that is a stock error, no?

little bay
#

thats terrifying if so lmao

wicked wyvern
#

I'm pretty sure

little bay
#

why is this even on PhysicsSettings

wicked wyvern
#

looking through the logs with no mods, you get dozens of various errors

little bay
#

oh because the value isn't 365

#

okay, fair enough

wicked wyvern
#

time to make some more bugfix mods munley

little bay
#

well now i just have to figure out why this is

[Warning:Space Warp] Types failed to load from assembly SpaceWarp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null, continuing anyway.
[Warning:Space Warp] Exception: System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
  at (wrapper dynamic-method) System.Reflection.Assembly.DMD<System.Reflection.Assembly::GetTypes>(System.Reflection.Assembly)
#

oh

#

i'm stupid

#

the mod compiler can't find roslyn

sacred jasper
#

Lmao

little bay
#

i just deleted the compiler

#

its always in git if we need it again

sacred jasper
visual marlin
#

Testing now

little bay
#

forgot to delete the nuget dependency that it used, but oh well

visual marlin
#

Found Space Warp plugin Space Warp without a swinfo.json next to it. This mod will not be initialized.

How do we make these?

sacred jasper
#

Should be added to build script

#

But copy swinfo from the repo

visual marlin
#

Doing it now

#
[Info   :   BepInEx] Running under Unity v2020.3.33.9525882    
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.21.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 1 plugins to load
[Info   :   BepInEx] Loading [Space Warp 0.4.0]
[Message:   BepInEx] Chainloader startup complete
sacred jasper
visual marlin
#

Nope, no main menu and no sound

sacred jasper
#

Very odd ...

visual marlin
#
OS: Windows 11  (10.0.22621) 64bit
CPU: AMD Ryzen 9 3900XT 12-Core Processor  (24)
RAM: 32692
GPU: NVIDIA GeForce RTX 3080 (12107MB)
SM: 50 (Direct3D 11.0 [level 11.1])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, ARGBInt, RGInt, RInt, BGRA32, RGB111110Float, RG32, RGBAUShort, RG16, BGRA10101010_XR, BGR101010_XR, R16


Log started: Thu, Mar 02, 2023 16:21:16
little bay
#

just replace the file in BepInEx/config

visual marlin
#

You betcha

#

Nope. Same issue

sacred jasper
#

He wants the log files

little bay
#

should be more stuff in LogOutput.log though

visual marlin
#

My bad

#
Stack trace:
SpaceWarp.Patching.LoadingActions.LoadLocalizationAction..ctor (SpaceWarp.API.Mods.BaseSpaceWarpPlugin plugin) (at C:/Users/Nick/Documents/GitHub/SpaceWarp/SpaceWarp/Patching/LoadingActions/LoadLocalizationAction.cs:12)
SpaceWarp.Patching.BootstrapPatch+<>c.<PatchInitializationsIL>b__1_2 () (at C:/Users/Nick/Documents/GitHub/SpaceWarp/SpaceWarp/Patching/BootstrapPatch.cs:46)
(wrapper dynamic-method) KSP.Game.GameManager.DMD<KSP.Game.GameManager::StartBootstrap>(KSP.Game.GameManager)
(wrapper dynamic-method) KSP.Game.GameManager.DMD<KSP.Game.GameManager::Awake>(KSP.Game.GameManager)

[Info   : Unity Log] [UI] Localization sources updating```
little bay
#

thats... odd

#

plugin.SpaceWarpMetadata is null

sacred jasper
#

We should load the metadata earlier?

little bay
#

metadata is loaded as early as possible iirc

sacred jasper
#

No, wait it checks for swinfo metadata for space warp

#

So why is it null

little bay
#

yeah its loaded before GameManager Awake

visual marlin
#

Can you send me your swinfo @little bay

#

I wanna swap it in

little bay
#

its the one in the repo

#

i wrote it then copied it

#

there should be a log before that if it failed to load the swinfo

visual marlin
#

noted

sacred jasper
#

Send the full log

visual marlin
#

Okay, I rebuilt the SWINFO by hand and it is fixed

little bay
#

oh

visual marlin
#

I wonder if it was a file encoding thing

sacred jasper
little bay
#

yours is probably CRLF? compared to the original LF

#

but that shouldn't matter

sacred jasper
#

Likely using platform specific encoding ...

little bay
#

the parser should not be affected by line endings

sacred jasper
#

It really shouldn't no

little bay
#

and both should be UTF8

sacred jasper
#

CRLF kinda is unbased imo

visual marlin
#

It's all good now -- did you get to work on the modlist display?

little bay
# little bay you can try this

but yeah this just adds

            plugin.SpaceWarpMetadata = JsonConvert.DeserializeObject<ModInfo>(File.ReadAllText(modInfoPath));
            if (plugin.SpaceWarpMetadata is null)
            {
                Logger.LogError("wtf how is this null right here");
            }
sacred jasper
little bay
#

UI scares me

sacred jasper
#

I'll work on it

#

When I get home

visual marlin
#

Well done erryone

sacred jasper
#

@visual marlin @little bay (I didn't have to rebuild the swinfo either)

little bay
#

no idea

sacred jasper
#

But I was more showing I got the mod list UI to work

sacred jasper
#

I also updated the build script

#

@timber cedar wanna review my PR?

timber cedar
#

yesir

#

-1,162

#

reviewed

sacred jasper
#

Added searching to the console

sacred jasper
#

Next up gonna look on control locks for the console and adding it to app.bar

visual marlin
#

@sacred jasper Can I please have modder status?

#

ty

sacred jasper
visual marlin
#

New reaction roles :0

sacred jasper
#

Console has been added to appbar

wicked wyvern
#

might not be a bad idea to add a config option for that, as most users won't be needing to see it ig?

#

and now that SpaceWarp is in the mod list, it should be pretty easy

sacred jasper
#

we have to do some stuff to support config UIs before that

solar crystal
#

Eventually id like to figure out how to add the console to the control binding screen so you can just set your own key

wicked wyvern
#

input binding abstraction would be nice in general, yeah

sacred jasper
#

That's something we are planning to look into

late condor
#

Is this at a point t where I can do some test dev with the new setup?

sacred jasper
#

but thats cc by sa

#

Or look at the example mod in the repo

#

but yes, it should be in such a position

late condor
#

its not updated on spacedock yet right?

sacred jasper
#

What kinda development are you planning btw?

sacred jasper
#

@late condor ?

late condor
#

oh just testing interop with TK, trying to get spacedock package downloading working, etc.

#

I'll probably do some kind of custom part test with some new, probably useless, function

sacred jasper
#

Okay, you have to point the addressable to the Plugin folder naturally, but you already knew that I think

late condor
#

I actually don't know what you're referring to, I never had the opportunity to actually make use of addressables in a mod

#

{SpaceWarp.API.SpaceWarpManager.MODS_FULL_PATH}/<mod-id>/addressables/StandaloneWindows64
this stuff?

sacred jasper
#

It should instead use the bepinex plugins path

late condor
#

okay, thats easy enough

candid sorrel
#

How close are we to getting a pre-release of the bepinex library? Would like to do some tests with my mod tomorrow and I always struggle with building this kind of stuff from source

sacred jasper
#

Should I add this function to the AssetManager API?

/// <summary>
/// Attempt to patch an asset at a path
/// </summary>
/// <param name="assetPath">The path to the asset to patch</param>
/// <param name="asset">The asset to patch with</param>
/// <typeparam name="T">The type of the asset that the asset is being patched with</typeparam>
/// <exception cref="ArgumentOutOfRangeException">Thrown if the asset does not exist</exception>
/// <exception cref="ArgumentException">Thrown if the type of the patching asset cannot be assigned to the type of the patched asset</exception>
public static void PatchAsset<T>(string assetPath, T asset) where T : UnityObject
{
    if (!AllAssets.Contains<>(assetPath))
    {
        throw new ArgumentOutOfRangeException(nameof(assetPath));
    }

    if (AllAssets[assetPath].GetType().IsAssignableFrom(typeof(T)))
    {
        PatchLogger.LogError($"Attempting to patch {assetPath} which is a(n) {AllAssets[assetPath].GetType().FullName} with an object that is {typeof(T).FullName}. This is an error.");
        throw new ArgumentException(nameof(asset));
    }

    AllAssets[assetPath] = asset;
}
alpine tendon
sacred jasper
#

Well, figuring out BepInEx configurations is next on my list

sacred jasper
#

Well, after abstracting more of KSPs message system for mods to use

#

Example

wicked wyvern
#

I'm dumb, I've been trying to get my mods working on the experimental branch and kept trying to debug why my Harmony patches weren't loading

#

didn't realize that the new version removed the loading of Harmony patches for mods until now like an hour later

#

but good news is that everything seems to work fine now that I added Harmony.CreateAndPatchAll lol

sacred jasper
#

Fun times ahead

wicked wyvern
#

are you abstracting the whole message system?

sacred jasper
#

All the currently used parts at least

wicked wyvern
#

wouldn't want to be the one doing that oof

sacred jasper
visual marlin
#

I keep running into Icon Problems

sacred jasper
#

what does your space warp folder look like

#

bepinex/plugins/spacewarp/

visual marlin
sacred jasper
#

There are too many messages to do this shit

#

401 message types, I ain't got the time for that

wicked wyvern
#

yeah that's way too much

sacred jasper
#

Just going to keep game state messages

sacred jasper
#

Unless I can automate generating message actions

wicked wyvern
#

yeah I was also thinking about that

visual marlin
#

@sacred jasper Did you say there was an issue with window dragging?

sacred jasper
visual marlin
#

That's all I needed to know. I'll solve it with the mod owner

sacred jasper
#

Space warp menus have close buttons now

hollow cypress
#

anyone know the path to fields added to a [ModConfig]

#

i got it setup but idk where the fields are accessed at runtime

sacred jasper
#

We are looking into for the BepInEx version to use BepInEx.Configuration and BepInEx.ConfigurationManager for the user side

hollow cypress
#

got it loaded but the return value is just zero unless i specify it in the field declaration, which then overrides the user changes

#

the default attribute doesnt seem to affect it

#

have any other mods used it yet?

sacred jasper
#

I've tested it at least

hollow cypress
#

yeh i was doing it wrong

#

never used out with multiple parameters

#
                if (manager.TryGet("StageInfo", out (typeof(StageInfoConfig), object obj, string "") cfg))```
#

nvm got it, thx

sacred jasper
#

Aight, I'm gonna make the first prerelease

sacred jasper
#
  1. Fix the UI assets currently bundled in space warp
  2. Integrate app.bar support into more than just in flight
  3. Abstract more of KSP out
  4. Look at features people wish to have integrated in space warp\
#

@late condor could you explain to me which guistyles had the nine slice issue in that screenshot?

late condor
#

yeah, uh, let me find the picture you posted

#

see how they are weirdly elongated

#

thats because the image being used for the background doesn't have its 9 slice sizing correct

sacred jasper
#

Yeah, but what are those specifically, so I can look at hunting those down first

late condor
#

ah, I'll have to look at the code and try to figure it out, can you point me at where this is created?

sacred jasper
late condor
#

ah. where is the asset for the skin stored?

#

I can just put in a pr for it

#

assuming its on git

sacred jasper
#

Here is the source for the .bundle file

late condor
#

how do yo uwork with this, do you just have rthe contents of the repo under the assets folder in a project?

alpine tendon
#

I believe

sacred jasper
#

Gotcha

alpine tendon
#

also have you been able to add a scroll bar to the gui skin yet?

sacred jasper
alpine tendon
#

ah nice

late condor
#

there you go

#

I can show you how I diagnosed if you want

#

just 1 screenshot actually

#

I checked all the controls, so I don't think you'll ahve any other issues

#

you can't see the scrollbars there, but I tested those too

sacred jasper
late condor
#

already done

sacred jasper
#

Pog, then need to rebuild assets into space warp

#

Was gonna take a quick break but I can do this

#

toggles got broken again, let me unpack the bundle and reset the changes

late condor
#

hmm

sacred jasper
#

Which is odd cuzzz

#

This is a test of the space warp console I have in unity

#

Let me just nuke the assets and try again?

#

I mean it fixes one issue with lazy orbit, but breaks the config manager?

late condor
#

oh wow, I see yeah, thats really broken, but I don't get why that would break

#

I really wana say its a coincidence

sacred jasper
#

Likely

#

I mean, we don't need the GUI skin for it, it's just nice to have

late condor
#

what branch are you testing on?

sacred jasper
late condor
#

Did you do that harmony patch thing?

sacred jasper
#

but all its doing is prefixing OnGUI to apply a skin

late condor
#

oh you should also postfix that

#

I don't kjnow how to write harmony patching but...

#
[HarmonyPatch(typeof(ConfigurationManager.ConfigurationManager))]
[HarmonyPatch("OnGUI")]
public class ConfigurationManagerPatch
{
    GUISkin prevSkin;
    public static void Prefix()
    {
        prevSkin = GUI.skin;
        GUI.skin = Skins.ConsoleSkin;
    }
    public static void Postfix()
    {
       GUI.skin= prevSkin;
    }  
}
#

because otherwise you can pollute other GUI attempts

#

otherwise, just don't use a harmony patch and set it when you initialize the gui system in general

#

it doesn't look like the bepinex config manager sets GUI.skin anyhere, it just uses whatever is enabled

#

that said, this almost certainly has nothign to do with the issue

sacred jasper
late condor
#

Are you getting exceptions in your logs?

sacred jasper
#

Nope

#

I mean, we have a few options, we can just remove the IMGUI Skin for the manager, and just use it normally, or we can debug this

wicked wyvern
#

on a sidenote: I don't seem to be getting any logging (definitely not exceptions) from Harmony patches within KSP2.log, just in the BIE debug console

late condor
#

my curiosity is peaked because based upon everything I know about IMGUI,a nd looking at the config manager code for this part of the ui, and the changes I made, this should work

#

and there is no reason the toggles should collapse like that

sacred jasper
#

No, they shouldn't collapse

late condor
#

was it a skin change you did?

sacred jasper
#

Could it be because toggles to stretch to width under my skin

wicked wyvern
#

Maybe it's working as intended after switching to the BIE logger? seems like it might be getting logged into BepInEx/LogOutput.log but I'd have to recreate the exception to be sure

sacred jasper
#

It should still create the bounding box

#

I don't have time to debug this atm

wicked wyvern
#

just to clarify, seems like exceptions go through to the regular Ksp2.log but anything logged through BaseUnityPlugin.Logger only goes into the BIE log

late condor
wicked wyvern
#

yeah seems like the default behavior

late condor
#

in the BepInEx/config folder you'll find BepInEx.cfg, inside which you'll find settings for logging behavior that control how logging works

#

(╯°▔°)╯︵ ┻━┻

#

previous image wasn't the actual copied code

#

this inside the editor without spacewarp though, so its not really apples to apples

sacred jasper
#

(╯°▔°)╯︵ ┻━┻

late condor
#

yeah, I feel ya, its gotta be somethign with the specific interaction between all the stuff, but I'm not setup to build SW and I don't want to get sucked to far down a rabbit hole when I got a bunch of other stuff I want to do to get tk all good for ksp

little bay
#

having it as a field works too, isn't thread safe, but that doesn't matter for OnGUI anyway

#

just more uhhhh

#

idiomatic harmony? I guess? to use __state

late condor
little bay
#

it only happens with the parameter called __state

#

magic names :p

#

but you can store whatever in that one variable anyway, using a tuple/struct

late condor
#

only one then eh, so you potentially have to create a state struct if you need a bunch of stuff

little bay
#

so it doesn't matter that you only get one most of the time

#

(and usually you're just passing one or maybe two things through like this)

#

out (Type1, Type2, Type3) __state my beloved

candid sorrel
#

Was there a persistence regression in the pre-release? I think the BepInEx_Manager is getting destroyed on quit to main menu. Or at least my script is

little bay
#

not that I'm aware of

#

if there was I know how to fix it

#

just need to test it

#

ah wait no someone said that ksp2 kills all gameobjects that aren't marked with a certain tag

#

so yeah it just needs to get marked persistent

candid sorrel
#

yeah objects that don't have a hide flag or are tagged "Game Manager" or "Graphics Manager" get nuked on quit to menu

#

i can do it from my mod too but i think it's best if the default behaviour goes back to that object being peristent

little bay
#

actually you can fix it

#

go into BepInEx.cfg and turn on the option to set HideAndDontSave on the manager GO

#

always forget that's there

candid sorrel
#

Does that make you unable to FindObjectsOfType<T> for those components? It's janky but just wondering

little bay
#

uhhhh

#

don't remember

#

try it, it should work

#

the SpaceWarp BepInEx just needs to ship with that setting enabled

#

not SpaceWarp

#

SpaceDock

#

the SpaceDock version of BepInEx needs to ship with that enabled

#

I'm tired

sacred jasper
#

I am shipping bepinex w/ space warp to make installation easier for people

little bay
#

sounds odd for mod managers, normally I'd say to make BIE a dependency

#

that way dependencies resolve correctly

late condor
#

its really not that different from what the ror2 community does

#

and KSP plugins really kinda need the functionality of the SpaceWarpBaseUnityPlugin in order for setup to be easy

little bay
late condor
#

R2API is a lot less critical for Ror2 as well

little bay
#

it comes with a few things, but they don't generally get updated, and there's still only one BepInEx

late condor
#

yeah, that is a fair point

little bay
#

SpaceWarp packing BepInEx would make it so there's now two available

late condor
#

Id hope that the other 3 packages get deprecated assuming that spacedock supports that

little bay
#

not to mention that it's still nice for things that just don't need SpaceWarp to be able to communicate that properly

#

like if UnityExplorer goes on SD

sacred jasper
#

So no packaging BepInEx in, I'll still likely package BepInEx.configuration

#

?

#

The problem is then, we need to tell @median pendant to ship the BepInEx plugin with that configuration preset to hide the manager

little bay
#

that's fine

#

he can just do that kekw

#

(while you're at it bepis, could you enable unity log to disk and set the disk log level to All? always makes it easier to debug issues that get sent in from users)

wicked wyvern
# little bay sounds odd for mod managers, normally I'd say to make BIE a dependency

I'd just like to say that while I agree with this if there is an actual mod manager like CKAN available, it will make things more difficult for the end users before that happens. This way if they want to download a SW mod, they have to first go and download and install BIE, then download and install SW and finally download and install the mod

#

I don't really see why packaging BIE in the SW release zip for now would be an issue

#

if someone only wants to use BIE, they can still just download that separately

#

if they want to use SW, they will always need both anyway

#

and if they were already using BIE and want to add SW, rewriting the BIE files shouldn't hinder their previously installed BIE mods in any way

#

Correct me if I'm wrong about some of my assumptions, but for now I see only advantages in the combined packaging

bold stag
#

@timber cedar can the UI for installer be ported to Linux?

timber cedar
#

can try

#

not at 4am

#

tomorrow

bold stag
#

I have a simple python script which does the work, but after seeing your PR I think I should just borrow the UI and port it to Linux.

#

do you mind?

timber cedar
#

its under mit :D

#

you do what you want

#

if its good you can pr back

#

and ill check it out

#

not in 4am

bold stag
#

alright

mossy kraken
#

Kinda cool video about Space Warp mods

mossy kraken
#

Teaser from the space warp team šŸ³ļøā€šŸŒˆ

sacred jasper
#

@little bay I'm having an issue where only the core configuration is showing up in the configurationmanager

#

Waitttt, could it be failing because of hide and don't save?

bold stag
#

@timber cedar added, let me do a PR.

#

where to though? Directly to installer of SpaceWarpDev?

sacred jasper
#

Could that be failing because we set hideAndDon'tSave

#

No, it should work?

#

It legitimately work because of that

#

It ... doesn't fucking work

#

Alright, time to harmony patch it

candid sorrel
#

I think any DontSave hide flag will make it so that Objects.FindObjectsOfType<T> won't find them. Not sure about Resources.FindObjectsOfTypeAll<T>

sacred jasper
#

I'm gonna patch it to use ChainLoader

late condor
#

sorry should refer to the right version

sacred jasper
#

I patched it by using chainloader instead and it worked

late condor
#

so in theory you want it to be using the Resources call

late condor
sacred jasper
#

They literally made that method to avoid chainloader, but I need to use chainloader for some reason

late condor
#

I'm curious why Marco did that

sacred jasper
#

Me too

#

as it broke the config manager

little bay
#

ĀÆ_(惄)_/ĀÆ

timber cedar
sacred jasper
#

Only 2 things left for 0.4.0

#
  • make console not crash game
  • oab toolbar
sacred jasper
#

@alpine tendon you were gonna make a PR for the oab toolbar at some point?

alpine tendon
#

later tonight, playing games with some friends at the moment

sacred jasper
#

Gotcha

#

Have fun

alpine tendon
#

all the code is in vc no mic if you want to try it out

sacred jasper
storm quail
#

why is spacewarp not updating ;-; I am having the same problem as last time I tried to update. I did the restore nuget and putting the managed dlls into the external dll folder

#
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\beast\\Desktop\\SpaceWarp-spacewarp-0.3.0\\SpaceWarp-spacewarp-0.3.0\\SpaceWarp\\bin\\Debug\\0Harmony.dll'
#

Also

#

a ton of these

      C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\API\AssetBundles\ResourceManager.cs(6,37): error CS1514: { expected [C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\SpaceWarp.csproj]
        C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\API\AssetBundles\ResourceManager.cs(125,2): error CS1513: } expected [C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\SpaceWarp.csproj]
        C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\API\Configuration\ConfigDefaultValueAttribute.cs(3,38): error CS1514: { expected [C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\SpaceWarp.csproj]
        C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\API\Configuration\ConfigDefaultValueAttribute.cs(13,2): error CS1513: } expected [C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-0.3.0\SpaceWarp\SpaceWarp.csproj]
        C:\Users\beast\Desktop\SpaceWarp-spacewarp-0.3.0\SpaceWarp-spacewarp-
#

Like 100 more of missing bracket exceptions

#

Also this is 3.0

#

not the 4.0 that uses the bepinex install

sacred jasper
storm quail
#

Im using Microsoft Visual Studio

sacred jasper
#

what version

storm quail
#

2019

sacred jasper
storm quail
#

I somehow installed 2.5 with the current version. I dont know how I fixed the problem though

sacred jasper
#

some of the stuff we do post 2.5 requires a lot of newer visual studio features

storm quail
#

Alright

sacred jasper
#

Polysharp, file scoped namespaces, c# 11

storm quail
#

Ah ok

#

That reminds me lmao

#

Thats how I fixed the problem

#

with 2.5

#

I changed the solution from 11 to 9

#

lmao

#

A bit devious

#

Im already installing 2022 Visual Studio though

#

so theres no point

#

Honestly I am suprised it compiled with the version change I did in the solution

sacred jasper
storm quail
#

New 2022 version worked!

visual marlin
#

2022 is smooth I love it

queen pilot
#

Space Warp featured in Scott Manley's latest video šŸ™‚ https://youtu.be/9v4Z9jxvJvY?t=613

Sure I've been streaming it here and there, messing around with it and breaking things. While also throwing many bug reports to the developers.

Follow me on Twitter for more updates:
https://twitter.com/DJSnM

I have a discord server where I regularly turn up:
https://discord.gg/zStmKbM

If you really like what I do you can support me directly ...

ā–¶ Play video
sacred jasper
#

Incorrect point about it being superceded

wicked wyvern
#

yeah, but not to be unexpected from someone not involved in modding

storm quail
#

Cheese how do I know if a part is succesfully loaded without loading into the VAB

#

is it printed into the console at all?

#

also is it printed if a part fails to load?

sacred jasper
#

But not specific parts

#

Scott Manley hearted my comment!

wicked wyvern
#

nice, the Mun man himself

storm quail
#

Nice

storm quail
#

How do i check what version of spacewarp I am using to make sure it updated correctly'

sacred jasper
#

Good question lol, I should add that

#

0.4.0 onwards will show in the mods tab

storm quail
#

Nice

#

Cheese have you gotten a working part in the VAB as an example I could use

#

?

#

Sorry for asking so many questions all the time

sacred jasper
#

Not for 0.4 no

#

I don't have any w/ localization either

#

ask adam for that

wicked wyvern
#

Just wanted to make sure, since I saw 0.4 is doing something with BepInEx configuration but wasn't paying too much attention - is that replacing the 0.3 built-in SW config classes or is it just a fallback for non-SW BepInEx mods?

wicked wyvern
#

Alrighty, thanks

bold stag
#
#[tauri::command]
fn get_install_type() -> bool {
    let dir = finder::find_install_dir();
    let files = dir.read_dir().expect("Failed to read install directory!");

    let mut is_bepinex = false;

    for file in files {
        if file
            .unwrap()
            .file_name()
            .to_str()
            .unwrap()
            .contains("BepInEx")
        {
            is_bepinex = true;
        }
    }

    return is_bepinex;
}```

@timber cedar is this redundant?
timber cedar
#

redundant to what

bold stag
#

okay, wait no.

timber cedar
#

ok

bold stag
#

didn't see ternary here. ```js
const res = await invoke_proxy(
kind == InstallKind.BepInEx
? "download_bepinex"
: "download_doorstop"
);

timber cedar
#

mmm

bold stag
#

@timber cedar. Linux working just doing a PR.

#

although, there is a bit of a bug.

timber cedar
#

lioc

#

.. wrong branch

bold stag
#

wdym?

timber cedar
#

this one

bold stag
#

oh.

#

crap.

timber cedar
#

i didnt realize

#

:C

#

sorry man

bold stag
#

lol

#

wait

#

let me see

#

also is auto-install worth it? could we not just prompt for browse?

#

imo auto-install is prone to lots of failures?

timber cedar
#

thats the literal point of an installer xd

bold stag
#

umhm

#

installation is simple enough, yeah.

timber cedar
#

yeah

#

the point is to make a game manager

#

with instances

#

and mod profiles

bold stag
#

@timber cedar it's blank.

timber cedar
#

look at the error?

bold stag
#

no error prob smth with directory

#

let me look

timber cedar
#

xd what did you launch it with

bold stag
#

cargo tauri dev

timber cedar
#

did you right click on the window and inspect it

bold stag
#

yep.

#

body is empty except in the script tag it's is referring to some typescript file.

bold stag
#

``` Running BeforeDevCommand (pnpm app:dev)

[email protected] app:dev /home/user/Space-Warp-Installer
vite

VITE v4.1.4 ready in 570 ms

āžœ Local: http://localhost:1420/
āžœ Network: use --host to expose
Info Watching /home/user/Space-Warp-Installer/src-tauri for changes...
Finished dev [unoptimized + debuginfo] target(s) in 0.28s


sinon, any idea why it's white?
sacred jasper
#

Alright, if we get oab appbar in this morning we release

alpine tendon
#

working on it now

visual marlin
#

Huzzah!

alpine tendon
#

also, scrollbars would be very nice

visual marlin
#

Most of the conversions are done, I'm working with devs as I can contact

#

You can tag me as a resource on conversion for devs

mossy kraken
#

Anything else that needs to be done before we release?

visual marlin
#

ClickThoughBlocker?

#

I know Rex opened it but might as well ask

mossy kraken
#

Makes it so much easier to know what to work on, what is being worked on by who etc

sacred jasper
sacred jasper
visual marlin
#

Really not a worry then

alpine tendon
#

I keep mentioning the scroll bar thing because it's only every so often that people are going update their SW and it has a big impact on usability

mossy kraken
#

Don't prioritize scrollbars at this point.
What really stops us now from releasing this as 0.4.0 that will give modders the chance to convert their mods over to BepInEx plugins?
Lets focus on that

sacred jasper
#

It's just that when testing the unity assets in unity, it works perfectly

mossy kraken
#

Once we have released v0.4.0 we can release more often as long as we dont break things

#

The scroll bar is not a breaking change

#

So lets get all those done first

#

and we can add scrollbars in 0.4.1

#

major.breaking.patch

wicked wyvern
#

well, semver defines this as:
MAJOR version when you make incompatible API changes
MINOR version when you add functionality in a backwards compatible manner
PATCH version when you make backwards compatible bug fixes

#

so BC break should be major version

#

but it doesn't really apply well to pre-1.0

mossy kraken
#

problem is that we are at 0.x.x

#

0.4.0.0

sacred jasper
#

I was wondering what we would need to call it 1.0

mossy kraken
#

We should prob bump to 1.0.0 indeed

sacred jasper
#

It's already been noted in multiple places that this would be called 0.4.0, the next update should be 1.0.0

wicked wyvern
#

yeah I agree with that for clarity

#

but other than that I feel like it's pretty much ready for 1.0.0, since the biggest change has already happened, and now the development should be somewhat more stable

mossy kraken
#

But its like a brand new project at this point. We nuked almost everything from 0.3 and changed what the project is trying to achieve

#

Kinda weird to go from a modlauncher to an API from v.0.3 to v0.4

#

šŸ˜›

wicked wyvern
#

well

#

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

#

so even huge breaking changes like this are not off the table

sacred jasper
#

The question becomes when should we consider the API stable enough for 1.0

wicked wyvern
#

(of course all this applies only when you commit to following semver, but I feel like that's a no-brainer to do for consistency)

mossy kraken
#

As long as I have worked as a software engineer I have never had anything I would really call "stable".
Things break all the time and when you really think things are stable, they break like never before šŸ˜›

sacred jasper
#

Fair
Let's keep this as 0.4.0 for clarity's sake, and see what we can do to make the next release "1.0.0" worthy

mossy kraken
#

Sounds good to me

alpine tendon
mossy kraken
#

šŸ™šŸ™šŸ™

wicked wyvern
#

give me an OAB app bar button API and I'll be happy to call it 1.0.0 munley

sacred jasper
sacred jasper
wicked wyvern
#

also might be worth it to look into perhaps adding stuff to the KSC main screen in some capacity?

mossy kraken
#

Okey but lets focus on 0.4.0 then.
What needs to be done for us to release it right now?

#

We can plan 1.0.0 later

sacred jasper
#

Realistically, just the oab app bar, that's the most important feature thats been in progress

mossy kraken
#

Alright, what is stopping us from making that work right now? šŸ˜„
We can postpone click through blocker to the big UI patch later.

sacred jasper
#

Halban is just about done with it, I think they are still making the pr

mossy kraken
alpine tendon
sacred jasper
#

Aight, I'll make the release in like 30 mins

#

after I do more testing ofc

alpine tendon
#

if we want to expand this to tracking station etc. it could probably be made a lot more generic, right now there's a lot of duplication

mossy kraken
#

Updated to project board to better reflect the state of each issue:
• What is in the backlog
• What is planned to be worked on
• What is in being worked on right now
• What is ready for next release
• What is released to the public

sacred jasper
#

Key bindings already exist for mod configuration

#

Because bepinex.configuration adds that

wicked wyvern
#

I can't help but notice that there are two "In Production" headings

mossy kraken
#

Ups, copy paste

#

More like this

hollow cypress
#

any chance of maintaining backwards compatibility with 0.3 mods, at least for a release or two?

wicked wyvern
#

it's probably near impossible since the folder structure, the plugin directory, the mod attributes and base class are all completely different

#

I think it would take way more effort than actually implementing any new features, and not worth the effort if the (possibly) 1.0 release after this dropped the support anyway

#

it'd be way easier to make some small script that goes through a 0.3 mod project and changes stuff to work with 0.4+

#

(but I don't want to speak for the devs of SW)

hollow cypress
#

k fair

sacred jasper
#

@visual marlin you were writing something about transitioning from SW 0.3.0 -> 0.4.0

mossy kraken
#

We are targeting a v1.0.0 release as the next release for Space Warp.
All Pull Requests containing new features should be directed towards that branch for them to be included in the next big update.

visual marlin
#

@sacred jasper Yep, I was trying to pick apart the game state stuff but I'll get on that

wicked wyvern
#

"If you believe you have found a security vulnerability" yeah I've found one, it's KSP 2 munley Rider keeps screaming at me for using Newtonsoft.Json.dll 12.0

mossy kraken
wicked wyvern
#

yeah, understandable