#making-mods-general

1 messages ยท Page 111 of 1

next plaza
#

It's not annotation, but the only reference is nameof

#

But hey, HD sprite overrides with SpaceCore

uncut viper
#

the sometimes-ability to change method signatures or properties withou complaining about harmony will forever elude me, at least a full understanding of it โœจ

#

or complaining about hot reload rather

next plaza
#

@frozen cedar If you do end up wanting to try the SpaceCore route, this build lets you do HD texture overrides. You'll need to specify a new field "SourceSizeOverride", which is a Vector2 size of the new texture source rect to use. (I did it this way so you could still in theory use animations with this feature.) Here's an example:

        {
            "Action": "EditData",
            "Target": "spacechase0.SpaceCore/TextureOverrides",
            "Entries": {
                "testhdportrait":{ // Of course change testhdportrait to something different for each entry, preferably using {{ModID}} as well
                    "SourceTexture": "{{InternalAssetKey: hdportrait.png}}",
                    "SourceSizeOverride": { "X": 256, "Y": 256 },
                    "TargetTexture": "Portraits/Penny",
                    "TargetRect": { "X": 0, "Y": 0, "Width": 64, "Height": 64 },
                }
            }
        },
#

When I publish this build it'll be 1.27.0

uncut viper
#

whens spacecore gonna get a 2.0

drowsy pewter
#

this is amazing

next plaza
#

(I'm not as strict about semantic versioning for the C# API, probably should be...)

uncut viper
#

i think you should just go straight to 3.0 when that happens

next plaza
#

Maybe I should jump straight to version 2147483647.0. Then I can never break compatibility again per semver, since I'd be at int.MaxValue

#

...I wonder

#

@ Pathoschild - How would you feel about a PR allowing negative versions in SemanticVersion

#

(I would have to give up the manifest builder since assembly versions can't be negative)

shadow pagoda
#

I'm still trying to figure this out. I was able to figure out how to theoretically draw something on screen. I say theoretically bc it doesn't give any errors, but the chicken doesn't seem to appear.

This is the code I have so far

private void OnUpdateTicked(object? sender, UpdateTickingEventArgs e)
{
    texture ??= Game1.content.Load<Texture2D>("Animals//Blue Chicken");
    spriteBatch.Draw(texture, new Vector2(1280, 800), null, Color.White);
}

My plan is just to create an image in paint that's just black, and load that instead. Though this seems like a lot of effort just to get a black screen to appear. I still need to do text, and I'm not sure if my current plan is the best way. Does anyone know an easier way, and why the chicken isn't appearing?

tiny zealot
#

if you want to draw to the screen, you likely want to use Rendered instead of UpdateTicked

#

i would guess that you are drawing too early, so the game is rendering over you

uncut viper
#

well after several hours of trial and error i have now figured out how to apply high/low/band pass filters on audio in the game
totally not an obtuse process at all to do so (send help)

#

im like relatively sure thats about all you can do besides change the pitch and volume though... the reverb fields/properties/methods seem to do absolutely nothing, which is a shame i think

uncut viper
#

psa: dont fuck with the frequency/filterq/etc values too much bc if you keep them the same but switch from e.g. highpass to lowpass, and the lowpass doesnt like the values you just had set (even though they worked just fine for highpass), it'll just kill the music with an absolutely ear piercing screech noise for a split second and then not work until you restart the music again. very fun

shadow pagoda
hard fern
#

SDVpuffersweats discord went down for me whoops

#

i was typing up something when it got eaten ๐Ÿ˜”

uncut viper
#

oh yeah discord was super fucked for a while there

hard fern
#

the question i wanted to ask was... uh. oil maker is not letting me make specifically sunflower oil instead of normal oil..

#

(i wanted to add recipes for actual types of oil)

#

outside just. nondescript oil

lucid iron
#

Did you move entry

hard fern
#

move it where SDVpuffersweats

lucid iron
#

To the top

hard fern
#

how do i do that?

lucid iron
#

This moves the Erronnaise up

teal bridge
lucid iron
#

So it dun get swallow by normal egg mayo rule

brave fable
hard fern
#

aaah i get it

#

tyy

#

:swe

#

..

#

๐Ÿ˜…

uncut viper
hard fern
#

SDVpufferflat why discord why

lucid iron
#

Oh blueberry I wanted to ask about your error with the tokens

teal bridge
#

Yeah, I actually saw your message 20 minutes ago and my replies went red, then everything went to hell, and I decided to take a whiskey break.

brave fable
#

i had an error?

lucid iron
#

Content patcher

uncut viper
#

nested token thingy

lucid iron
#

Not error but issue

next plaza
#

Oh, is that why this happened?

brave fable
#

content patcher

uncut viper
#

dictionary key

next plaza
#

I sent that message and looked away and looked back wondering why my message was red

teal bridge
#

Yeah, the red text was Discord shitting itself.

uncut viper
#

pretty sure all discord messages everywhere died for about 30 minutes there

#

like, for realsies died, not even resending was possible for a while

teal bridge
lucid iron
#

Is it only broken for dynamic tokens?

brave fable
#

oh the token issue. content patcher

lucid iron
#

I was think about it cus I use ModId in nested stuff all the time

brave fable
#

no idea, only tested with dynamic tokens in a custom model

#

i think it might be the model somehow but unsure

lucid iron
brave fable
#

i remember noticing some token-key entries with tokenised values a bit ago and thinking that was odd given i had absolute definitive reproducible proof that mine didn't work

silver pelican
#

yay, dc is working now xd

hard fern
#

lol

#

yep it keeled over for a hot min

silver pelican
icy viper
teal bridge
#

output.heldObject.Value = chest looks awfully suspicious to me. I thought that only worked for auto-grabbers.

icy viper
#

It's what Selph suggested me to do. Did I use it wrong?

teal bridge
#

ยฏ_(ใƒ„)_/ยฏ don't mind me, maybe it's an EMC thing.

But weeds are object ID 0 so seeing weeds generally means either "Item ID wasn't set" or "Item ID was set but we didn't understand it and drew a default item instead of an error item".

woeful lintel
#

Idk how this bubble thing works, but it looks like you'd have to manually tell the game to check inside the chest to know what to draw

brave fable
#

is it a used-a-bigcraftable-index-where-the-game-expected-an-object-index issue

#

chest and weeds looks like that sort of problee

icy viper
#

That weed is an item from EMC itself I'm pretty sure of it. I'm not sure how that works tho. Even then, they all use the same method so I have no idea how only normal bait work normally lol.

rancid temple
#

I didn't think EMC added items

teal bridge
#

So it might be something passing in the full ID where it expected an unqualified ID - tried to do an (O)(BC)130, got nothing, and rendered a default (zero) item instead of error item.

velvet narwhal
#

that weed is definitely index 0 in springobjects

shut bane
#

Gotta love it: visual studio 2022 is complaining about an int being fed into a method that takes an int, saying that it cannot convert a float to an int.

teal bridge
#

^ I doubt that, you've probably got the wrong overload

rancid temple
teal bridge
#

Yes. Either wrong ID or missing ID.

#

Don't know for sure if it's because of the chest, that's just what stood out to me.

hearty cloud
shut bane
# teal bridge ^ I doubt that, you've probably got the wrong overload

I'm setting up a GMCM addnumberoption for an integer slider, and the method signature even says the value I'm using is an int, and the contextual highlighting says it's the same variable in both places of the lambda expression. So I'm not sure what I'm doing wrong. If I try to explicitly cast it as an int, other lambdas break

rancid temple
#

Depends on what the dictionary expects

#

Could just be an int, something dictionary so the key could easily be 0 lol

teal bridge
#

Visual studio has many quirks, but not knowing the difference between a float and an int isn't one of them.

hearty cloud
rancid temple
#

Oh, VS complains about the wrong shit when you do GMCM wrong

shut bane
#

Oh, I have both int and float overloads in the api.cs file, maybe I'll just remove the float overload

teal bridge
#

It's usually because some other parameter isn't matching, and so it's causing VS to think you used a different overload.

#

Probably you are passing some ints and some floats which makes it ambiguous which overload you wanted.

shut bane
#

I have no floats anywhere in the project lol

teal bridge
#

Ok, whatever you say... we all use this mod API and none of us have that problem.

rancid temple
#

I have had the problem, but it's usually because I wasn't doing the () => thing correctly lol

teal bridge
#

There are two overloads, one takes all int (or Func<int>, etc) parameters and the other is all float.

shut bane
#

I commented out the float overload and that particular error went away (others came up so I'm obvs messing up somewhere)

teal bridge
#

If you cause VS to choose the int overload, and one of your arguments is/returns a float, then it's a compilation error.

teal bridge
#

(It's a strangely-written and hard-to-read function, but I think whatever the error is lies elsewhere)

icy viper
#

Sorry it's not tidy code lol.

#

It's a visual bug so that's not a huge deal tho.

brave fable
#

if you use (namedArgs: 1f, inThisWay: () => i18n.get()) then you can sidestep param confusion and force VS to show you the mistakes you made in the overload you actually want

teal bridge
#

It might be somewhat less effective with those GMCM overloads in particular because their parameters have exactly the same names, just different types.

#

The other way to force it is by adding explicit casts to each param and seeing which cast it considers invalid.

hearty cloud
icy viper
#

I'm pretty sure the fault is on me, so I'll still keep fiddling things around lol.

shut bane
#

or I'm just an idiot and I just use the "param: value" directly instead of a lambda, when adding the GMCM option

teal bridge
#

Eh... there is no non-lambda overload.

#

You can use named parameters or positional parameters but it is going to be a Func<int> or Func<float> either way.

shut bane
#

I'm just an amateur, if I'm misunderstanding then I'm stumbling into a valid solution

teal bridge
#

Those are all lambdas. Except for the min/max/interval which don't take functions.

shut bane
#

Now that you explicitly mention it: that's what I was overlooking

teal bridge
#

I mean, it looks fine and all, with the caveat of us not knowing any of the types involved, I just don't follow the "just use param:value instead of lambda", that's not what's happening here.

shut bane
#

the min/max/interval are int constants I defined elsewhere. I naively assumed because lambdas were used for earlier params, that they would be used for all following ones

#

it's ok, the frustration is just ignorance leaving my brain

teal bridge
#

I see. Well, glad you got it sorted.

old edge
#

Hm does season override not work on farm maps?

brave fable
#

it should? island west is permanently summer

#

although that does use location context specifically

old edge
#

Yup got both those but I just tested it but I did use a previous farm and switched with easy farm switcher

#

Ok yeah something to do with easy farm switcher maybe its not so easily compatible. The map property doesn't get modified.

brittle pasture
#

so a workaround is to manually add a color tag to deluxe bait/magic bait/challenge bait

#

but I should ask why are you using the holder item in the first place? you're only returning fish, which are all Objects

#

it shouldn't be necessary

icy viper
#

There's a chance it can return a furniture which causes the machine to parse an error.

#

Noticeable in Volcano Forge

#

Do I not need to use it?

brittle pasture
#

got it, though your C# function is already filtering them out

icy viper
#

Yeah, I tried to get the fish as much as possible. It's just a failsafe option.

#

So I just append context tag to other baits?

brittle pasture
#

yes

#

or actually, item queries support color fields now

#

ah doesn't work because of the C# method

#

since you're doing C# anyway, instead of Object output = new("selph.ExtraMachineConfig.Holder", 1); do Object output = new ColoredObject("selph.ExtraMachineConfig.Holder", 1, Color.White);

icy viper
#

Yep, it works great! Thank you very much!SDVpufferheart

#

And my apologies for the occasional pings! I hope it doesn't bother you much.

brittle pasture
#

It's fine, I totally don't mind pings

warped spade
#

Hello there, I'm struggling a bit with moveentries ๐Ÿ˜…
I'm trying to move chocolate valley's water bottles after the juice entry added by realistic seasonal shop inventory but smapi says the id for the juice entry doesn't exist... What am I doing wrong ? SDVpufferwaaah
{
"Action": "EditData",
"Target": "Data/Shops",
"TargetField": ["SeedShop","Items"],
"When": {
"HasMod |contains=boringvlln.rshops": true,
"HasValue: ChocoValley_Water": "true"
},
"MoveEntries": [
{ "ID": "ChocoValley_Water", "AfterId": "boringvlln.rshops_JuicesP" }
]
}

icy viper
#

What does the log say?

warped spade
#

It says "Can't move record "MRSSI - Chocolate Valley > Include data/shop_pierre.json > EditData Data/Shops #5" > MoveEntries > "ChocoValley_Water" AfterID "boringvlln.rshops_JuicesP": no entry with ID 'boringvlln.rshops_JuicesP' exists."
https://smapi.io/log/de6f3d8f113f4d2ca1951a513df7477a

ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 10 Famille, with 18 C# mods and 3 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

warped spade
#

Here's the shop entry from rssi
"boringvlln.rshops_JuicesP": {
"Condition": "!PLAYER_HAS_SEEN_EVENT Any 191393",
"RandomItemId": [ "FLAVORED_ITEM Juice (O)613", "FLAVORED_ITEM Juice (O)256", "FLAVORED_ITEM Juice (O)635" ],
"Id": "boringvlln.rshops_JuicesP",
"AvailableStock": 6,
"AvailableStockModifiers": [
{
"Modification": "Multiply",
"RandomAmount": [
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
]
}
],
}

icy viper
#

Try adding rssi in dependencies with IsRequired False?

#

My guess is your mod is probably loading first before rssi.

warped spade
#

I'll try that right away !

#

I'm speechless

#

An entire day wasted because of something so simple

#

Thank you very much GalaxY

#

Now, to implement that obvious correction to all my patchs SDVpuffercry

slender badger
warped spade
#

Yeah but each of my patch has a manifest as they patch different mods

slender badger
#

...why are they all separate mods instead of just being Includes in one mod? ๐Ÿ˜…

warped spade
#

Honestly, I just followed in boringvlln's steps when creating mrssi ๐Ÿ˜…

slender badger
#

Okay, thanks for not doing the thing, Discord CGSusEyes

uncut viper
#

!codeblock i think shows it

ocean sailBOT
#

You can embed code in Discord using a series of three ` :
```
Your code can go here
Even if not a haiku
Just an example
```

For syntax highlighting, add the language code on the same line as the first
``` (with no space, like ```json).
The usual codes are cs (C#) and json.

uncut viper
#

(codeblock command also used to be broken and i had no idea if it still was)

slender badger
#

Thanks, Button!

warped spade
#

like this ?

#

Oh

slender badger
#

Yep!

warped spade
#

Okay that excellent to know, thanks Airyn !

slender badger
#

But yeah, I'd recommend looking at the CP docs for how to set up Include files because then you can have all your patches in one mod and just turn them on or off with a HasMod check

#

Makes things a lot easier both for you and for your users

warped spade
#

My futures mods won't be like that I promise

#

I'll try to merge them when all patchs are advanced enough

slender badger
#

Oh, your code's already got Includes SDVpufferthinkblob Also do you use VS Code? If you do, it's got an option to auto format your code for you that helps line it all up & make it easier to read if you're interested

warped spade
#

I'm on sublime text for now and plan to switch to vs code when I get my new computer. I read it can check json files format as well ?

slender badger
#

Yep! It's pretty handy ๐Ÿ˜„

warped spade
#

Can't wait to try it then ๐Ÿ˜† I've lost so much time over missing comas and other shenanigans ๐Ÿฅฒ

slender badger
warped spade
#

Not at all

#

It seems I can't answer to you ๐Ÿ˜…

slender badger
#

Huh, you should be able to? SDVpufferthinkblob Do you have DMs from server members disabled?

#

It was disabled earlier but now it looks like it's turned back on

warped spade
#

I didn't know it would prevent me from answering ๐Ÿ˜…

drowsy lake
#

Hello-
I modified an existing mod's art for personal use- but it's a minor change (like- deleting the vase in a potted new crop)
if other people are interested in it- should i contact the mod author to ask them if they can add the no-vase option in the mod configs perhaps and hand them the edits i made if they want to use them to make things faster?

slender badger
#

You can ask, but the author might not be interested

drowsy lake
#

if other people are interested in my no-potted personal change, what should i do?
i do not want to step on the author's feet to be honest, and i really did it just for myself

slender badger
#

If other people are interested but the author isn't, then there's nothing you can do. Personal edits can't be shared

drowsy lake
#

okke!
Thank you for the insight! โค๏ธ

ocean sailBOT
#

@drowsy lake You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!

hallow prism
warm spruce
#

you dont have anything to lose by asking. worst they can say is noSDVpuffersquee

#

but u an always check the mod's permissions, some mods do have open perms

#

(a minority but always better to check first anyway, it will answers some questions)

drowsy lake
#

Thank you guys! SDVpufferchickhug
Still keeping them for personal use for now and asking the author if they want or not- if not, i'll just keep everything for myself SDVpufferchickhug

hallow prism
#

good luck with the project!

#

hmm

#

would it be too powerful to have a crop growing in fall, winter and spring?

calm nebula
#

Nah, ancient fruit exists

#

Now I want an ancient fruit tree

#

Old as I am

hallow prism
#

i miss ancient crop mod

drowsy pewter
#

me too ๐Ÿ˜”

#

some new person offered to update it and they were making progress but disappeared

#

it is how it is lol

calm nebula
#

Yup

hallow prism
#

hmm

#

another question

#

can i check if a CT like "harvestedcrop_mycrop" (whatever) is active and set a flag/send a mail based on that?

calm nebula
#

Sure!

#

It's a normal conversation topic at that point

hallow prism
#

cool, this may be easier than "you have to ship whatever number of this crop"

#

(maybe i'll check and adjust aster event too, one day)

calm nebula
#

Well that is easy enough too since there is a gsq foe that

#

For

#

Unless you mean player easy not modder easy

hallow prism
#

yeah checking is easier, but the player may transform/gift the crop instead

#

so if they never ship stuff they never progress

#

while stuff like "set flag if crop is grown then do whatever" may be one more step but more flexible

calm nebula
#

Ooh, new vwv crops goodness?

hallow prism
#

currently it's for serene meadow hybrid plans

#

i like the idea of having some "hey you got an hybrid, cool" mails here and there

calm nebula
#

Oooh that'll be cute!

#

I love the idea of hybrids tbh

#

They're like

#

One of the really fun parts of gardening

#

Or like, random mutants

#

(Irl gardening ofc)

hallow prism
#

yeah! mine are a very simplified version (and more color variation than hybrid) but it's fun to have

slender badger
drowsy pewter
#

I think so, but it's better to chat with us first in case there are any design changes that need to be made/would be better for player experience

#

(also to chat with us so I can gauge how much they know about what they're doing and how much work I'd have to do to bugtest it later LOL)

slender badger
#

Kinda tempted to take a stab at it myself SDVpuffersquee

#

I really liked Ancient Crops back in the day

drowsy pewter
#

Well I definitely trust your experience

hallow prism
#

beautiful scopecreep happening right under my eyes

slender badger
#

(I shouldn't, given I have DSV update stuff to do, but hey ๐Ÿ˜† )

drowsy pewter
#

I've always kinda wanted ancient crops to have more integrated feel with the game so I kept putting off updating/etc because I wanted a rework at the same time

hallow prism
#

it'll be easier with a working base i feel

drowsy pewter
#

So it's kinda like, if you (general "you") offer to update it you can also take artistic liberties

hallow prism
#

because you can then just change stuff on the fly

slender badger
#

What sort of things were you thinking for integrating it more? SDVpufferthinkblob

hallow prism
#

(are plural of iris iris or irises or something else?)

slender badger
#

Irises, yep

drowsy pewter
#

When we spoke with this person they discussed working it more into ginger island (such as with the shop or finding seeds or stuff), since GI was added after ancient crops was designed but both were intended to be later game content

hallow prism
#

oh the trade shop can be a pretty good failback way to get seeds by trading stuff as long as you already shipped them once or something

drowsy pewter
#

Like a lot of endgame content has been added since we made that mod

slender badger
#

It would be neat to have an additional way of finding the seeds in case you lose or accidentally sell the originals

drowsy pewter
#

Well if anyone who happens to be listening to this convo happens to decide to work on the mod, let me know so I get a kick in my ass to make the giant crop sprites SDVpuffercoolest

calm nebula
#

If it's "just" CP recoding I could knock it out in an hour or two but no sooner than xmas

hallow prism
#

i considered personal conversion, and JA>CP should be quick and fast, it's the MFM>CP part that i didn't want to think about

slender badger
#

Oh yeah, I forgot we have a JA to CP converter

hallow prism
#

"i just have to patch export data from JA to CP then i will... have... to do the mails... ok nope"

lucid iron
hallow prism
#

(i am old school, i considered the patch export solution ๐Ÿ˜„ )

#

yes

#

so pretty

lucid iron
#

Delete every existing item made from this mod. If you miss any you can crash your game!

#

Our ancestors had difficult lives

#

Would need to convert pfm to cp machines too

drowsy pewter
#

Yes, trying to achieve perfection with json shuffle?

#

Or the old-old days, when crop modders had to make compatibility files by stitching together crop tilesheets so that people could use multiple crop mods when replacing the xnbs

hallow prism
#

the council of fish for aquarium position ๐Ÿ˜„

crimson meteor
#

Does anyone know where the slingshot resources are in the content folder?

brittle ledge
hallow prism
#

yeah the ability to have specific tilesheets pretty much everywhere now is really great because this works on a small scale, but not really for lot of mods with lot of updates and such

#

resources as?

#

the slingshot images must be in weapons

#

the munitions in maps/springobject i guess

crimson meteor
hallow prism
#

it's possible it's requiring some C#

lucid iron
#

I think all slingshots shared the used sprite

crimson meteor
#

I changed the texture of ammon but it doesn't change

hallow prism
#

i believe the fishing rod for ex requires C# for some color change in hand

lucid iron
#

Which is in farmer base?

calm nebula
#

When was this

lucid iron
#

Will need C# to retexture them separately

#

Also I rly hope u r make content patcher mod monS

crimson meteor
#

Where can I get c#?

slender badger
lucid iron
#

!startmodding

ocean sailBOT
#

Making mods can be broadly divided into two categories:

Usually itโ€™s easier to start with making content packs, since you don't need to learn programming.

drowsy pewter
hallow prism
#

i remember when we were happy to have extra crops that would do basically nothing except being sold, because it's all was possible with xnb

calm nebula
#

Wrll, now I want more! (Plays a wordle clone instrad)

crimson meteor
#

Can someone explain to me how to use contentpatcher to change the texture?

#

I have no idea how to use it.

lucid iron
#

You need to first make a content patcher with the manifest and content json

#

Then use edit image to alter texture

crimson meteor
#

I already did it, now how do I change a texture?

hallow prism
#

!json to show us what you have

ocean sailBOT
#

JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.

If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.

When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.

shadow pagoda
#

I found a page that explains all the events, https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events, and I assumed AssetRequested would allow me to see if one of my assets was being checked. I'm just trying to draw something to the screen, but having no luck on doing so. This is what I have so far

private void OnRendered(object? sender, RenderedEventArgs e) 
{
  Log("OnRenered");
  texture ??= helper.ModContent.Load<Texture2D>("assets/Apple.png");
  spriteBatch.Draw(texture, new Vector2(1280, 800), null, Color.White);
}

private void OnAssetRequested(object sender, AssetRequestedEventArgs e)
{
    Log("OnAssetRequested");
    if (e.Name.IsEquivalentTo("assets/Apple"))
    {
        Log("Apple.png is requested");
        e.LoadFromModFile<Texture2D>("assets/Apple.png", AssetLoadPriority.Medium);
    }
}

private void Log(string message, LogLevel logLevel = LogLevel.Debug)
{
    this.Monitor.Log(message, logLevel);
}

Although OnAssetRequested OnRenered do get printed to the console, Apple.png is requested does not. I have also tried changing the if statement in OnAssetRequested to be

if(e.Name.IsEquivalentTo("assets/Apple.png"))

with no luck either. I'm not sure what else to try. I feel like I've spent way too much time (about 8 hours) just putting a picture on the screen.

iron ridge
#

you're listening for something targeting Content/assets/Apple.xnb

calm nebula
#

you would need to deliberately pass a target through the game content pathway to do that

#

this is useful mostly for, like, letting other people edit your textures

#

also

#

like

#

spriteBatch.Draw

#

I forget the arguments, but I would expect it to be position to the top left

#

try

spriteBatch.Draw(texture, Vector2.Zero, null, Color.White);

shadow pagoda
iron ridge
#

it has to possibly exist in the content folder

#

it doesn't have to exist at the moment you add the listener

shadow pagoda
#

How would I use OnAssetRequested in order to check if an image from my mod's assets folder? I'm aware of doing something like this

helper.ModContent.Load<Texture2D>("assets/Apple.png");

which I tried to change helper to e with e being AssetRequestedEventArgs, but that gave me a syntax error

calm nebula
#

you don't do OnAssetRequested for internal assets

#

what are you actually trying to do

#

frankly, I think your actual error is you're drawing off the screen

shadow pagoda
calm nebula
#

you can use Game1.staminaRect (in most situations)

#

it's a single pixel

#

There's also a Utility method that draws a rectangle to the screen

shadow pagoda
#

what's it called?

calm nebula
#

it's somthing like Utility.DrawSquare

#

but it fundamentally does what I linked

crimson meteor
#

Does anyone know how I can rotate a Sprite without destroying the image?

shadow pagoda
wheat finch
#

Do we still need Producer Framework in 1.6 to add new items to machine inputs/outputs?

lucid iron
#

nop

#

[[Modding:machine_data]]

#

[[Modding:Machines]]

lucid iron
#

yey

#

there's a few features that are pfm not but in machines yet

#

u can check out extra machine config for extra options

umbral fractal
#

Can chatgpt make stardew valley mods ?

wheat finch
#

No

umbral fractal
#

Ohh

wheat finch
#

!chatgptcode

ocean sailBOT
#

Please stop trying to get ChatGPT to write your C# mods for you, especially if you don't know how to write C#. It won't work without heavy editing, and it wastes everyone's time.

Large language models fundamentally are reguritating something from their inputโ€”which is roughly speaking, the written output of humanity up until 2021 or so, for ChatGPT. For specific, niche topics like "is this framework going to do what I want" or "which things does Game1.cs have access to", it probably has no idea! But it's good at detecting that people in the past have....said things about frameworks and written things in C#, so it does its best to assemble words and symbols into a nice order for you. Sometimes it tells you true things, and sometimes it tells you false things, and if you can't detect when, you're in trouble. When you're writing code, this usually produces garbage, because you can't be "sort of similar", you have to be exactly correct or it won't work.

umbral fractal
#

Ok

#

I can do terraria mods

wheat finch
#

!startmodding

ocean sailBOT
#

Making mods can be broadly divided into two categories:

Usually itโ€™s easier to start with making content packs, since you don't need to learn programming.

brittle ledge
#

(for similar reasons, chatgpt is also ass at dialogue - you can't get it specific to stardew)

uncut viper
#

(could've stopped before "at dialogue" tbh)

calm nebula
#

now can chatgpt generate me a picture of a donkey

brittle ledge
hard fern
#

I have started to make (some) headway into proper events...

wheat finch
#

Once I finish updating all my mods for 1.6 it's back to the big mod I've been working on for 3ish years. Been delaying more work on that one b/c of the 1.6 conversion and the fact I have heart events still to come up with and I've been struggling to think of good ones.

teal bridge
#

3 years? That's enough time to make a whole game.

#

I think 3 months feels like a long time for most of us. (In some cases, maybe even 3 weeks!)

lucid iron
#

didnt vmv take like 4 years

rain basalt
#

๐Ÿค” can you make configurations show and hide with other configurations? or do i have to add all the clutter

lucid iron
#

in C# ik there's pages

#

not sure if cp supports that

lethal crescent
#

is there a guide on how to update mods to the new stardew valley?

drowsy pewter
#

1.6 or 1.6.9?

lethal crescent
#

1.6.9

lethal crescent
#

thank you very much!

drowsy pewter
#

No prob, it should cover basically everything though you can ask here if you have specific errors

wheat finch
#

Didnโ€™t realize there was a 1.6.9 migration guide. Been using the base 1.6 guide this whole time.

next surge
#

Is this something that can still be implemented?

๏ปฟusing Netcode;
using StardewValley;
using StardewValley.Monsters;

namespace ToolGeodes.Overrides
{
    public static class RockCrabPiercingHook
    {
        public static void Prefix(RockCrab __instance, int damage, int xTrajectory, int yTrajectory, bool isBomb, double addedPrecision, Farmer who)
        {
            if (who.HasAdornment(ToolType.Weapon, Mod.Config.GEODE_PIERCE_ARMOR) > 0)
            {
                var shellGone = Mod.instance.Helper.Reflection.GetField<NetBool>(__instance, "shellGone").GetValue();
                if ( !shellGone.Value )
                {
                    shellGone.Value = true;
                    __instance.shake(500);
                    Mod.instance.Helper.Reflection.GetField<bool>(__instance, "waiter").SetValue(false);
                    __instance.moveTowardPlayerThreshold.Value = 3;
                    __instance.setTrajectory(Utility.getAwayFromPlayerTrajectory(__instance.GetBoundingBox(), who));
                    __instance.moveTowardPlayer(-1);
                    __instance.currentLocation.playSound("stoneCrack");
                    Game1.createRadialDebris(__instance.currentLocation, 14, __instance.getTileX(), __instance.getTileY(), Game1.random.Next(2, 7), false, -1, false, -1);
                    Game1.createRadialDebris(__instance.currentLocation, 14, __instance.getTileX(), __instance.getTileY(), Game1.random.Next(2, 7), false, -1, false, -1);
                }
            }
        }
    }
}

This code is pretty old, and I'm unfamiliar with Stardew Modding, for now...

lucid iron
#

you should try to build it first

#

and inspect/fix each error that appears

next surge
#

That's not really going to answer my question on if the effect would still work in 1.6.14. I have an already built copy of the old mod. Unless there's some form of building mods outside of Visual Studio, like a stardew specific plugin or something that gives Stardew specific errors that I'm not aware of

uncut viper
#

i mean a code snippet without context doesnt really tell anyone what the effect is intended to be

#

or what specific part you're asking about whether its still possible or not

next surge
#

Old school effect that would break/kill those annoying rock crabs

#

without having to smack them a bunch of times

rancid temple
#

I don't think anyone has an encyclopedic knowledge of all the methods that have changed either

lucid iron
#

unfortunately we dont have any fancy intergration testing framework

uncut viper
#

i mean any effect is possible if you wanna write the C# for it

lucid iron
#

u would get farther just by getting in game and trying

uncut viper
#

you can still write code to kill rock crabs same as you always could

rancid temple
#

I don't think any methods have been straight removed without any replacement possible

uncut viper
#

and even if they were, you could just reimplement them

lucid iron
#

personally i suspect this will be fine but i dont even know what method this bit o code is supposed to Prefix

uncut viper
#

yeah theres no patch information besides it being a prefix

brittle pasture
#

RockCrab.takeDamage presumably

rancid temple
#

I've taken to naming all my prefix methods after the things I'm patching, since I refuse to move to Harmony attributes lol

uncut viper
#

you could still put that information in an attributed function

brittle pasture
#

and tbh from a quick glance it seems like everything this method need are still there

uncut viper
#

i wrap all my patches in try/catches and put the function info in the error message

next surge
uncut viper
#

in the catch

brittle pasture
#

just build, see if it throws errors and fix them as you go

next surge
#

And honestly, I just want to learn how to add the rock killing effect to a weapon, if possible

#

then later learn how to make my own weapon, but 1 step at a time.

lucid iron
#

wow it's enchantments b4 enchantments DokkanStare

next surge
#

Yeah but there were more of them heh

#

it was a nice way to dump minerals too

#

It was one of my favorite mods back in the day

#

Second to maybe Magic

deep cypress
#

Making a new farm map: Any considerations which need to be taken? My plan was to copy paste the Vanilla Meadowlands farm map.

hallow prism
#

hey everyone, a quick question

#

it was pointed to my attention that my polished gems appears in the gem and mineral collection

#

they aren't donatable to museum (using the tag to exclude them), before they were completable anyway, but with the 1.6.??? change they aren't

#

what are my options?

#

(and do you believe this would deserve a pathos signal so the tag exclude them from collection now that it's the actual donation that matters in every case?)

uncut viper
#

yeah it seems like the part of the collectionspage that checks whether the mineral should show up drawn just checks if it exists in the museum, not whether it should in the first place

#

i think i recall that change being made in 1.6.9

hallow prism
#

yeah it's pretty recent

uncut viper
#

"The collections tab now shows artifacts, gems, and minerals once theyโ€™re donated to the museum (not as soon as you find it)."

#
case "Minerals":
  whichCollection = 3;
  farmerHas = LibraryMuseum.HasDonatedArtifact(id);
  break;
hallow prism
#

hi @ivory plume do you think the collection list of donatable items can check and exclude for items having the not_museum_donatable?
If it fits in one of the bug fixes changes and is, of course, not a breaking change?

uncut viper
#

i dont remember what the 1.6.8- version of this code looked like but it should probably do an || and the original check if its not a valid donation item, i agree

rancid temple
#

Unless I'm reading this wrong, it should?

uncut viper
#

thats not checked on the collectionspage

hallow prism
#

(i wonder if the items WITH the donatable tags should count)

uncut viper
#

that code snippet i posted is what checks whether or not the gem should be greyed out or not on the collections page

#

and HasDonatedArtifact just checks whether the item exists in the placed museum pieces

rancid temple
#

Oh, I see

uncut viper
#

which it wont, ofc, bc it cant be donated

#

you cant just change HasDonatedArtifact though bc i imagine thatd mess up other checks for all items that are not donatable items

#

so changing CollectionsPage would be best

#

id think, anyway

hallow prism
#

yeah basically i think it means that VMV players will get uncompletable collection currently.

uncut viper
#

it wont actually affect achievements

#

just the visuals on the collections page

hallow prism
#

my workaround would be to make the gems something that isn't gem as category, but obviously it's not the cleanest

#

it wont?

uncut viper
#

achievements/perfection

#

nah the perfection checker only checks if you have the total number of valid artifacts

#

and that total excludes items with that context tag

#

if you have the total number donated* i mean

hallow prism
#

that is something good to share with the person that asked me about them

#

i suppose tracking stuff is still confusing but this means it's a lower issue

uncut viper
#

funnily enough it actually checks if you have exactly the nubmer of total artifacts

#

so if you ever somehow add an item to the museum collection through means other than specifically left clicking a slot in the donation menu while you are in the museum

#

and reach or exceed that total

#

you cannot complete the museum

#

(actually ig if you force the museummenu open from anywhere, it will work, but its hard to force it open when it really wants you to be in the museum for it to exist)

#

i would almost say thats also probably something that should be changed to check for >= instead of just == but i dont think its exactly common to be able to exceed the limit or reeach it outside that menu, but like, theres not a safeguard in place for it afaik. any mod can just manually add an item to the museumPieces dictionary

#

could be an issue if someone makes a "mail your items to the museum" mod

hallow prism
#

C# mods i assume?

uncut viper
#

yeah CP mods cant do it

#

(the same also applies to the flag you get for donating 40 pieces, its an exact == check)

rancid temple
#
this.Museum = (Game1.currentLocation as LibraryMuseum) ?? throw new InvalidOperationException("The museum donation menu must be used from within the museum.");
uncut viper
#

(and only in MuseumMenu)

rancid temple
#

I see what you mean, even Marnie's shop isn't that rude

uncut viper
#

yeah all of the MuseumMenu checks check the current map so

#

it kinda HAS to be in there without a lot of patchiung/reworking

#

apparently i did actually notice this when working on Custom Museum Framework bc i wrote iun >= instead and just forgot to ever bring it up lol

rancid temple
#

Lmao, this is why I don't like to sit on fixes for stuff, I will absolutely forget about it

uncut viper
#

tbf it wasnt a fix, i was writing a new GameLocation subclass and was already writing a whole lot of custom logic

#

so it was just one of those things i did slightly differently from LibraryMuseum.cs among many many other small things i did slightly differently

gaunt orbit
#

what's the proper way to check if the current Game1 is non-main splitscreen?

uncut viper
#

Context has a thing for that i think

#

Context.IsSplitScreen and Context.IsMainPlayer

gaunt orbit
#

actually wait I think Game1.options.gamepadcontrols will do what I want

#

maybe

#

yeah based on the decompile it looks like a combination of that and snappymenus

spice inlet
#

I'd recommend Context.ScreenId > 0

lethal crescent
#

in 1.6.9 have there been any changes on changing audio? i noticed my game crashes whenever i try to pet my cat and i made a mod that changes the meow of a cat, however other audio changes i did dont cause this issue

drowsy pewter
#

well do you have your crash log?

lethal crescent
#

where do i find the crash log?

velvet narwhal
#

!log

ocean sailBOT
#

Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.

Please share your SMAPI log file. To do so:

  1. Open this page: smapi.io/log.
  2. Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
  3. After uploading, it will show a green box with a URL to share. Post that URL here.

Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didnโ€™t occur in your last session, please load the game to the point where the issue occurs, then upload the log.

lethal crescent
#

thank you!

gaunt orbit
#

hmmmm the description for SButton.Select says it's a keyboard key, but I've never seen a select key on a keyboard. Does anyone know if it's actually a controller button? and if it's not, what on earth it's bound to?

tender bloom
#

Iโ€™ve seen one on old keyboard maybe??

lethal crescent
ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 11 Home, with 2 C# mods and 1 content packs.

calm nebula
gaunt orbit
#

huh! the more you know

calm nebula
#

Oh, IBM.

uncut viper
gaunt orbit
#

I'm gonna guess what I want is "ControllerBack"? despite the weird name

rancid temple
#

FWIW, if SMAPI crashes on me, it never logs anything about the crash itself

#

Just everything up until it happens

velvet narwhal
#

(the only time i've seen a crashless log it's the AVE thing, prior to uh, the other mod that actually crashed cp)

rancid temple
#

Aside from there being some kind of issue with me having not restarted my computer in a while, I almost never see SMAPI crash

lethal crescent
# calm nebula Can we see your code

here's the part where i change the cat meow audio

{
            "Action": "EditData",
            "Target": "Data/AudioChanges",
            "Entries": {
                
                "{{ModId}}_joltik": {
                    "ID": "cat",
                    "Category": "Sound",
                    "FilePaths": [ "{{AbsoluteFilePath: assets/audio/joltik.ogg}}" ],
                    "StreamedVorbis": true,
                    "Looped": false
                }
        }
rancid temple
#

Usually just a mod in SMAPI will crash and warn me that it might not be working

calm nebula
lethal crescent
#

all the other .ogg files work tho

calm nebula
#

Disable StreamerVorbis

rancid temple
#

ogg is kind of prone to issues isn't it?

calm nebula
#

In general you want StreamedVorbis for long audio cues

#

Ie, music

lethal crescent
#

kay

calm nebula
#

Do not use it for short sound effects (ie a meow)

lethal crescent
#

ill try those changes

rancid temple
#

(time to replace the cat meow with Nyan Cat music)

calm nebula
#

Someone else please make sure the wiki has this info pls SDVpufferheart

rancid temple
#

I'll let you know when the wiki loads sometime today

uncut viper
#

iirc it does

lethal crescent
#

turning off streamedvorbis fixed it :0 Thank you so much!

rancid temple
lethal crescent
#

odd that it worked up until this point

rancid temple
#

Yeah recommended but I guess it could be more strongly worded

uncut viper
#

there have been audio related changes in the patches

calm nebula
#

Yup

velvet narwhal
#

the transition to uhhhh OpenAL right?

lethal crescent
#

i see!

uncut viper
#

its not a guaranteed crash so i think the wording is fine, plus if you word it stronger you run into needing to define what "longer" means

rancid temple
#

Separate section talks about using ogg for larger files like music and wav for smaller sounds

#

(which I probably should have read before I started plopping minute long .wav music into a test mod)

lethal crescent
#

i thought it had something to do with the changes about pet data i saw in the wiki, since that also includes sounds, but there were no code examples so i couldnt wrap my had around it lol

calm nebula
#

You're a programmer

uncut viper
#

its not me i need the definition for

#

its the newer modders who will see it on the wiki and come in here to ask what the cut-off is and no one in here will be able to answer

rancid temple
#

(strongly recommended)

calm nebula
#

Ask yourself: is it likely that mendelevium-247 will decay in the time frame?

lucid iron
#

Is the cutoff like

#

Whatever openal feels like

rancid temple
#

The cutoff is probably vibes, honestly

velvet narwhal
#

i was gonna say, time to make some babbling .wav files of increasing lengths until it crashes on me

rancid temple
#

.ogg

velvet narwhal
#

oh ogg, ok

rancid temple
#

ogg is the weird one because it has to deal with file compression and streaming off your drive instead of being cached

uncut viper
#

but is it actually a strong recommendation, though? or is it a "technically its better but the actual impact is minimal most of the time"?
like, i know it crashed for them and changing that fixed it, but idk, i kinda feel like thats probably also a symptom of a different cause, because i feel like streaming a shorter length file shouldnt, just, instacrash the game. but im also just talking without any knowledge, so

#

if its a consistent "if you stream something shorter than x seconds it will crash" then i think that should be listed for sure, but is it really gonna do that every time or was this a weird fluke

rancid temple
#

Yeah, I mean the fact that it is on the wiki at all is probably fine, there's a lot that comes here that we have to explain further anyways

#

Would need to test further to know for sure if it's consistent or not

#

Could also be specific to their computer set up

#

Maybe it depends on what kind of device it's streaming off of

#

There are too many factors in computers to be 100% sure

calm nebula
#

The tl;dr is music goes to ogg and StreamedVorbis

#

sound effects, ESPECIALLY SOUNDS EFFECTS PLAYED MULTIPLE TIMES go to wav

velvet narwhal
#

(did that "too many ogg" error get fixed in the recent hotfix?)

calm nebula
#

that's an ask-myuu

uncut viper
#

that was fixed

#

i just wouldnt wanna get into a similar situation like "dont overuse LogLevel.Alert bc of alert fatigue" where if things are strongly recommended when they really work fine even if not followed 99% of the time too much people might underestimate when something is actually strongly recommended
but this is just one girls onion. im no wiki maintainer

atomic vale
#

do cp mods that are adding a rescipe to a machine automatically overide any data in vanilla for that machine?

rancid temple
#

If you do it wrong

uncut viper
#

if you use Alert too much for things that dont need to be Alerts then people start ignoring Alerts

calm nebula
#

Almost no one uses Alert except for smapi update checks and for debugging lol

uncut viper
#

yes thats the point

lucid iron
#

is Alert the purple one

uncut viper
#

yaya

#

purple by default anyway

lucid iron
#

ah yea ive only seen it used in smapi update check and graveyards lol

pine elbow
#

Does anyone know what folder contains the dialogue portrait frame/background?

uncut viper
#

pretty sure thats a cursors

velvet narwhal
#

tiny little box cause code stretches it

uncut viper
#

which i think is LooseSprites

#

not the portrait frame

velvet narwhal
#

oh

#

oh right they're drawn separately SDVpufferflat

uncut viper
#

its in the top-ish right of LooseSprites/cursors.png

#

the relationship indicator isnt part of it though

#

its somewhere else

#

somewhere else in cursors i mean. dunno where

wheat finch
pine elbow
velvet narwhal
#

need another entry key, you have one that's "Furniture", which you should probably make unique

rancid temple
#

You want your entry key to be unique for the list, usually making it the same as the ID you're putting there is the convention

wheat finch
#

I'm just adding vanilla furniture that normally can't be bought with gold. But I think I sorted it.

tender bloom
#

Here's an example snippet you can reference

velvet narwhal
#

i am now curious as to where the palpitating ball is for the relationship thing

wheat finch
wheat finch
velvet narwhal
#

ah it's the base one

tender bloom
#

this seems a bit more plausible

#

Changed the When condition because it looks like you were trying to use a GSQ?

rancid temple
#

Shop item entries themselves have a condition field that you could use a GSQ for

wheat finch
#

TY. I made these mods with STF and am converting to CP for the stability. Still learning all the nuance of when conditions v. gsqs and such.

next plaza
#

Oh, I need to do that GMCM API fix

brittle pasture
#

simplified: When conditions outside of Entries are Content Patcher's thing. "Condition" lines inside an Entries block are GSQ's

next plaza
#

@teal bridge Here's a build with the API behavior for OpenModMenu reverted (and a new method for the child menu behavior). Would you mind testing to see if it works as you'd like? I don't have any mods that use that API method.

(No worries if not, if you're not interested in testing I can just release it as is)

brave fable
#

love of cooking alpha uses openmodmenu from a button in the cooking menu to go to the gmcm loc page, should i give this a look or

next plaza
#

Possibly yeah. In 1.14.0 it started setting the new menu as a child menu of any active menu instead

brave fable
#

huuh i should really look at a loc release now i think about it lol

next plaza
#

So this build reverts to the old replace the whole menu approach, with a new method for the child menu thing

brave fable
#

what was the reason for the change (and the revert)?

next plaza
#

I ultimately made the change originally because GMCM now largely functions based on child menus outside of the title menu implementation. What inspired this change was the trigger action action I added for opening a mod's config menu - I added this so you can open a config menu from a SpaceCore guidebook, but it felt better to have it as a child menu instead of a replacer so that closing the config menu brought you back to the guidebook. And it also felt like it made more sense to me in general. (I don't recall child menus existing when GMCM was made - or at least, I didn't know about them.)

Once I released that update focustense ran into some backwards compat issues: <#making-mods-general message> So this change should make the old code work fine, and it people prefer the child menu behavior they can use the new method

#

I'm not entirely sure just reverting the behavior of the API method will be enough for focustense's use case though, hence why I would like some testing

#

Wow, Pathos's message disappeared before I could click on the link ๐Ÿ˜ข

ivory plume
#

(I was going to repost it when the current discussion is done.)

brave fable
#

clearly not just experimental, but highly volatile

next plaza
#

smh Pathos you don't want it to get buried?

brave fable
#

i think the child menu behaviour is perfectly good, obviously people will have different use cases so having it optional is good. i don't think i had any particular expectations in mind when i added the go-to-config button to the cooking menu though, so as long as it works i'm happy

next plaza
#

Clearly you just need to pin it - because everyone reads the pins regularly, riiiight?

brave fable
#

i'll quickly pop open sdv and see if the gmcm changes work alright

ivory plume
#

(Normally I'd just let it get buried, but I think reinventing how the mod compatibility list works is probably a big enough topic that we don't want it buried.)

wheat finch
#

Not enough changed with special orders (if anything?) in 1.6 that I need to worry about tweaking the special orders in my mods to make them compatible? They were already added by CP and I don't see anything about special orders in the migration guide beyond some of the descriptor text for new changes or being able to add a special order via mail.

next plaza
#

There's also the event command for adding or removing a special order now

wheat finch
#

But if I just want it to be added to the special order board rotation I don't need the event command right?

next plaza
#

Correct

brave fable
#

do i need to update my gmcm api file for the new update?

wheat finch
#

TY. Realizing as I look at this mod I should have built when conditions into all sorts of things lol. As it stands, the player could get special orders from Sandy before they've even met her. hahahaha.

next plaza
brave fable
#

oh, they're separate methods, not a param?

next plaza
#

Yeah

calm nebula
#

You can't really do new optional params with pintail

#

Add that to the list of todos of atra-of-two-years ago

#

I think it's technically doable but like

next plaza
#

smh why isn't atra taking care of every problem in the modding community

calm nebula
#

Because atra is old and tired these days

brave fable
#

seems to open and close just fine with the old method

#

any specific issues you wanted looking out for?

next plaza
#

Nah, opening and closing was all

lucid iron
#

so this would be case where i want to put entirely custom menu into GMCM

#

like what a fishing sea did through crimes

calm nebula
#

Anyways

#

I wanna see the stats

teal bridge
calm nebula
#

So everyone shut up

teal bridge
#

Otherwise, I suppose I can try to play around with GMCM's source myself and try to narrow it down further.

rigid oriole
#

Came back from not touching my mods for a while and you're telling me my mod with ONE harmony patch broke in 1.6.9 ๐Ÿ˜” unlucky

teal bridge
#

(fwiw, I'm confused that we are talking about reverting an API method here, since the method that changed was never exposed to the API... it's accessed with reflection)

next plaza
#

Where are you calling the API method from?

#

Wait, your original message mentions callign OpenListMenu which isn't in the API

#

Hmm

teal bridge
#

So when you mentioned reverting, I figured you were going to have a version of OpenListMenu that did the old thing, tied to an API method that also did the old thing.

next plaza
#

Ah, that explains it. It's still using the new method

teal bridge
#

But ultimately it comes down to how ActiveMenu (or whatever it's called, I forget) is implemented

next plaza
#

I assumed you were using the API only for that part

#

I have a OpenListMenu and OpenListMenuLegacy now, I'll just rename them so that OpenListMenu is the old impl instead

teal bridge
#

Ah, ok, if it's an easy change then sgtm. I think I did mention at the time that it was messing with GMCM's internals and not going through the API, but maybe I was too flippant and it sounded like I was describing something else.

next plaza
#

You did, I just didn't realize you meant that part too

#

Although.... hmm

#

Calling the old implementation would affect how all subsequent menus are opened SDVPufferThink

teal bridge
#

If it's an issue, I can switch AFS to call the legacy method instead; it's due for an update anyway once I finish with the StardewUI milestone.

next plaza
#

Well, in the build I just posted, I renamed the legacy method to the original name and made the new implementation with a different name

teal bridge
#

Right, I will try that in a moment, though it sounded like you were reluctant to keep the change you just made.

next plaza
#

Ah, no. I'm worried about, even with the other method names, calling the legacy implementation might act a little odd, especially if multiple mods are doing what I think you're doing. Like

  • You open mod A normally. It does custom menu stuff instead.
  • You close mod A and go back to the main list - GMCM is now operating in legacy mode as far as opening the menus is concerned.
  • You open mod B, which also does custom menu stuff. Something might go wrong because it expected the menus to be operating a certain way, but no longer is
#

It might not be an issue, just something that crossed my mind

teal bridge
#

Oh, I didn't realize it was "modal" like that.

#

The underlying issue here is that I can't just set TitleMenu.subMenu to null because of how GMCM does its own reflection thing to override the title menu's state and makes it think it's not loaded. And the legacy version of OpenListMenu has the requisite logic to recover the loaded state.

#

Possibly the workaround could be limited to title menu scenarios, then? Does the guidebook/nested list menu stuff need to operate from title menu?

next plaza
#

Not sure what you mean by the "modal" thing.

I guess I could make it where only the initial opening is affected by the legacy method, and subsequent things GMCM does still use the new method. That might make more sense...

teal bridge
#

All that's really going on here is that GMCM opens (through Harmony patching, yes) some menu that is not a SpecificModConfigMenu and therefore doesn't have full access to GMCM's internals. So that menu "B" just needs a way to say "I'm done, take me back to GMCM's main menu in whatever state it was in".

#

What's fragile about the ActiveMenu thing is that it does an explicit type check for SpecificModConfigMenu and won't recognize any other menu type; if both menus could announce that they are going "back" to the list instead of having that static property rely on the type of the menu (e.g. through some API method maybe?), that would solve it for AFS and any future mod as well.

#

Actually, I don't see this check in the setter anymore, how does SpecificModConfigMenu even return to the list menu now?

next plaza
#

SpecificModConfigMenu takes in an Action that handles turning to the list. (I believe Pathos refactored it to be that way back when he was maintaining it)

teal bridge
#

Yeah, I think that hasn't changed. I'm not even sure what the issue is now... that is, not sure why it happens with this menu and not all settings menus.

next plaza
#

Are you having this issue on the title menu GMCM, in-game, or both?

teal bridge
#

The returnToList callback is a delegate for OpenListMenu which is what I'm calling.

#

So this issue is for both title and in-game. The original issue, the reason for using OpenListMenu the way it does, is specific to the title menu. But this issue is easily repro at any point the menu tries to return to GMCM.

next plaza
#

Hmm

teal bridge
#

Oh, the new ReturnToList sets Mod.ActiveConfigMenu = null when not done from title?

next plaza
#

Yeah, which just clears out the most recent child menu.

I sorta hacked in the child menu stuff into the ActiveConfigMenu, probably should refactor it

teal bridge
#

Ok, I just confirmed, this bug actually only happens when not on the title menu.

#

And it's probably because of what I just mentioned, OpenListMenu is not the correct thing to do in that case.

next plaza
#

Hmm, and the issue is the list menu being a child menu of itself?

teal bridge
#

The list menu makes itself a child of the menu that opens it, i.e. the AFS config.

next plaza
#

Ah

teal bridge
#

What is the mechanism by which setting Mod.ActiveConfigMenu = null causes the game to return to GMCM's main menu while the game is running?

next plaza
#

When you set ActiveConfigMenu to null in-game, it will clear out the most recent child menu (or the main menu if it's the root Game1.activeClickableMenu)

#

However, if you set it to a specific value, it just adds it as a new child menu

#

Like I said, it's very hacky

teal bridge
#

So SpecificModConfigMenu now opens as a child menu of the list menu, instead of replacing Game1.activeClickableMenu?

next plaza
#

Yes

#

(Except on the title screen of course, because that didn't work properly)

#

I really should've approached the whole wanting a child menu thing very differently looking back

long jungle
#

Hello! Does anyone know if it's possible to modify the stats of monsters from SVE and RSV using Content Patcher?

If not, what are possible alternatives to modify them?

teal bridge
#

Ok, I think there might be a way to work around this, if I make AFS a child menu of GMCM also - basically if I change the reflection code to use ActiveConfigMenu instead of OpenListMenu.

#

I'll have to see if it actually behaves correctly as a child menu, not sure if the list menu intercepts any events or does anything else weird.

next plaza
#

It shouldn't - it handles all input on Update, which isn't called for any menu except the one "on top"

teal bridge
#

Hopefully you're right and the receiveXyz methods behave the same way

next plaza
long jungle
#

That saved me a lot of time on reading around.

teal bridge
#

Alright, my multitasking ability tops out at 2-3 concurrent tasks and I'm now trying to do about 6, so I'll catch up on the AFS/GMCM business a little later - Pathos, if you're still there and waiting for a lull, here it is.

#

(Guess he decided to take a coffee break instead of hanging around)

brave fable
#

should the game clear hud messages after each day? weird plowing through days for debugging and seeing them linger

lethal wadi
#

How,, hard is it to make a custom farm map? I kind of want to experiment in making one but I have no experience in making any mod whatsoever

brave fable
#

everything's hard when you have no experience whatsoever SDVpufferthumbsup once you learn the ins-and-outs of the programs though, it's all really very simple and just up to your creativity

#

!mapmaking

ocean sailBOT
#

If you want to make mods that add or edit maps:

  1. Use Tiled to edit .tmx or .tbin files.

  2. Refer to the Maps wiki page for details on how maps work in Stardew Valley.

  3. Content Patcher allows you to create custom locations through editing Data/Locations

  4. Vanilla Maps can be edited via Content Patcher as well: EditMap

brave fable
#

as the docs say, it's best to decompile the game assets first with stardewxnbhack, and then poke around in the game maps with Tiled

#

after scribbling and ruining those for a while, you can look at remaking them as you like for your own map SDVpufferthumbsup

teal bridge
lucid comet
#

so. i've been working on some nice and simple ui recolors/customizations aaaaaand just learned that most of the dialogue box border comes from four lines of single pixels getting repeated (one each for left, right, top and bottom), not multiple blocks each ._.

#

not lookin for a solution here, since i am aware thats c#, just ... need to share my ruined plans somewhere while contemplating if this is worth setting up a whole environment and dusting off my c# skills >.>

brave fable
#

also funny having the console gradually fill up with ```
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus

as you sleep through the days
wheat finch
#

mmm...I'm sure I'm doing this wrong. Moved on to the next mod on the list and now I need to add one cooking recipe to Gus's shop at the saloon. This is within the changes block but only copying the relevant bit. I feel like this is going to add the cooked dish not the recipe. Recipes don't have a numerical key in the raw data (unpacked content) while the output does so maybe this will work?{ "LogName": "Add cooking recipes from island trader to Gus' shop at the saloon.", "Action": "EditData", "Target": "Data/Shops", "TargetField": [ "Saloon", "Items" ], "When": { "HasFlag": "willyBoatFixed", "Season": "Summer" }, "Entries": { "Banana Pudding": { "ItemId": "Banana Pudding", "Price": 1500, "ApplyProfitMargins": false, "AvailableStock": 1 } } }

#

I'm staring at the page for modding shop data and not seeing anywhere to specify this is a recipe to add not an object.

brave fable
#

simply add "IsRecipe": true, to your entry

wheat finch
#

TY. I had that in the STF version of this mod but wasn't sure if that was STF specific or not

brave fable
#

saloon example:```json
{
"Price": 100,
"Id": "(O)195 (Recipe)",
"ItemId": "(O)195",
"IsRecipe": true
}

#

where (o)195 is the omelette

ivory plume
#

The wiki compatibility list is now right under the max complexity the wiki can render on a single page. At this point, most edits to the page time out and editing it is enough to slow down the entire server.

So, here's an experimental Git compatibility list to replace it. This combines all the data into one place (e.g. data overrides with the mod data), uses relevant data type (e.g. numbers for mod IDs), and adds a validated JSON schema for the data format.

It's not as easy for anyone to edit, but we do get benefits like automatic validation for those edits. (And I've always been a bit uneasy about anyone being able to instantly edit the compatibility list, since that can trigger update alerts to get players to install a mod from a custom URL.)

rancid musk
#

I like the idea of having all the data in a GitHub repository. I'm not sure having all the data in a single file is a good idea though.

old edge
#

Fixed it๐Ÿ› ๏ธ

lucid iron
#

do u have to do all the merging or will u give perm to some group of helpers too

#

like say all the junimos in this server

ivory plume
#

I'd probably give commit/merge access to any known mod authors who are interested in helping maintain it.

rancid musk
#

And yeah, giving some trusted people permission to handle PRs would probably be good for this, if not setting up a bot with some automated checks to help.

ivory plume
#

Re splitting the file, I mainly want to avoid arbitrary divisions where people will add entries to the wrong file, or we need to commonly cut & paste entries between files (e.g. because a mod changed its name).

#

(Plus there's a tradeoff, since multiple files mean the update-check server will need to fetch each file individually every 10 minute and merge them locally.)

lucid iron
#

what if you load it into a sqlite db

rancid musk
#

You can use a GitHub Action to compile them into a single file and just download that.

wheat finch
lucid iron
#

in another thing i was involved in, we had a msql crud setup

#

the data there was mostly automated but sometimes incorrectly parsed so gotta manually fix via the crud

rancid musk
#

I know it's not quite the same purpose, but the Dalamud (FFXIV client mods) team uses a GitHub repository for managing their official plugin list. Every distinct add-on has its own file(s), and that seems to work quite well.

You just do a PR to update your add-on's file when relevant, and their CI handles everything.

#

In my experience, GitHub works better with many small files than with one large one. The blame tool, for example, breaks down for particularly large files.

#

And with separate files for each mod, you'd have a more useful history.

#

That isn't necessarily important, admittedly.

ivory plume
#

Splitting per mod could be messy, since the line between mods can be fuzzy (e.g. sub-mods popping in and out of existence, mods getting merged into or split from another mod, mods getting reposted/forked, etc. And validating a JSON schema for 2000+ JSON files and re-merging them on each commit sounds a bit slow.

But we can certainly look into some sort of split between all-in-one-file and one-per-file. I need to update all the surrounding tools and finish updating the compatibility list though, so I'll keep it at one file to start with so I can get back to the 1.6.9 compatibility list updating.

rancid musk
#

I could mess with it a bit if you're interested in seeing what it looks like.

lucid iron
#

could we do it per author maybe

#

or author team

teal bridge
#

@next plaza I think I've sorted out a solution that doesn't require any workarounds on your side - more or less copying what the updated version of the returnToList callback does using reflection.

By the way, I noticed a bug with the released version, not sure if you fixed it already, but if I open up GMCM while in game and go to a mod menu, GMCM keeps drawing tooltips behind the specific mod menu. This is not just AFS, it's every mod.

ivory plume
#

Mods get transferred around too though.

rancid musk
#

My thought would be to use a mod's unique id for the file structure.

ivory plume
#

(I wish the unique ID was static and unique, but that often changes over time too.)

lucid iron
#

nexus id blobcatgooglyblep

rancid musk
#

Not all mods have nexus ids.

lucid iron
#

yea

rancid musk
#

And there are some mods where several mods share the same nexus id.

#

I know the unique id can change, but there's no reason you can't just rename the file at that point I would think

ivory plume
#

Technically yes from a Git perspective, but it becomes a bit tedious to update hundreds of mods if it also involves renaming and editing hundreds of files, instead of just a quick CTRL + F in a JSON file.

#

(Though with a proper JSON format, hopefully that can be automated more in the future.)

rancid musk
#

... are you expecting hundreds of mods to change their unique ids? SDVpufferfear

calm nebula
#

like

#

a bot downloads a mod, launches the game + smapi + that mod, and see if smapi loads it

rancid musk
#

Yeah, having lots of files ultimately shouldn't matter since we can just write some tools going forward.

#

Processing one big file or lots of little files isn't significantly different for automation.

calm nebula
#

sleeps for 20 minutes, tries the next mod

ivory plume
#

I'd expect something like 100-200 mod changes per month (new mods, abandoned mods, broken mods updated, mod info like the name or ID changed, etc).

calm nebula
#

(20 minutes was a random guess but I'm surprisingly close

teal bridge
#

That's assuming you don't get another aedenthorn posting another mod every day.

calm nebula
#

there's plenty of other things like, say, Modder X deciding to rename all their mods

ivory plume
# calm nebula a bot downloads a mod, launches the game + smapi + that mod, and see if smapi lo...

Yep, the compatibility list updates I'm doing are semi-automated. I have a tool which fetches the compatibility list, crossreferences the other sources like the mod dump, installs every known compatible mod, validates dependencies, etc. The simplest compatibility checks (i.e. does SMAPI load it) are easy, but Harmony mods have an annoying habit of throwing runtime exceptions that need to be individually evaluated to see if they're actually incompatible or just have a minor bug.

teal bridge
#

Modder X is a jerk.

calm nebula
#

...that's not an emoji?

tight rivet
# old edge Fixed it๐Ÿ› ๏ธ

That helps, although I found the second issue, and it is a SDV? or CP issue: If you tag your item as a gem or mineral, it shows up in the collection page. But if you also then use the tag to make it not donateable to the museum, you can never donate it, so it'll be an eternal silhouette on the page.

uncut viper
#

lumina pinged pathos about that same thing earlier

tight rivet
#

hah. That makes sense, because it was playing VMV that I discovered that.

uncut viper
#

it doesnt actually affect perfection or achievements

#

it only affects the collections page

tight rivet
#

(and then found out I was looking at the wrong source code!)

ivory plume
#

(I'll be back on game fixes in a few days, trying to finish the 1.6.9 compatibility list update first or die trying.)

teal bridge
#

By the way Khloe... not sure if you're aware, but on the latest VS tool chain your ModManifestBuilder raises warnings about a security vulnerability due to a very very indirect dependency on an ancient version of System.Drawing.Common.
It's... not really very important, being a build tool and all, but I think you can get rid of it by updating a few dependent packages.

next plaza
calm nebula
tight rivet
#

In any case, I think moving to git is a good idea to solve the complexity limit

#

(Also, I have now had the joy of seeing SDV swallow nearly 10000 MB of RAM.)

next plaza
rancid musk
#

the heck are you growing on your farm

next plaza
#

Mass chaos

brave fable
#

(sheep, apparently)

tight rivet
#

Not much, but at 143 mods with SVE being one, SDV is uh.. swallowing RAM up

teal bridge
#

That sounds like a leak.

calm nebula
#

okay, xtile is like. shit at memory

#

but like

tight rivet
#

It most likely is, since it hangs at random times.

uncut viper
#

143 is definitely not a lot

calm nebula
#

stardew 1.5.6 with SVE and 200 + other mods on an endgame save was between 2-3GB ram

#

that saidI

tight rivet
#

hm ๐Ÿค”

calm nebula
#

I do feel a leak is likely

teal bridge
#

(And a textbook case for how GC doesn't solve all memory problems magically, despite the protestations of certain individuals)

lucid comet
tight rivet
#

hm. I've been running this for..

calm nebula
#

yeah, I've noticed that Frontier Farm, for example, seems to be reloading much more often than its CP patches should indicate

#

which feels like some sort of...hmm

tight rivet
#

which is the one I'm using, yeah

calm nebula
#

I know that map reloads currently leak a little memory ๐Ÿ˜›

#

by that I mean, there's a cache that doesn't get emptied right

teal bridge
#

Getting to 10 GB by maps alone seems unlikely.

#

The maps just aren't that big, even if the entire maps were being kept in memory.

#

This is something reallocating like, every frame.

calm nebula
#

Anyways, I've been poking at the game's rng

calm nebula
#

it's stupid

#

it's bad.

#

it's obnoxious

teal bridge
#

Yes, but not 10 GB bad.

tight rivet
#

Right now it's.. 6.9GB at 5:51 running

#

(it took me some time to dig up the powershell code to get runtime)

calm nebula
#

is that five hours and 51 minutes

#

or 5 minutes and 51 seconds

tight rivet
#

five hours

teal bridge
#

Anywhere between 3-5 GB could be normal with a lot of mods. Double that is suspicious.

calm nebula
#

anyways

#

ask task manager to do a memory dump lo;

tight rivet
#

.. I am actually tempted. Might as well.

teal bridge
#

Wouldn't the VS profiler be more helpful here?

tight rivet
#

...

#

Wooof

#

doign so caused the memory consumed to go up by 2 GB.

rancid musk
#

Gotta... uh... spend memory to make memory?

calm nebula
#

you know, this entire time I thought xoroshiro was some japanese dude

old edge
#

Ok so yeah I had a dummy mineral items before I changed it to the vanilla category for minerals. Now it shows on collection page? But you say you still cannot donate item? Hmm I guess the only other way is to add it to the list with code right?

teal bridge
#

No you didn't, I remember months ago when I was talking about Xoshiro RNG and you made a point of informing me that it's never used in Stardew because Stardew is only seeded random.

#

(You're not the only one with a long memory)

calm nebula
#

no, I knew it was an algorithm, I just thought was some dude's name

tight rivet
#

I wonder..

teal bridge
#

Oh. You didn't know it was based on xorshift?

#

I guess that's what happens when you try to invent clever names, no one knows what you're talking about.

calm nebula
#

like, I knew xors and shifts were involved, I've looked at the algorithm, it just didn't click that "xoroshiro" was...not a name

#

I read that and was like "okay, the algorithm made by xoroshiro, makes sense, moving on" and didn't thinka bou tit

teal bridge
#

Well, that's partly because "xoroshiro" isn't the name, it's "xoshiro".

rain basalt
#

was looking at this on the modding maps properties and was just wondering SpawnMountainFarmOreRect <tile X> <tile Y> <tile width> <tile height> is it : " 10 9 3 4" or "10 X, 9 Y, 3 width, 4 height" or another way?

tiny zealot
royal stump
rain basalt
#

thanks

brave fable
#

is a half-second first-time init considered bad for a mod? just taking a glance in profiler for fun and noticing most of my mods are around 100ms, but the bigger ones are closer to 500ms

tight rivet
#

... yeah, I found the cause. There's a leak overnight of ~500MB. Somewhere.

brave fable
#

it all looks pretty tame relative to mail framework mod sitting at 4.5 seconds though

tight rivet
#

And now I need to wait for SDV to crash so I can restart it..

teal bridge
#

I spent a few days optimizing a 275ms frame down to about 110ms. But there are modders out there quite happy with 12-second load times.

calm nebula
#

Just for you I'll put in time.sleep(120)

teal bridge
#

Sometimes a long load time isn't entirely your fault either, it can be asset loading shenanigans.

royal stump
#

(I used to waste roughly that long per game day, if anyone spawned stuff in town-sized maps SDVpufferlurk)

tight rivet
#

Hm. Reloading the game drops it to amuch more reasonable 3.1GB

teal bridge
#

(Emphasis on sometimes, don't just assume that please)

tight rivet
#

Still has a very suspicious hang during loading

shadow pagoda
#

I'm trying to see if the player has a certain item, and if so how much of it in their inventory. I found the GameStateQuery.CheckConditions method which does give me a range of the number of items the user has in their inventory, but it seems the only way to check the exact amount is to call the method multiple times. Like so

GameStateQuery.CheckConditions("PLAYER_HAS_ITEM Current 472 1 1");
GameStateQuery.CheckConditions("PLAYER_HAS_ITEM Current 472 2 2");
GameStateQuery.CheckConditions("PLAYER_HAS_ITEM Current 472 3 3");

I could improve this by doing a binary search, but I wanted to know if there was a better way. Additional related question: is there a way to get all the chests in the game, and their content? I'm looking to do something like the fair helper, but in game https://mouseypounds.github.io/stardew-fair-helper/

tight rivet
#

but I suspect that's becuase SVE...

#

(i.e "mass asset load")

teal bridge
tight rivet
#

It normally doesn't go unresponsibe for me, but I usually stick to sub 100 mods, admittedly.

brave fable
#

love of cooking has a 600ms startup time, since it's loading assets and interfaces, registering queries, commands, events, menus, skills, serialiser types, and tokens, reflecting translations, applying harmony patches, ...

teal bridge
#

^ a good amount of that can possibly be done in parallel.

brave fable
#

other than cutting out the reflection (my beloved) i doubt i could reduce that much other than distributing it through other game events

teal bridge
#

Something to keep in mind is that since you're initially running on the main thread, you can branch off to any number of async tasks you want as long as they don't conflict with each other. You don't have to worry about them conflicting with vanilla or with other mods as long as you ensure they're all completed by the end of your entry method or other event handler.

#

Obviously you can't do certain things like load textures on a thread. But other things, you can.

tiny zealot
brave fable
#

i wasn't aware people actually threaded their mod setup

teal bridge
#

I don't think many people do, just saying you can.

#

Calling it "threading" makes it sound more complicated than it is, it's just Parallel.ForEach and stuff.

#

(But don't do that with asset loading)

tiny zealot
#

you can thread as long as you aren't loading assets. i had a thread setup for loading .ogg files back in 1.5.6 (they were added directly to the sound bank, so they didn't go through the pipeline)

calm nebula
#

The bulk of that time is likely harmony tbh

#

Harmony also takes a while

brave fable
#

i can believe that, even Gift Wrapper and Greenhouse Entry Begone have a 100ms+ load time and one of those is just a glorified harmony patch

#

(but it also fucks with assets later)

teal bridge
#

Harmony probably has to run on the main thread, but even there, you can parallelize or background certain things, like getting the MethodInfo and PropertyInfo and such that need to be patched. Maybe not worth it for just a couple of patches, but I'd say it's worth a trace or two if you're actually halfway concerned about load times.

calm nebula
#

at one point of time I tried to run harmony off the main thread and mod integrations (ie pintail) on the main thread

#

but it wasn't worth jack

teal bridge
#

Pintail is actually probably a huge sink since it's doing IL emit.

calm nebula
#

yup, but the differential was like

#

100ms harmony, 3ms pintail

brave fable
#
Parallel.Invoke(
    // Game state queries
    () => Queries.RegisterAll(),
    // Harmony patches
    () => HarmonyPatches.HarmonyPatches.Patch(id: this.ModManifest.UniqueID),
    // Game events
    () => this.RegisterEvents(),
    // Reflection
    () => Utils.CopyTranslations(from: ModEntry.ContentModUniqueID, to: this.ModManifest.UniqueID),
    // Console commands
    () => this.AddConsoleCommands(),
    // Mod APIs
    () => Interfaces.Load()
);
// Assets and definitions
this.ReloadAssets();
// Cooking skill
ModEntry.CookingSkillApi = new CookingSkillAPI(this.Helper.Reflection);
SpaceCore.Skills.RegisterSkill(new CookingSkill());

so you think this could shave off a couple ms if it works SDVpufferthinkblob

calm nebula
#

AND it would deadlock randomly

teal bridge
#

Haha, well that's not good.

lucid iron
#

wow what is this

brave fable
#

grasping at seconds as they fly past me into the void of the past

teal bridge
calm nebula
#

anyways

teal bridge
#

Atra's also correct that if your breakdown includes one task that's vastly longer than all the others, then you can't optimize any further unless you can parallelize that specific slow task.

calm nebula
#

I wonder how hard it would be to take stardew prng and like

#

hack it into some semblance of not weird.

teal bridge
#

"some semblance of not weird" isn't exactly a clear goal.

#

Most of SDV's randomness makes a lot of sense, even if it's sometimes implemented in a clumsy hardcoded way. In other game engines you'd have "derived entropy" as opposed to hardcoded stuff like "day-save random" but it's the same principle. True randomness is reserved for things that aren't relevant for save-scumming, like animations.

calm nebula
#

yup, but then you get like, 40 day dry periods

teal bridge
#

(and fish, sigh)

#

Ah, so you want a more uniform distribution (like Poisson), which is subtly different from randomness.

calm nebula
#

I would like to get above the W/W for expected runs, not way below

#

we'll start there

teal bridge
#

And W/W is...?

shadow pagoda
calm nebula
#

Wald-Wolfowitz

tight rivet
#

Could you export this dark magic to other farming sims? :V

#

stares at Coral Island

teal bridge
#

Oh. But for what? Randomness applies to specific things in game, not the entire RNG.

calm nebula
#

right now? I'd be happy if rainy days had the W/W predicted number of runs

teal bridge
#

You mentioned rain, and that's not even random in the conventional way, it's based on weird shit like step counts.

calm nebula
#

that's what I'm focused on

brave fable
#

ah, very good. parallelising that handful of methods has brought the load time down from 640ms to 680ms ๐Ÿ˜Œ

calm nebula
#

that was the case in 1.5.6 which was fine it's not the case in 1.6 which is what has caused this issue

tight rivet
#

Impressive!

teal bridge
lucid iron
#

Which of the tasks is heaviest blobcatgooglyblep

rain basalt
#

so have it on map like this and have type as dirt but still cant get any spawns can anyone think of what im missing?

teal bridge
#

If it's HarmonyPatches.Patch, you might see if you can parallelize that specifically, run a task for each patch, assuming it doesn't deadlock or break.

brave fable
#

probably the dozen harmony patches including like 3 transpilers

#

sure, i'll try it

calm nebula
#

you can't paralleize harmony

#

that's like.

brave fable
#

sure, i won't try it

calm nebula
#

known there's a lock

lucid iron
#

Hm what is copytranslations about

teal bridge
#

Haha... yeah I figured it was iffy, Harmony being what it is.

brave fable
#

copytranslations is phat reflection

teal bridge
#

But, look, just stick a Stopwatch on the sequence of tasks and measure each one. See what the individual tasks take, before guessing at a solution.

uncut viper
#

well that reflection could be one place to start optimizing

calm nebula
#

because, well

#

runs aren't fun

lucid iron
#

Do you have ur own non i18n translation thing going on

calm nebula
#

but.

teal bridge
brave fable
#

it's reflecting score/smod to take translations from the CP mod to use in the C# mod

#

pretty awful, we had a discussion about this just yesterday

uncut viper
#

i left that discussion still unsure of the decision making process there

teal bridge
#

Are you using reflection invoke each time instead of creating delegates?

lucid iron
#

Ah so ur own cmct

calm nebula
#

but for a normal player, well, by the time they get to the third

calm nebula
#

just grab the other mod's translations by stealing their translation helper

lucid iron
#

But if it's ur cp mod why don't u just use Strings/

tender bloom
uncut viper
#

you can just load it to your own asset...

calm nebula
#

like for a video game, if you open ten chests in a row and it's the same thing

calm nebula
#

the step count is at least one additional source of entropy

tender bloom
#

agree

#

just amused that it's an unusual random

#

it's a bit like clock time

uncut viper
#
"Target": "ModId/Translations",
"FromFile": "i18n/default.json"

you can just do this

brave fable
lucid iron
#

Wouldn't that be just default button

uncut viper
#

thats just to get the idea across

brave fable
#

please understand every mod i have uses a different translation setup

#

usually more stupid than the last

lucid iron
#

Adventurous

uncut viper
#
{
  "Action": "Load",
  "FromFile": "{{FirstValidFile: i18n/{{language}}/{{Lowercase:{{TargetWithoutPath}}}}.json, i18n/default/{{Lowercase:{{TargetWithoutPath}}}}.json }}",
  "Target": "Mods/{{ModId}}/Translations/{{language}}/Books, Mods/{{ModId}}/Translations/{{language}}/Config, Mods/{{ModId}}/Translations/{{language}}/Debug, Mods/{{ModId}}/Translations/{{language}}/Dialogue, Mods/{{ModId}}/Translations/{{language}}/Mail"
},

this is what BEB does

brave fable
#

beb...

lucid iron
#

I make it a goal to write less text in each mod

calm nebula
#

beb?

#

babe

uncut viper
#

buttons extra books

#

it was cleaner before i moved to i18n subfolders

#

it also loads the default as a fallback. i just handle things OnLocaleChanged if necessary

brave fable
#

my other mod uses```json
{
"Action": "Load",
"Target": "{{PATH}}/Strings/Strings",
"FromFile": "{{FirstValidFile: i18n/{{language}}.json, i18n/default.json }}"
}

uncut viper
#

thats pretty much what i had before subfolders too yeah

teal bridge
#

Anyway, pointless speculating, just Stopwatch it

brave fable
uncut viper
#

h

brave fable
#

absolutely

uncut viper
#

"This allows us to share a single group of i18n files between all mod components."
i have to respect the confidence here. yes. this is what allows us to do this.

#

just this.

brave fable
#

yeah i had to put my 'pushing the world's worst PR past my manager' hat on for that comment

calm nebula
#

why not just reflect for your other mod's translation helper?

uncut viper
#

i mean this lightheartedly and with the awe and respect of someone else who loves reflecting to do some bullshit, but this is maybe one of the worst ways i couldve thought to do this i think

brave fable
#

100%

#

it does work tho

teal bridge
#

Notwithstanding the glaring design issues, it doesn't look that suspect for performance.

brave fable
#

of course, feel free to suggest a better solution. i fucking hate this mod

#

the less time i have to look at it the better

uncut viper
#

ive got a suggestion

#

i think you should remove the Parallel.Invoke

#

i think you'll shave off 40ms with that change

brave fable
#

-40ms actually

uncut viper
#

oh my bad sorry

calm nebula
#

I mean you can remove the Invoke and save 680ms and also get nothign done

lucid iron
#

I can't seem to get info about mod dependencies from nexus api

uncut viper
#

no more spooky server...

brave fable
#

stopwatch marks // evil plans at 20ms, and harmony at 644ms

#

so unless i can speed up harmony that's all

uncut viper
#

what do your harmony patches look like, are you reflecting for every single methodinfo

brave fable
uncut viper
lucid iron
#

Surely vortex needs to know about dependencies right

uncut viper
#

atra you'd know this better than i would, is RuntimeReflectionExtensions.GetMethodInfo significantly better than AccessTools.Method or are they the same or is the former actually worse

#

didnt you mention one time something about rewriting the harmony guide to use it or something

#

i feel like you're the one i got it from but i could be mistaken

#

blueberry what if you replace one of those AccessTools.Method calls with that one i just mentioned instead and stopwatch it again

#

you'll need to using System.Reflection;

#

oh you already are ok

teal bridge
# brave fable there's 3 files of harmony patches actually <https://github.com/b-b-blueberry/Co...

You may or may not be able to speed some of that up by parallelizing the AccessTools.Method, or if Harmony doesn't like that, doing conventional GetMethod on parallel threads.

But, I stress may. I wouldn't do a whole lot of work until profiling it. I'd start with promoting all those AccessTools.Method inline calls to fields, and then measure how long the Harmony patching takes on its own. If it still takes 620 ms or whatever, then that's pretty much all you can do.

#

One thing I'm pretty sure of is that AccessTools.Method is not cached, so you are doing some repeated/unnecessary work in there, and might save time just by making them fields and reusing them.

uncut viper
#

arent they all grabbing different methodinfos anyway? does it matter if those are cached?

teal bridge
#

Some of them are. I know I saw multiple references to drawHoverText.

brave fable
#

it wouldnt make a difference for the ones that aren't being reused and refetched, which is none of them, but fielding them does at least mean they can be parallelised

#

oh right that one has a prefix + transpiler

teal bridge
#

My guess is you won't see a huge improvement from getting the methods separately, you might gain 20-30 ms if you're lucky.

#

IL emit is slow, thus Harmony is slow, and while you can do IL emit in the background, I guess you can't do Harmony in the background. Sad.

#

As a general rule of thumb, parallelization tends not to yield very significant improvements until you've got dozens to hundreds of independent tasks, or a small number of extremely slow (each at least hundreds of ms) independent tasks. If the tasks ever have to wait for each other, fight for locks, etc., then the yield goes down even further. And eventually the overhead of scheduling and joining the work is larger than whatever time is saved on the main thread.

#

I'm kind of surprised Harmony doesn't have any of this built-in, since patches per method have to be applied sequentially but each individual method is independent of any other method.

brave fable
#

at least in the main harmonypatches file, the accesstools calls from the initial Patch method alone make up 200ms for 8 calls, so probably -150ms is the best you could hope for

#

how would i format parallel calls for locals? worth finding out what i get, anyway

teal bridge
#

I don't think you can parallelize field initializers, you could just stick them in a list an iterate over it with AsParallel()

#

Or do the Parallel.Invoke thing to assign values to the fields, it's stranger syntax but it'd work too (I think).

brave fable
#

this is definitely going to take more than 150ms of my afternoon

teal bridge
#

Just beware of ordering, unless you specify AsParallel().AsOrdered() your results won't be in the same order as the inputs (and AsOrdered slows it down considerably).

#

Well, you asked! I'm actually surprised it adds up to 200 ms, that's far more than I would have expected.

#

Pretty sure 99% of modders would not trouble themselves over 200 ms. I only care about that stuff myself in frameworks.

calm nebula
#

I'm quite surprised at how much like

#

that matters

teal bridge
#

You need a compile-time reference, though, it appears?

calm nebula
#

yup!

brave fable
#

i'm only really interested because this mod used to have a lot of users

uncut viper
#

i was doing tests too but was getting much worse stopwatch results with runtimereflectionextensions vs accesstools SDVpufferthink

brave fable
#

maybe with enough reinstalls they'll almost save enough 150ms increments between them to reach the time it took to type this message

teal bridge
#

I mean, 6600 upboats is nothing to sneeze at.

placid juniper
#

Does anyone have a schedule json just so i can test my mod and make sure everything shows up as intended

teal bridge
#

But past a certain point, performance optimization is rather more about your own sense of perfection than it is about your users' tolerance.

brave fable
#

my long-suffering users have had to tolerate a bit over the years

tight rivet
#

So I was bored and decided to let SDV run a bit, and I'm seeing memory gain (down from 3GB to 2GB when not in focus in the mines) from idling it.