#programmers-off-topic
1 messages · Page 30 of 1
(WGSL uses vec4 too, I just checked to make sure I wasn't totally insane)
So yeah, ignore everything I just said/asked. Never happened. If you bring it up tomorrow, I'll deny it.
imma do integer arithmetic with an 8bit float
Yeah, that's precisely the "wtf" that was going on my head.
But I am a mere grasshopper when it comes to graphics, I just figured there was something very strange and mysterious about how GPUs worked under the hood.
WGSL largely uses GLSL nomenclature.
I'm unsure why they opted for their own syntax, though, when both GLSL and HLSL have been around for decades.
Seems like they all do that? Like, Skia has SKSL too. Creating your own shader language is all the rage these days.
I think slang also uses something that is "like HLSL" but not exactly HLSL.
¯_(ツ)_/¯
As long as it can be compiled to SPIR-V, I'm fine with whatever shading language of choice
Which means any shading language that works with Vulkan, no? Or has SPIR-V expanded to other frameworks?
I guess so, though not necessarily designed to work with vulkan
SPIR-V cross for instance supports HLSL and MSL (Apple's Metal) which is pretty cool
And OpenGL has some extensions to use SPIR-V shader programs
Is there a way to "clean" code? I write a lot until something works and then I wonder how many lines are just taking up space. Sometimes intellisense puts those dots under something that says "this isn't getting used at all" but then a lot is so contextual to how the code runs it takes a long time to try to see what isn't needed.
to me it sounds like the actual problem here is that the code is too difficult/complex to reason about to know what is or isn't necessary
normally it would be relatively straight forward to know whether a line of code is actually doing something useful or not
barring some exceptions like dealing with an odd poorly documented external api
Well it's C# that I am in the process of learning, so yes, too difficult relative to my knowledge of it.
you can always step through with debugger
I can write a brainfsck compiler for SPIR-V.
intellisense is limited to obviously unreachable code, there might be fancier code analysers you can use but im not that familiar with C# either
there's many code analysis tools for c# but most aren't free...
Then I'm looking forward to your brainfsck shaders :))
I'm not.
debugger would let me do a lot of tests at once. So flag a lot of sections, then playtest until I am moderately confident it has hit all the things it's going to hit, then comment out the unused portions and playtest again to see if errors appear.
oh i was thinking you just drop a breakpoint on possibly not needed code
I already use it to test my MIPS emulator: https://github.com/ameisen/vemips/blob/master/vemips_sdk/MipsTest/mandelbrot.inc
I would argue that if it's too difficult to even reason if blocks of code are even being executed at all, then it's too convoluted
That's incredible lol
I've regularly worked with code like that unfortunately but that's usually like decade deep poorly maintained legacy code
that works too, since I have a vague sense of what might not be needed.
I also have worked with code like that where it's my own SQL from 4 years ago. I have started added copious comments to everything since.
In an ideal world you'd have a full unit test suite testing every expected usecase for that code but that is not a world I have ever experienced
if you have a test suite that truly covers all cases then your software is prob not user facing
You think you got every use case but someone will surprise you.
Path of Exile devs said once that the first hour of a league going life was orders of magnitude more live testing than the three months of development playtesting which makes sense when you have 100k players and less than 20 devs/testers. So when people complained about bugs when doing some weird specific thing it was not surprising, since testers would not be going into edge cases until they appear.
in the case of games also very crucial is that it's impossible to test with every hardware configuration
people are going to be running your game on the strangest setups known to man
for a lot of software though... clients just seem to want to do things that just make no sense sometimes
Fit the tech to the business process and not the other way around yeah.
I work for a company where pretty much anything gets built as long as some client pays for it to be built which has resulted in a very messy codebase with the weirdest usecases all trying to simultaneously continue working
even today
Oracle?
working on something so strange even the product owner started doubting himself several times trying to explain it and then leaving for a bit to check
I don't work for a company you'd know the name of no
doubt oracle has an office in my country
damn, they do
like a disease
there's only 2 oracle jobs available in my country rn
a sales representative job and a consultant job
sounds like they're trying to expand in
I remember getting three separate reports of Stardew crashing on save. The culprit was apparently SuperAntiSpyware
Or that recent bug that we got with a third-party game cube controller causing the game to crash because of its rumble driver
(Not even particularly a stardew issue too; like it causes crashes on the SDL level)
Really cannot anticipate every single config that your players will play on
As in... a custom driver? The fact it has a custom driver is itself weird enough to me!
Wow, yeah. That's... huh.
Very luckily, the .dll name popped up in the Windows Event Viewer, and I found this thread + an old Stardew thread where Atra troubleshooted the issue
That sounds like Atra. 
I say "luckily" because it was otherwise popping up either "Stardew Valley.exe" or "StardewModdingAPI.exe"
Updating to the monogame fix beta somehow got the faulting module to move to the actual problematic .dll
possibly by pure chance
More than likely by pure chance
luckily the company I work for makes it easy to figure out what is causing things to break cause the answer is just always watchguard
watchguard blocked my webcam cause it thought it was an image server for some reason
i... guess it does serve a continuous stream of images
very loosely matches the definition i guess
watchguard had to be completely removed from the servers because it was breaking essentially every single service we run
the build pipelines stopped working, applications were crashing
good stuff
sounds fun
You learn the common wisdom that select ain't broken, and it serves you well, and then you hit that one weird day when select actually is broken.
I've been considering using FASTER in SM. Nooot sure if it would be beneficial - probably not.
what's that
I assume it's https://microsoft.github.io/FASTER/ unless there's another framework with that name now.
Although I cannot quite grok how it would fit into something like SM.
what does SM stand for...
SpriteMaster? I think? Someone mentioned it in the modding channel. (Unless, again, there's a different SM; I've been misinterpreting a whole lot of acronyms lately.)
super mario
o
yeah if it's Ameise talking it's spritemaster
Oh that is cool!!!!
Exceeding in memory structures? I've got to see this
So they say. I was skeptical when I first read that claim. I gather they must be comparing it to specific reference structures like ConcurrentDictionary, or Dictionary with a lock. But I haven't read the white paper.
SM uses a number of key-value stores.
One in particular is read a lot.
I guess you're... caching upscales or something?
And original date, and kv lookups for objects
I'm having trouble articulating this, but I'm tackling a problem semi-related to SDV for fishing:
From my understanding, the chance I catch a fish depends on a randomly shuffled list of fish location data for a region, starting the mini-game if the random num is < p and continuing to the next if it isn't. So, to model this a bit more simply, I just take in a list of probabilities, such as:
[0.25, 0.5, 1], and I try to get the average chance any given fish is reeled in. In this case, the results end up being approx.
[0.104166.., 0.22916.., 0.66666..], which is good, but.. my implementation is of O(!n) and I'm trying to do better than that.
def get_probs(prob_list:list):
sum_probs = [0]*len(prob_list)
for permutation in itertools.permutations(range(len(prob_list)), len(prob_list)):
real_numbers = [prob_list[i] for i in permutation]
total_prob = 0
for iter, i in enumerate(permutation):
current_prob = real_numbers[iter] * (1 - total_prob)
total_prob += current_prob
sum_probs[i] += current_prob
total_permutations = factorial(len(prob_list))
final_sums = [i/total_permutations for i in sum_probs]
return final_sums
First mistake is arguably using python, but I'm kind of already doing the rest of this and it wasn't supposed to involve performance-critical code like this.
Main thing is, is there a more obvious / better algorithm to use for this kind of situation? I feel like there has to be.
I tried to look this up myself, but my attempt at searching "getting sum of probabilities for shuffled list" has not been helpful
Most experience I have is one stats class
Which I half understood, despite trying my best 
Unfortunately I don't recall this clearly enough rn
That's ok! I was just throwing this out there into the server to see if anyone has some insight. thank you for looking at it 
(For example, I'm now trying to justify to myself if
[A, B, C] and [B, A, C]
Shadow C equally.)
While having only my phone on me so
Not even scratch paper
I could def short circuit some things if there's something of prob 1 that gets hit
but thats minor
Yeah
I'm looking for big symmetries that let you reduce the amount of work you need to do
Yeahh
Random thing I think im noticing is the lowest common denominator is equal to multiplying all the denominators of all numbers times the number of permutations, its 24 for [0.5, 0.5, 1] and 48 for [0.25, 0.5, 1], and 60 for [0.1, 1, 1]
Do you care about the prng in stardew for purpose of this?
I wouldn't know what prng stands for
Pseudo random number generator
I care moderately about queries but mostly for the sake of excluding legendary fish, qi quest stuff, etc
As u know most programs don't use real rng
mm i would find it interesting at the least
right now there is no actual random for the algo im using, it just gets the avg assuming the numbers are true random
is sdv prng significantly different from what would be considered 'truly random'? like is it biasing results
if so i might as well run n simulations with sdv prng and use that
It should not be
Stardew uses the normal c# random
Which should be fine for video game purposes
oh ok yeah i should be fine then
but yeah practical problem, i haven't implemented filtering down fish in a sublocation by season so one place in particular (the beach, it's the beach) has 21 different catchables
Did fishing use daily luck
Ig it's probably fine as long as there's no seeded randoms 
but im kind of ignoring both because 🙈
Fine to ignore I mean
even if i get within a few coins of what could be expected with the assumptions i am making im happy
but i need to be able to calculate this within one year from now
a list of length 10 takes 3.64s with this
painful
if i did my eyeball math right it would take over 1000 years for that (len 21). lol
i love python
Back when I was in skool the tuition paid for access to a supercomputer 
Yikes, 4 seconds for 10 elements? That's even worse than O(N!)
i would think the multiplications by (1-p) are commutative, so if you have a good (fast) way to calculate the chance that a given other entry precedes the one you are looking at, you maybe could multiply that by the hook chance and not bother actually doing permutations. i think that would still be n^2 but that is better than factorial
Mainly what I remember from my perms and combs is that they generally are factorial complexity and there's not much you can do about it other than... don't do perms and combs.
Ok, this has my interest, but I will need to take some time to understand what you mean by this to translate it to some algorithm
Yea
i don't know the solution for the ordering question but there's probably a k-choose-n or something that can get it quickly
I could also make it wicked fast in a language like rust or c but.. its still O(N!)
I mean, you can calculate nCr as a scalar pretty quickly, but if you're dealing with the set itself then it's going to be slow.
I may have to reread the problem a few times but I'm wondering if this should be modeled as an interval tree.
If it helps I can elaborate on the problem itself
I tried to keep it concise but I may have lost a few details along the way
Rather than "a list of probabilities", think of it as "mutually exclusive ranges between 0..1 that each fish occupies given a random choice in that range"
Ichor is right here
And was what I was getting at with "shadowing"
After that. You need "every possible position a fish can be in the list" (equal probability)
Yes, I want to do whatever ichor mentioned but unfortunately I don't understand what's being put together there. I am going to dissect that, but it's taking me time
And the kcr ways the other fishes can be before or after
to use your initial example, [0.25, 0.5, 1]: to hook the .25, you have to fail all the checks before it and then hit p=0.25. if e.g. 0.5 comes after 0.25 in the shuffle, then you don't check it, so multiply (1-0.5) * the chance that it is actually in front of 0.25 in the shuffle, and do the same thing with p=1
Possible savings there too but I'm too tired to figure that out
hmm
That's an interval tree, isn't it?
You can precompute all the ranges based on the probabilities.
If the first element has 5% probability, then the remainder of the elements occupy 0.05-1.0
(I don't see it.)
like sort of have some of the answers which were already encountered saved? so if im doing like
[0.1, 0.2, 0.3, 0.4]
and im at 0.1, 0.2, and about to do 0.1, 0.2, 0.3, 0.4 / 0.1, 0.2, 0.4, 0.3, I save what the result was for getting up to that point and just re-use that
dynamic programming 
im rereading this a bunch of times it's just not sticking, i promise you i will keep at this until i understand it even if it takes me a night's rest beforehand
I don't know, maybe I'm starting to get more tired at night, but it seems like you are treating the problem as a series of "gates" (roll once; return A if less than X; roll again; return B if less than Y; roll again; return C if less than Z, etc.)
that is how the fishing function works, yes
Which is how these RNG tests are normally implemented in games, and that's fine, but the whole thing can also be precomputed as intervals along a single random axis.
(requiring only 1 random roll)
(don't read too much into the "random axis", I wasn't trying to sound clever, I just mean continuous ranges along a 1-D line)
they're running into issues because they want to do this for every possible shuffled combination
which hits permutations
so you want to get out permutations asap
you can do that by folding cases together, ichor pointed out the symmetry
I'm probably confused about the what and when of the shuffling.
It shuffles the list of fish locations each time you cast and then goes through the list one by one
The entire series of tests changes on every roll? Is that it?
if it hits the end, you get trash
How does that one fishing info mod work 
so basically:
For each fish:
- has equal chance of being any position in the shuffle (hush, don't mention priorities.)
Is it just monte carlo
Is this a hypothetical problem that's just similar to Stardew? Because SV's fishing doesn't shuffle like that.
The relative probability that a specific type of fish (including algae and seaweed) in a location will spawn during a specific time and weather is: {relative spawn probability} = {base spawn probability} * POWER( ({all fish failure rate} - {this fish failure rate}) / ({number of fish} - 1}), ({fish queue position} - 1)), where all fish and number of fish are all other fish present at the same location during the same time and weather conditions. This calculation is repeated for each possible position in the spawning order (fish queue position) for a type of fish, and then averaged. The total added relative spawn probability for all fish at a location at a certain time and weather will always be under 100%, with any remaining difference under 100% being the relative probability of catching trash: {trash probability} = 100% - {total relative spawn probability}.
by simulating a lot of fishing checks every frame or something, if memory serves (and also having nasty side effects on Game1.player which was causing Fun crashes later on)
this is what the wiki says, interesting
lol mood honestly
The wiki can say what it wants, I've read the GameLocation code.
I'm actually not sure what the wiki means here
(Well, the decompile, anyway)
"all fish failure rate" what
presumably the chance that the prob for all catches fail and you get junk?
(atra weren't u gonna sleep)
i dunno..
(nerdsniping happens)
I'm quite sure there is a simplification off what ichor did
but I'm not quite sure where and need actual pen and paper XD
or a whiteboard
I really don't get it either, there's no "all fail" chance, except the "chance" that all individual fish tests fail.
yep..
Trash is just the last priority item set if nothing else matches.
ah, yes
But Stardew's matching order is deterministic. Or should be. Location data doesn't change per cast.
Not that it's not an interesting problem to solve if shuffling is ongoing, but it's a different problem than the one in the game.
let's say the item is in position n out of m. Then there is a (n - 1)/(m - 1) chance any other fish is before.
focustense,
that's what that orderby does
[Precedence] takes precedence, but then it shuffles.
I see, yeah. My solution would be: clone Game1.random so you know the next value.
so thus it has a ((n - 1)/(m - 1)) * (1 - p) (where p is it's probability) chance of contributing to the shadow on my fishie
But I guess that's solving a different sort of problem ("which fish is next" as opposed to "give me a global distribution")
yep
Sum that up for all fishes, it's a n^2 problem
I remember that now from the cave jelly spelunk, that's what I had planned to do before I lost the thread.
(note that this assumes equal precedence, you'll need to break out the seperate precedences)
you will also need to ignore the weird seeded random for the jellies
Yeah, you do it for each priority separately.
The loop also repeats twice for some reason, so... there's that.
You mean the loop to catch fish or?
No, in GetFishFromLocationData
There's literally a 2-iteration loop to determine the fish
Yeah that's what I think I'm referring to
^^
im not thinking about specific bait for a while lol
(Mr. CA likes messing with the loop variable.)
drives the rest of us mad
sorry, Myuu
but it's true
the most basic version of this problem is a headache as is x.x
I actually don't know if that's what the actual code says
for my sanity.
Please. Myuu
Tell me lies.
"The actual code is not like that, of course, atra!"
I think I'm going to spend a long time reading and re-reading everything everyone said here and figuring out what i can do with it, I'll be back within 1 to n days with what I got
targeted bait is fucking weird what
okay, that will really fuck with any mathematical prediction, it says "ignore shadow twice"
Told ya.
tbh the part of targeted bait that does other things I recall being more sensible
assumptions:
- not using targeted bait

Heh... in 1.6 I rarely fish without targeted bait.
have you noticed the targeted bait multiplier
? I'm saying that targeted bait is weird
I know what the code says and that it has 2 loops
In any case it's not just targeted bait that loops twice
It's literally any bait that isn't normal bait basically
BUT IT INCREMENTS THE LOOP INDEX IF IT ISN'T SPECIAL BAIT
Or I guess, magnets
No of course not Atra! It's written as a break in the actual code!!
it loops twice for most things
No
Inverted condition. Every bait that's not just bait.
Yes
So nvm I guess magnets do count as good bait?
Funny
I'm sure fish really love that
Is this in the lv50 repo? How do I request access so I can stop making silly assumptions from decompile?
Myuu, I have a stupid question
I'm pretty sure the repo is just the decompile
I don't have access to it either, though
Oh well. At least I can start adding meme bot commands.
I actually don't know, since that's defined in a content file I'm assuming
Not using the normal bait yeah
null is not equal to (O)685
no, not using bait at all. bait is null then
null is not equal to (O)685
Oh wait
I'm not finding it in the data unpack
at all
also, that's why I asked about the specific bait
do you want to do the honors of bug reporting that?
the 1.6 ||Goby||
I really thought this condition was handled somewhere else but I genuinely think that's just it
Balance-wise, still probably better to use bait because baitless is insanely slow. But... yeah.
is the last time I unpacked before 1.6 released
Myuu, because I think it's a bug here too
SpecificBaitMultipler defaults to 0
actually it defaults to 1.66
it does? Where?
I'm pretty sure Selph is right
I'll fix the null bait condition, assuming CA doesn't say otherwise
I don't even have this field... where is StardewValley.GameData?
it's a separate DLL, contains the definitions for SDV's Content data fields
Oh, I see it.
might also want to ask him about magnets while you're at it
magnets flavor text says they be bad for fish bites but they're strictly better than normal bait rn
Must abuse this in playthrough before it's fixed. I don't think I've ever even tried using a magnet.
Not nearly as good as any of the other bait types, like the deluxe bait which is already pretty cheap
nope
I will note that in 1.5.6 it was hilariously exploitable.
They... Really probably should be
you just...went to the casino. Stuck an autoclicker on the slots machine
went off to make lunch
came back, bought near infinite magnets
there's a magnet bait and a Treasure Hunter tackle
anyways
that got patched
anyways
we're hilariously on topic
My bad
can we go back to the math?
And you're still awake.
math
my only contribution is to point out that this fish chance calculation will also be relevant for a bunch of other places that use shuffling probabilities list such as animal produce or machine output
yep
I think you do have to account for the fact that the PRNG is not true RNG, and the multiple loops effectively act as a remapping which changes the random distribution to be less uniform.
Depends on the goal obviously, I'm not sure if we are trying to accurately predict something or just post some kind of vague stat that may or may not be of interest in decision-making...
im not interested in predicting the immediate future in game, im interested in finding out that, say, i will catch a sunfish n out of 100 times in the town river on a sunny spring morning or w/e, or i will get an average of n xp fishing on the beach during a rainy summer at noon
does SDV use PRNG or actual pseudorandom distribution? since if the former then I don't think it's particularly relevant
It's just .NET random. Xoshiro256 I think.
If it was doing fancy Poisson distributions then the RNG wouldn't feel so sucky half the time.
(er... no offense to myuu and the rest)
Anyway, I guess the reason I was asking is that I'm skeptical of how accurately this offline prediction will track with what happens in game, precisely because everything RNG-based is so streaky and bursty.
(real random numbers also tend to clump, if memory serves)
They do ichor, which is why many games focus on the distribution.
has to do with how the net 6 random works
xoshiro256 only kicks in for nonseeded randoms https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/#system-types5
🤷♀️ it's probably random enough that I'm willing to ignore it over worrying about calculating a step above monte carlo
Game1.random is nonseeded.
Ok Mr. Smarty Pants, here's what debugger says.
in both loading and new day
..what does either matter if in the long run, it's evenly distributed? i don't get this
hm
is it possible to keep a distribution for it somewhere, then?
i suppose the current algo would rely on a standard distribution, though i have to admit im approaching more detrimental levels of tired
you're doing this in entry
Entry would see an unseeded random
it's the only place you would
except in special orders, huh
Game1.random is reassigned in the middle of save loading to a seeded value
oh nevermind I misread that's deterministic
Confirmed that it's Net5CompatSeed at some point later on. (Don't know the exact timings.)
Some of these comments about distribution... https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Random.Net5CompatImpl.cs,358
This is why I like Rust's rand crate that actually lets you pick your distribution.
Interestingly, I'm reading that Xoshiro256 actually has a good uniform distribution: https://prng.di.unimi.it/#quality
But I don't think the net5 impl has the same track record.
i mean, if we want to confirm this im sure theres a way to code in some debug tool that simulates getting a bunch of random nums from random and builds a distribution from it
yeah but now im double nerd sniped
Anyways. I actually have to do actual work tomorrow, lol.
mhm, i would like to sleep too its midnight
im going to see what i can make of this. cheers and thank you all! 
@bitter kiln Just FYI, I think a couple months back the main (current) dev for UIInfoSuite2 (goes by drewhoener on the GitHub) was working on comprehensively modeling fishing probabilities. I can't remember their username in here, though, but they frequent #making-mods-general and have the same profile pic they do on the GitHub for UIIS2 (ref an issue they wrote there: https://github.com/Annosz/UIInfoSuite2/issues/442). I think they have "UIInfoSuite2" in their name on here, too. Hope that helps; I think they'd spent a decent amount of time testing performance of running simulations in-game and things so they were getting pretty in-depth with it.
You're talking about abs0rbed (not including @ to avoid a ping).
Ah found them, it's ab..
Yes, focus beat me to it 
Here's the last post they mention the fish mod in (from June), where they summarize the fish mod and the issues they were tackling with it: #making-mods-general message
Looks like they were last really working on it in April, though, based on messages with "fish" in them, though
Ok so, I think I've thought of a plan for this. Since it should be commutative as ichor mentioned, I can just do one permutation for the elements leading up to some element in the list rather than each permutation. So like for [0.1, 0.2, 0.3, 0.4], I can just operate on [0.1, 0.2, 0.3] to get the result for 4 at the end of the list. That way, I can go back to front, iterating through each element in the list and recursing to operate on itself minus that specific element, and then have that result be summed up for that specific element. I think that's it, anyway
Most difficult part so far has been digesting all this information but its maybe starting to make sense
Also noted! I might give them a ping if I need their help.. or if I find something they might like. Though, I'm guessing that they've already figured something like this out. Though either way, I am enjoying this for the sake of learning and applying stuff to an actual coding project
But yeah since the calculation for checking the prob of the last element in the list gets selected is just inverting the chance of all elements and getting the product, it's not too bad
Though I say all this, I do not have a working algorithm 
For the original problem I do get 2/3 values correct though, im this close 🤏
@gaunt wadi what do you know about esphome? People seem to sing its praises, but im not sure of its usecases
Idk if its just diy stuff without implementing your own protocol
I haven't used esphome, but I've used a bunch of esp32s before. My understanding is esphome is for implementing your own smart home devices, whether that be just because you enjoy it or there's no device available for purchase that does what you want. I've toyed with the idea of building my own smart blinds that upgrade my existing non-smart blinds, since I have an esp32 and motors lying around and that plus some 3d printed parts is everything I need, but I already have too many projects on my todo list
or in short: seems neat, especially if you're into hardware, I personally haven't had a desire to use it
As far as I understand, smart home devices are just micro controllers + sensors/etc + firmware industrially packaged together and esphome would let you build the identical thing diy
I am "I'm not sure why my back is angry at me today" years old
I know exactly why my back is angry at me. Sadly the knowing doesn't help with the problem.
def get_probs(prob_list:np.ndarray):
sum_probs = [0]*len(prob_list)
for i, element in enumerate(prob_list):
n_permutations_e = factorial(len(prob_list)-1)
without_e = np.delete(prob_list, i)
chance_all_others_fail = np.prod(1 - without_e)
sum_probs[i] = element * chance_all_others_fail * n_permutations_e
return sum_probs
at the very least, this works for the elements at the end of the array..
Input: [0.25, 0.5, 1]
Output: [0, 0, 0.75]
I feel like i tried this this morning but maybe I didn't, just got to recurse a bit, I think
Yeah I'm hitting a roadblock here, I don't know what to do
I've gotten to this point repeatedly and then I keep failing to go through the rest of the cases properly
Is anyone else's NexusMods not connecting rn?
yep, random 503 errors, though it loads occasionally; not seeing anything relevant on the status page
and then the same minute I say that:
Investigating - We are investigating reports of connection issues to the main website
Idk if this is the right place to ask but
Can somebody by any chance help me with this
Definitely not the right place #1272025932932055121
Oh hm, precedence might make this easier? It seems to essentially divvy up fish location lists
I suppose ill ask in #making-mods-general though if anyone wants to definitively point to me which channel is best for discussing making a python script which interfaces with game data, let me know... its SDV, but not quite a mod
what exactly are you trying to do here?
i might be able to help?
Well, it all started here @candid pilot , though it may be fine considering #making-mods-general message
so this is about how the game decides what fish to pull?
like it checks for rand < .25 and then rand < .5 and then rand < 1 (100%)
the output here (the O(n!) algorithm?) looks rather close to just dividing the inputs by the sum of the inputs. i don't have an actual statistical basis for that though
Yeah
Sorry that I can't chat too much right now, I have to set up to DM for a campaign in an hour
got it! have fun!!
Can't do that
not quite, though. dividing by sum of inputs for the first one gets 0.25/1.75 -> 0.1428... (1/7) instead of 0.1041666 (5/48)
Sum over all positions
hmm, i will try that tonight/tomorrow morning
yeah i realized!
?
def r_norm_prob(probs: list[float], part: float = 1):
if len(probs) == 1:
return probs[0] * part
return [probs[0] * part] + r_norm_prob(probs[1:], part * (1 - probs[0]))
recursive bit. sorry if i’ve completely misunderstood
but like [.25, .5, 1] -> [.25, .375, .375]
and O(n) for n = probs ?
i don’t know stats though sorry
oh god randomly shuffled i didnt realize
Yeahh
Yeah that orderby random is easy to miss (why CA... just why)
Its a bit less rough in practice because its sorted by precedence, and then sorted by random
The main test i've used is [0.25, 0.5, 1] -> [0.104166.., 0.22916.., 0.66666..] since i calculated that by hand initially
yeahh
5/48, 11/48, 2/3 i went and calculated by hand too
im working on smth with caching an hopefully it’ll be better than 1k years 😭😭
I have no idea what is going on here but I believe in y'all
my understanding of statistics is nearly zero
literally
who knew you'd need a course in statistics to make stardew valley mods
Have you tried just calling getFish() a lot? I theoretically could do the stats I guess but it sounds easier to just getFish() to me. Obviously this does make it harder to do out-of-game, so you could use this also as a means of checking your calcs once you have a method.
Someone remind me to code what I mean on Sunday
(I don't see why a tree structure needs to be involved at all.)
That's what the Fish Overlay mod already does.
(Technically, it goes a couple steps farther and actually "catches" the fish with a fake rod)
It sounded vaguely like the goal was something external to the game
but theoretically you could just translate getFish() to python maybe
I may have been on the wrong track with the interval tree, IIRC it was before we got into the whole randomized-precedence thing. The interval tree is just a way to reduce the O(N) RNG samples in a single pass to a single random sample plus O(log N) tree search.
(I think translating getFish to python is sorta the deal here, except actually running that logic has crazy slow factorial complexity)
Yeah, as I said, if you assume the prng is "good" (not a bad assumption) and you just want expected value there are pretty good ways to simplify the problem
I'm clearly not making myself clear
So I guess I need to code it lol
It is at worst n^2
And I think we can still simplify
One thing you can see with the overlay mod doing its slow simulations is that the distribution really does change (very subtly) from moment to moment. From which I infer that any static simplification would also be an approximation. But also, the changes are in the order of like, fluctuation between a 12% and 13% distribution, so I wonder if it's really important.
Guess I'm bringing over my work habit of dissecting stakeholder requirements, but I keep wondering if we really need to care about the precedence randomization. Yes, it affects the result, but only to a very subtle degree compared to just assuming an equal distribution of everything with the same precedence. Doing it the latter way is not accurate; but I'm also quite sure that the most accurate possible factorial-complexity computation is still not going to translate to an exact replication of results in the game, because a "fishing day" in the game is a very small sample size compared to what it takes to observe uniform distribution with these PRNGs.
This all boils down to goals for my nitpicky self. If we're not predicting catches with high accuracy, then what exactly are we predicting and why? What's the "good enough" point?
At a certain point, you're precise enough to show numbers to a user. It's not like someone is going to catch 100,000,000 fish and then complain that the results were slightly off.
Yes, and that's what I'm getting at, it may very well be precise enough to yeet the random-precedence entirely and make a few simplifying assumptions.
If you're just trying to show an approximate distribution, then the static priorities are not that far off.
If fishes A, B and C are all at precedence X, and precedence X has Y% chance, then just assign them all equal conditional chance - all individually Y/3.
(I would take the shareholder argument more seriously if ichor and I didn't solve it yesterday lol.)
I'm glad I haven't bothered calculating fishing percentages for Almanac at all.
Just "where can you catch this"
so do you think this algo would be faster than the sampling done in fishing overlays 
Hard to imagine being slower than 100x per tick. But on the other hand it's python.
well i imagine you would rewrite it in C#
Nah, I'm writing it in the NI flavor of assembly
python is very good at being impressively slow at the simple act of looping over something
I will defy mathematics itself
a fish's catch chance is 50/50, you either catch it or you don't
I imagine in three or so years they'll drag me off to the insane aslym
Mumbling stuff about symmetries and collapsing cases together
you'll get through this
Hopefully
whatever "this" is
who was the one who was in pain due to having to migrate from Microsoft access again
Not me!!!!!
a job I interviewed for today apparently involves a big Microsoft Access thing they really want to migrate away from
well it doesn't seem to be the main database at least so it's something
So how are we doing this Thursday?
Too late to ask; it's already Friday here 😔
Microsoft Access
Well, it's better than Excel...
Microsoft Access still exists? Oh no
Times I have used stupid sed scripts to edit latex files += 1
it does

If Microsoft killed Access, I think half of all small businesses would die overnight.
My experience - no business with more than 1000 employees would be caught dead using Access for anything important, and no business with less than 100 employees knows how to do anything more sophisticated.
(Except tech startups, but they obviously don't count here)
(I'm laughing because I'm not gonna bet on the tech savvy of tech companies.)
cant they just put their stuff in a sqlite db somewhere
that's already two words too complicated for a usual mom-and-pop shop owner
i xkcd 2501 myself huh
Chu/e, what about having everything on your HD
(ok they probably use Excel. maybe something slightly bigger)
In excel
Verislned controlled the lawyer way
_v2
_v3
_final_for_real
_final_for_real_seriously_jerry
my work does this actually, its all on a massive shared drive
i suspect its nda stuff rather than not knowing what a cdn is though
no business with more than 1000 employees would be caught dead using Access for anything important
My business has 6500 and we just a few months ago stopped doing all of the budget and position management on Access.
Somewhere out there is a billion dollar company still using Microsoft Access for huge important things because the dev was foolish enough to declare "this is just a temporary implementation"
Is this the rocks one? 😆
yes the rocks one
Raise your hand if you trust AI to read a datasheet
You didn't say correctly so...
While it's not strictly MS Access per se, there are indeeed cases of major databases that are not properly sharded, replicated, secured, etc. using what may as well be local files on a shared drive.
And they've been responsible for some notorious outages.
sigh
look, if it works it works (until it doesn't)
making progress sorta
i've got a surprisingly nice form for 3 fish
and some of how it's structured has me hoping to find a more generalizable example tomorrow
but um
from math import factorial
from time import perf_counter
#from functools import lru_cache
#fac = lru_cache(maxsize=512)(factorial)
_t = perf_counter()
inp = [.25, .5, 1]
inp_len = len(inp)
#fac_coeff = fac(inp_len - 1)
fac_coeff = factorial(inp_len - 1)
def loop_get(ind: int) -> object:
return inp[ind % len(inp)]
def three_fish_solve(ind: int) -> float:
c1, c2, c3 = map(loop_get, range(ind, 3 + ind))
k1 = fac_coeff * c1
k2 = c1 * (2 - c2 - c3)
k3 = 2 * c1 * (1 - c2) * (1 - c3)
return k1 + k2 + k3
def sol() -> list[float]:
out_list = [*map(three_fish_solve, range(inp_len))]
out_sum = sum(out_list)
return [i / out_sum for i in out_list]
print(sol())
print("Time:", perf_counter() - _t)
not good python, sorry! i wrote this after spending like 2 hours just doing math on paper (related and unrelated to this problem)
that company is at 300 ish employees I suppose...
oh & since this is a closed form (ish) the speed is good (for python :p)
$ python3 math/randpermutest.py
[0.10416666666666667, 0.22916666666666666, 0.6666666666666666]
Time: 0.00022279000040725805
i can share more of what i learned tomorrow! i've got to sleep rn though
Nice!! fwiw I get similar values for 3 elements, so im curious to see how it goes with something like 10
good chance that the reason i get a similar time is just hardware diff though :P
ah yeah. running it in mine I get 0.0001476..., yours is faster by default. nice 
fwiw, out_sum could also be factorial(len(out_list)), though that doesnt matter for performance here
hmm
might it be true that any other given element o will appear before a given element n ((m!)/2) times? (where m is the total amount of elements)
mmm even if so i have no clue where id go with that
i genuinely have to give up on trying with this 🥲 i get headaches trying. good luck yall, im just going to finish sorting into sublists by precedence
promising progress on a simpler form
yay math
yepp 
i have no idea what that even means
why is there set theory in my math formulas
what does the delta and then a vector mean
or is that a binomial
So I discovered something about the new 2.8K Framework display.
Thing supports FreeSync, which I don't think I've seen advertised or mentioned anywhere. So that's nice.
What's FreeSync again? Is that an AMD thing?
What does it do?
reverse vsync essentially. Instead of your game trying to match your monitor's refresh rate (or some clean division of it) your monitor adjusts its own refresh rate to match the game frame rate(or some clean division of it)
It's basically
for j in a:
for k in b:
if k not in a:
result += j * k
adaptive sync tech basically allows you to avoid tearing and give a smoother experience without needing to use vsync which has a lot of drawbacks
Interesting
been around for like a decade
It's probably been a decade since I did much standalone game stuff, still thought vsync was the way to go
freesync monitors don't generally really cost much more which is a big benefit
gsync (nvidia's proprietary offering) requires special hardware to be installed and a license fee so those monitors are expensive as hell
yeah I think gsync kinda died off
my monitors have the barebones original freesync protocol which isn't too great
I heard recently that Nvidia is letting some display chip manufacturer include gsync compatibility to make gsync monitors cheaper.
Or... something like that.
I assume because gsync is stupid and expensive compared to every monitor just having freesync, which also works
Sure, gsync could be better but I think most gamers think it isn't hundreds of dollars better. And I have absolutely seen that kind of price difference for gsync monitors before.
in the original iteration of freesync, gsync genuinely had enough features to warrant costing extra for people
but nowadays I would never spend that premium
I mean I wouldn't in general cause I have an amd gpu but in a hypothetical scenario
Yeah, the original iterations, Gsync was just objectively better ignoring price.
My G-sync capable monitors weren't that expensive, did the cost go up in the last year or something?
im defining a function
It's generally great for games but both freesync and G-sync can bug out with some apps and cause weird screen flickering, so I'm sometimes having to turn it on and off.
&& set theory is badass that’s why
Hmm, Project Fluent's identifiers only support [A-Z0-9\-_] (case insensitive). I wish it allowed . or : or something else too
I could just use _ I guess...
been meaning to look into project fluent
localization solutions have always felt very inadequate
It looks like the way Linguini (this C# project fluent implementation) works, it keeps comments, so I might be able to achieve what I want by using a postprocessor and having something like #context module.id
@bitter kiln sorry if you don't like pings. do you have a 100% working version? (even if slow!)
in python. because i'm close
ignore the test/success bits
Yeah! and it's fine, I mention in my status that im fine w/ pings
def get_probs(prob_list:np.ndarray):
sum_probs = [0]*len(prob_list)
prob_list_inverted = 1 - prob_list
for permutation in itertools.permutations(range(len(prob_list))):
for iter, i in enumerate(permutation):
if iter == 0:
sum_probs[i] += prob_list[i]
continue
values_before_element = permutation[0:iter]
inverted_before_element = [prob_list_inverted[e] for e in values_before_element]
current_prob = prob_list[i] * np.prod(inverted_before_element)
sum_probs[i] += current_prob
total_permutations = factorial(len(prob_list))
final_sums = [i/total_permutations for i in sum_probs]
return final_sums
this is the working O(N!) version
thanks!!
np! 
im so close to getting this working
Oh i was at that at some point
and then I realized after adding in some other numbers that I was overadjusting for those values
try this one
sum is 0.983125 (0...1 for floating point error too, most likely)
i get [0.042619766940008644, 0.10951661631419941, 0.3736512731981011, 0.47421234354769104]
hm
infuriatingly close 😭
yeahh, getting very close! at the very least, its a fast approximation
i've been going at the code for the whole thing in the meanwhile, and im getting decent results so long as i limit things to small chunks below 10
Takes around 0.75s to run for the basic areas, fairly inflexible for other areas though
and of course, looks terrible due to the lack of being anything besides debug output. but it's there once more
yeah like issue #1 im counting trash stuff as 25 coins from sum and not avg. woops
alright, already patched that one up
this is the n! one?
yes
its just barely able to work because im forcefully processing the chances as individual lists by precedence and then stitching them back together
Hz: 67.32
Time: 0.01486495
i got this with 15 items yay
nice!! (what's the hz stand for?)
hertz! actions per second (based off of the time it took to run)
ahh, i read it as frequency but thought that surely couldnt be right. neat
i havent seen i/s shown as Hz, that makes sense
i don't know if it's something other people use but like
hz is actions/sec to me so
i would imagine so, its not a stat i tend to look at but i dont usually get myself into performance besides for enjoyment/learning 😅
still need to filter out stuff like qi beans and squidfest with params, getting there though
oh woop, average coins/xp needs to consider the weight
mainly i need real data to compare against
i thought secret notes are 0g
its price is listed as 1 in objects.json, which is where im getting that from
same for qi beans
ah, yeah, and just realized that the proportion values reported are within the lists segmented by precedence and have yet to be adjusted
oh, wait, nope, this whole thing was me being foolish. this cant work anyway
i need the whole list. cant believe it took me that long to realize. im just gonna rest
at the very least i have the framework ready to plug in some other given algo as long as it takes in an nparray and outputs one with the results in the same indices
ughhh
Solution: [0.03125, 0.08046874999999999, 0.28109375, 0.375]
Hz: 2479.78
Time: 0.00042214
thought i fixed it
yeahh its tough
been driving me wild too
im basically just going to keep on improving the code from as it is now tomorrow, its a mess and id like to standardize it and add some saving of the loaded json data as py objects / the result data, and show it graphically, add a exe, etc
double click go brr, people dont need to open a cli 🤷♀️ also, its trivial to do
thats last priority, but i tend to do it for the projects i like along with other things to improve qol in whatever ways
very os based
r u do py to c type things
easy
is there like a terminal script that's univeral. prob not idk
🤷♀️ you are right, though just by setting up the ability to make the exe it would be easy for anyone else to make it. but at that point they can just run the program
at least some people benefit
if you install git for windows then u would have bash
prob covers most ppl who would run this
current instructions to run is just invoking python
as far as im concerned anyway 
but yes i do things the way i do. im more concerned about making the code less terrible and more bug-free before any of that
u can but imma be asleep
@bitter kiln You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!
grr bot
hmm maybe my splitting works / still was the right move after all?
if i instead model some list of probs by precedence as 2d lists, if i have like
[[0.5], [0.25, 0.5, 1]],
which gets
[[0.5], [0.10416.., 0.022916.., 0.6666..]]
when done individually for all the avg. proportions, each array after the previous should need each element to be multiplied by (1 - sum(prev)) to account for the chance the previous one fails overall
makes sense since if the lists were reversed, the sum of the 0.25/0.5/1 array would be 1, and 0.5 would then turn to 0 as its impossible to get to it
yeah i think that does it
it at least ~= 100%
though in some places lke here it suggests trash is impossible to catch, which is false
where's that mod that does the monte carlo method? id like to see what the real proportions are..
oh wait its right
smallmouth bass is 100% for some reason
does... do general requirements also have a chance that's checked against?
huh, no. so what in the world is going on here
yeah, fishing mod samples trash at a 5% chance. IDEK. guess its back to code-diving..
oh of course it does another random check for fish in fish.json. ok, here we go again...
there, that's a little bit better
before i go any further im going to revamp the code as a whole
because this is going to be straight up unmaintainable in 5 days when i forget what it does. but hey, it almost works™️
nothing quite like arrays of arrays of arrays of arrays
999d arrays 
what do you mean you dont know how to traverse it? all you need to do is key by string, and then by string, and then by int, and then by float, and then by object, and then by string...
We all have
id like to read this tomorrow though, so here i go
ive been extracting everything into functions to try and split the logic but it mostly just buries complexity. not to mention jumping through levels of abstraction as it does
ive just been doing some off track things like pickling relevant data, the time save shown is kind of moot but it's nice to see (and the code quality gets improved along the way, more importantly!)
this is it being called from unpickled files vs. above, the json directly
(and for context again, the results above are exaggerated -- this is the time from calling main() 50 times, which loads objects from Object.json, Locations.json, and Fish.json)
LOL to the N! complexity function being cheaper than unpickling the objects
probably faster to use json?
Definitely, the reason I use objects is that I prefer the variable access and the types already being established -- I also read less in file contents overall as I ignore a lot of variables in the JSON that aren't necessary to this program
I could have done either, and the total time would be still under a second, but the way I wrote it currently feels cleanest
I'm starting to hate C#, it feels like there's no way to do what I need. I'm trying to create a wrapper for all my property parsers, the wrapper has a generic type T because I have a class for every property I want to wrap in it. The wrapper need to be able to either:
- call a constructor of
Twith arguments. - call a static function of
Tthat would return an instance ofTcontaining the parsed data.
Both need to have the raw data passed as arguments to properly initialise T.
I spent 2 hours googling variations of this, finding results about factories, interfaces and factory interfaces, but I still don't understand how i could do this:
- calling a constructor with arguments on a generic type is a big no no, even with a constraint because constructors can't be abstract or inherited from what I understand.
- having a static method in an interface is a big no no, so I can't ensure that my property parser classes have this static method.
Any C# connoisseur can help me with this?
Interface with a static abstract method for construction the each class overrides to construct itself?
Static abstract methods on interfaces should work in .net 6 and up, I think? Unless I'm being an idiot because I'm still waking up
Godddd docstrings suck
You wouldn't have needed your own damn syntax if you used a common one, python
Python: Explicit is better than implicit.
Also Python: if the first thing inside a method is a multi line string that isn't assigned to a variable, treat it like a help string for the method and save it
yup
I tried this, but VScode was still angry about it (I had to enable preview features according to intellisense), and it seems like I can't call a static method of a type parameter
Adding <EnablePreviewFeatures>True</EnablePreviewFeatures> to the <PropertyGroup> of the .csproj (and restarting VSC) does not fix this error.
Language version set to preview too?
no, I have this:
<PropertyGroup>
<LangVersion>11</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GamePath>$(SVPATH)</GamePath>
<GameModsPath>$(GamePath)/Mods (dev)</GameModsPath>
<EnableHarmony>true</EnableHarmony>
</PropertyGroup>
The link given in the error doesn't show anything else than setting TargetFramework and EnablePreviewFeatures
Here's the whole code for now, the issue is the declaration of make in the IProperty and its call at the end: apparently, I have to cast it to T, and it doesn't feel right...
using Newtonsoft.Json.Linq;
namespace FurnitureFramework
{
interface IProperty
{
static abstract IProperty make(string UID, JObject data, string rot_name);
}
class DirectionalField<T> where T: IProperty
{
List<string> rot_names;
JObject data;
string UID;
List<T?> values = new();
public DirectionalField(string UID, JObject data, List<string> rot_names)
{
this.UID = UID;
this.data = data;
this.rot_names = rot_names;
values.Capacity = rot_names.Count;
}
public T this[int i]
{
get {
if (values[i] is null)
{
values[i] = T.make(UID, data, rot_names[i]);
}
return values[i];
}
}
}
}
it's setup to do some lazy loading too, but it's still pretty simple
Testing it on my end, and yeah, even setting the language version to preview and adding the allow preview features setting, and it's still not happy with it.
Alright, I have to go sleep, I'll try again tomorrow with other methods.
honestly I'd already be miserable developing C# code in vscode
most of the time I can't even get it to work on any of my real projects
it's usually unusably slow even when it does kind of ish work sometimes
the reason you're still using .NET 6 is cause of sdv right
if at all possible I'd just go for an empty constructor and then having an initialize method it calls that does what the constructor would otherwise do
you would allow for a moment of invalid state though
I've never actually done this before interestingly
At this point I would prefer a compiled language
Where the fuck are you even finding that version of the file, python??????
deletes a pile of cached files
you have some cursed issues
Ugh. Python is not the right language to use for this lol
(But the alternative is labview so I suffer on. )
improved the terminal view and overall code
thats all for today i think
the values are probably still off, but they're better than when i woke up
(or maybe not, considering some of the heavily coupling i enabled between classes)
the main big thing is that the total values now consider element proportions before getting the average coin/xp
Oh, it might actually be close, too..? chances are the fish overlays mod ive been using reports 5% trash by reporting river jellies as trash.. not sure
Not sure about this feature preview and have not attempted to use abstract statics, but the (relatively simple) workaround in older language versions would have been to simply pass a delegate into the DirectionalField constructor. Are there a huge number of IProperty implementations and/or is DirectionalField being created by reflection or some external deserializer, or do you have control over their construction?
do you ever plan to use this w mods? i don't see how you would do that w/o like a bunch of patch exports
rm -rf ./__pycache* intensifies
Why do I end up needing to do work work over the weekend instead of my own work :(
I would say something about work life balance
But my work life balance is that work lets me knit in meetings
well I don't know why I expected google to read my mind here
Problem is that I'm working on updating/improving a library for a client. We have like... 20% of the requests done. We have a meeting to show progress with them tomorrow, but that makes me panic and want to get more done to show.
20% done in completion. Most are partially complete.
very low level Unreal C++ stuff along with rendering
Spooky stuff
not really; main annoyance is maintaining compatibility.
well, spooky stuff maybe for people who aren't me. I'm weird.
Well, I find it spooky and impresive
I enjoy low-level C++. I very much enjoyed writing a bootloader in C++. I also enjoyed writing a toolchain wrapper so that I could compile the bootloader and partial kernel in MSVC.
really old: https://github.com/ameisen/heimbrau
(The joke is that I work 6-6.5 days a week now.)
Have you considered expanding the week to accomodate?
Doing this would kill me inside, I can think of a bunch of clean ways to do it that would work in C++, but none of them are even allowed in C# for no apparent reason
Oh god, delegate is a keyword I saw Yesterday but forgot to look into...
I would have 6 or 7 IProperties, they already exist but I'm trying to do some generalized code to make it more readable for me and others. I can do whatever with constructors and stuff, but as I said, I'd very much like to have a single constructor with arguments to make sure there's a single initialization and no empty IProperty instance.
Delegate's just the older version of Func that lets you actually name it. Which typically I do once Func starts exceeding 3 or more generic args.
I don't, I intend this to be at best a part of external game utilities and at worst a fun pet project. The code would need to be rewritten to fit into SMAPI's API or whatnot, which I have little time or intent to learn
oh alright!!
Anyone wanting to use it for mods, if it ever is the better option, is welcome to over the monte carlo method
I did put it onto a repo for that
I hope it can be useful in some way to people that are not me
hm the main thing is obtain fish list right 
could just use the game's function for that one at start of day
Technically that is not a fish list, it is a spawn list which includes a mess of conditions, item queries and other madness.
it is written in python
In C# is there a way to tell if a method that is being called has the override modifier? Like if Rectangle has a GetArea method and Square overrides that GetArea method and then code calls something like shape.GetArea(), is it possible for my code to notice that we're in an overridden method (and maybe but not necessarily that it's specifically Square's version)? (yes, this is SDV related, but figured I'd ask this one here since it's much more generic)
I guess you could use StackTrace/StackFrame but you really shouldn't do things like that. Where this is a little less sketchy/dangerous is when you're using reflection to get a particular method and can use BindingFlags.DeclaredOnly to filter out any inherited methods (meaning you'd only get a result if it's overridden).
It makes sense in reflection because you're actually dealing with types. To check that during the actual overridden method call you would have to unwind the stack. If you're trying to attach specific behavior to a specific override then a better way is to patch that override (prefix, postfix or transpiler, all are OK).
Tbh i am bit confused about why you want this, maybe it's better to talk about the specific application in #making-mods-general
Thanks - that's useful enough. I'm brainstorming how to deal with an unlikely edge case but I'm probably better off focusing my energy on other parts of my code for now.
The abstract static issue has been resolved, I had to annotate my methods apparently:
using System.Runtime.Versioning;
using Newtonsoft.Json.Linq;
namespace FurnitureFramework
{
[RequiresPreviewFeatures]
interface IProperty<T>
{
public abstract static T make(string UID, JObject data, string rot_name);
}
[RequiresPreviewFeatures]
class DirectionalField<T> where T: notnull, IProperty<T>
{
List<string> rot_names;
JObject data;
string UID;
List<T?> values = new();
public DirectionalField(string UID, JObject data, List<string> rot_names)
{
this.UID = UID;
this.data = data;
this.rot_names = rot_names;
values.Capacity = rot_names.Count;
}
public T this[int i]
{
get {
T? value = values[i];
if (value is null)
{
value = T.make(UID, data, rot_names[i]);
values[i] = value;
}
return value;
}
}
}
}
I also fixed the warning about values[i] being potentially null in the getter.
Wait, abstract static is a thing now? 
yeah, but you have to fight for it
Huh, now every class implementing IProperty<T> and classes having these implementations as attributes have to be similarly annotated.
well, even the docs says that setting EnablePreviewFeatures to true in the csproj should be enough. Now that I've annotated, it compiles event with the csproj reverted to remove the preview features mention.
I wonder if a targets file you were including somewhere has preview features turned off and that's why it didn't work
why is it considered a preview feature
is it cause you're using a .net 7 thing in .net 6?
I've never tried to use a C# version newer than the dotnet version
i don't think you'll be able to use it at all
cough rust traits cough
(although the behavior of "traits that cannot be made into trait objects" can occasionally make you want to punch a hole in the wall)
rust in general sometimes makes you want to punch a hole in the wall
the polonius borrow checker will help
which should arrive with the new rust edition being released early next year
should stop complaining about a few situation where you aren't borrowing something twice but it thinks you are
Which is considered better behavior in Rust -- if I have a function that takes in, say, any u8 value and does some operation on it, should that be a u8 Trait for just a regular function
I'm not sure using a Trait has any advantage what so ever, but it does feel fancy
Is this for real, has there been some announcement about it or just the usual "it's definitely totally still on its way to progressing toward being done, possibly, in a year, or maybe two, or thereabouts"?
Real Soon Now™️ is a classic vaporware timeline
I'd go for the "definitely totally" interpretation
I have used num_traits, for example for a lerp type function that can work with any primitive. But I wouldn't use this just to implement lerp, only if I also wanted a Lerp trait which was built into some larger system of traits, etc.
If you look at .NET's Random you'll see a similar thing between Xoshiro128 and Xoshiro256; could easily be done with a numeric trait, both implementations are effectively identical except for the data type.
Basically, you'll know if you need a numeric trait vs. just the numeric type.
from what I can find the closest to a "this will happen" thing I can find is that bringing polonius to nightly is on the 2024H2 roadmap
Ah well. At least we're used to disappointment by now.
we'll have it, eventually
Polonius is operating on Duke Nukem Forever time and we'll just have to deal with it.
let's hope it's better than duke nukem forever
Hope, yes. Plan? Mmm...
polonius releases and it actually just makes the borrow checker worse
Haha, but that I actually do not expect from the Rust community. When they release something, it works.
yeah I don't think they often release something that doesn't work
it's not like... was it zig?
I know there's some competing language that has often has pretty serious bugs in stable
I can't think of anything other than Zig that claims to be a Rust alternative.
Nim, maybe? But I think it's just a transpiler.
I have used num_traits, for example for a lerp type function that can work with any primitive. But I wouldn't use this just to implement lerp, only if I also wanted a Lerp trait which was built into some larger system of traits, etc.
Yeah, that's fair. This would be a trait that could easily be a function and wasn't using any traity benefits. I'll just make it a function
I don't think Nim attempts to compete with rust or zig
luckily aquo is here, our local expert on nim
(Fwiw, I eventually ditched num_traits for that particular use case in favor of a macro implementation, because of the orphan rule and ambiguous trait implementations and yadda yadda... basically, as soon as you provide a blanket implementation you close the door to any custom implementations, maybe Polonius will fix that.)
just gotta figure out the future of what
Nim I think wants to be a compiled Python more than anything
It kinda wants to live in the same space as like C++
but not entirely
oh and there's mojo which also wants to be python but fast
how many languages are there that want to be python but fast
if python has any goals of being fast then I'm surprised
Sometimes python doesn't even want to be python
I would say "nobody wants to be python" but apparently some do.
I have a like... macro trait thing going on. And it's for a rather simple function too, I just didn't want to re-implement it for both u8 and u16 lol, but I'm not sure if it's cursed or not
no one wants to be python but everyone wants python's users
It's literally just a get_bit function for both u8 and u16. It just needs to take a bit index and return a boolean (I'm more surprised this isn't a built-in trait tbh). I could write the same function twice, but I feel like there should be a fancier way...
the standard answer all programmers love
there's a library for that
add a new dependency just for that one thing
I think there are two factors in Rust's defense here: first, often the crate for it is really small, it literally does the exact thing you're looking for and nothing else and there's no downside to using it; and second, you're pulling in the actual source so you're not creating DLL hell (although package version conflicts can bite you if it isn't semver'ed properly).
But there definitely are bloated packages out there that I would refuse to use to solve a minor problem.
As for bitfields in particular... yeah, I use the bitfield crate.
paid for the whole cpu im gonna use the whole cpu
I really should just have the algorithm in rust or smth at this point but surely its fine
the beach is the only place that seems to have a length of 10, which is basically the breaking point for this alg
you should never build something in rust cause then you deny yourself the satisfaction or rebuilding it in rust
true
just the pain of getting my way in lower level languages where i (deservedly) need more lines of code for the same thing
I've been asked before by my boss whether it'd be good to judge people's performance by the number of lines of code they've written
in this scenario rust is clearly superior
and C# is brilliant
haskell people crying with their dum little concise code smh should've written more lines
nooo
any boss that does that... eugh. im sure ill end up having to deal with someone who would say or do that at some point too
dont you mean assembly? 
true
local random sampling mod cant handle sea jelly (this randomly pops up as 18%, which is very not true)
but anyways ye, this is what i have compared to letting the fishing info mod gather information for a few minutes in the beach, same time/place/weather
excluding the last 3 on my list (which the info mod seems to not want to report), seeing everything be +-1% from random sampling is amazing to me
yayy :)
this is with hardcoded assumptions for like, lv10, so im going to real quick just write up a player obj and see what i can do
Because those are seeded random checks incorporated into the global entropy sampling. (This is all probably too on-topic)
🤷♀️ i'm here because the thing im making isnt technically a stardew valley mod, but if it counts enough, I can move it to #making-mods-general
im just not sure which channel is more appropriate
fair enuff
I'm not trying to play topic police, just being mindful that the majority (or at least a significant number) who frequent this channel don't even play SDV, never mind mod it.
that's me
Crumble are u going to play haunted chocolatier when that comes out
I am in the haunted chocolatier server so I will
though I joined cause my friends were there
I'm not particularly excited about hc but I'll play it
Rust has pretty good dead code removal too
Which I like
I think it'll be better than it looks
Much like stardew
He wants it to be a surprise
Plus then we get 2 games for life for the price of one fairweather double A game
Since our ape and savior is the type who just never finishes a, project (one of us)
I love c#, it was my first love (winforms represent lmfao), and even tho I'm a python architect/lead now, God c# slaps the eberloving crap out if it, python just has all the libs I need for my job and I value my time too much to port 38 diff api modules.
In c# I know what's broken BEFORE I launch it
If you want that in python u always end up u turning on type checking for 4 seconds before turning it back off again cuz it's so bad
So in python I'm there launching the bot/program some psychotic number of times while adjusting code/break pointing /stepping thru
if you think that about c# wait till you try rust or haskell or something...
No ty
Lmao
I respect rust and all (I ❤️ paru)
But I finally am coming to terms with OOP as I took on the responsibility of giving out tasks/sprints
because pretty much all C# frameworks use runtime reflection there's actually a pretty significant number of runtime exceptions that would not occur with compile time "reflection"
my biggest gripe
I've used C# professionally for a few years now and probably will continue to for many more years cause it just kinda dominates the market here I feel like
In the USA?
netherlands
Imo dot net core is the best api framework
and then it get progressively worse down to fuckin .NET MAUI at the bottom my beloathed
I've been using fastAPI but man the scalability just ain't there
Maui rip
Mowie
Ouch owie
Blazor
But we got avalonia to clean up that mess
blazor is... well I use blazor professionally I have very mixed feelings about it
God forbid you have any unsolvable issues tho
blazor is incredibly powerful and versatile but you fuckin look at it wrong and it's footgun that destroys your site's performance
Community is miniscule for avalonia
Kuberegtetties
Regrettis*
I tried
So you're a cross platform Dev,
What do you honestly think of winforms
I actually only develop for windows really
fuckin winforms can burn in the deepest pits of hell
And I think there's ab insane market for it that's not tapped into kinda
lmao
Lmfao
It is pretty awful
But for a mockup desktop app done in 2 hours
Way better than wpf
we have a gigantic old visual basic .net WinForms application
But any scalability, fuck winforms
wysiwyg frameworks are nice till they very much are not
The net core winforms Def better but still trash
Yep when you're trying to convert it to cross platform
Mfw my one project is like oh yeah this'll be a breeze np
Oh wait, you used that class? Nvm lmao
"this will be a significant amount of work"
498 red errors
That project ain't ever getting updated
But yeah the nightmares with scale, resolution
Etc, it's like coding css that doesn't use percentages or VH
Except omfg those fucking buttons are not lined up I swear to christ
I pressed the line up thingy! How the hell are they different sizes. Bring to front. Wait where did my panel go
Yeah you know what you're right, fuck winforms lmfao
lmao
part of our services use telerik reporting which is essentially a winforms style wysiwyg thing. We generate labels and reports with it and man the struggle with labels where everything needs to be in the correct spot by the millimeter. Everything secretly decides to slightly more to the side or do all sorts of nonsense and it's miserable. But then when you actually want something that's responsive to size changes it doesn't work
But I will say it absolutely got me into coding at the age of 34 and I'm literally obsessed with programming now, at the onset of covid was trying to help some guy with his oculus quest sideloader application and suggested some changes cuz he was ESL, he told me to get VS, thought he was being sarcastic/mean, but I did it, and it blew me away to see an actual program with wysiwyg designer, and then the event viewer blew me away, oh I want to auto clear this search bar with escape? Just click in search bar head over to events double click on key down event, check for esc. Of course all this is doable with wpf or blazor or avalonia but like, it was so huge to me as a new programmer, lifelong scripter, to see the hard code for the visual immediately after the double click
Yeah exactly
Yep when you then are attached to this freak of a creation u hate so much but cannot murder
now I just want a text based template I can directly edit
Exactly, with uniformity
Winforms should be left behind if you actually take it seriously
Coding, that is
Yeah it's usually hiding a terrible mess
Once you're so deep that you're making new threads for every api call you're fed up
still waiting for that perfect converter from a figma concept to a functional application
and it always will be
Am I the only one who literally yells at gtp?
Gpt*
Umm like "bro you just completely destroyed the entire thing, like why are you so extra, I fixed it myself I just had to change max height to 60 percent meanwhile you're over here doing advanced trig and completely destroying my heat map for no fckin reason man what the hell "
It's weird how blind it gets to glaring solutions
It gets very one track minded
So you throw another thing at it while it's doing one thing, sometimes it gets most of it right and it's gorgeous, other times it just omits entire functions and shoots itself in the dick
New coders are rough, tho, cuz they don't understand why it ever worked, why it's broken now, how to break down what it's doing to fix it with simple, clean code
My buddy had this insanely advanced script for making firmware
And he thought method parameters were actually return variables
chat gpt?
Yep
had to make fun of him for a good hour or two before showing him what his own code actually did lol
I use it for error messages to get a quick explanation but I never trust its psuedocode, it's so bad when being given novel ideas.
I think gpt is just so bad at completing anything because it's pulling from a bunch of one-offs
No one ever writes a whole ass program in stack exchange comments
Yeah it's also great at like Linux issues
and yeah makes sense, glorified auto complete is only reasonable in boilerplate code that you can pull from anywhere, ask for it for something new and it immediately fumbles.
Yeah or anything big in scale or feature complete
It just breaks down so fabulously and has no clue how to look at the code line by line and spot the glaring issues
I've seen a fair few people in this server come in with chatgpt generated sdv mods which as far as I can tell are never even close to anything that'd make sense
Yeah but you bet your ass I started mine with 4o and it was hideous and I deleted most of it but hey, it showed me how amazing smapi and you guys are and that it is in c# and that was good enough go get me Goin
Bur yeah it kept suggesting button. Pressed
And I'm like bro I am using key combos
Oh you're right you need button changed, 1 min later it forgets all over again
There's always that breaking point tho where I just go nah fuck u gpt u just wasted 9 hours of mky time for something that has a beautiful class function right fckin there what is your problem
A la Just Pressed
Still trying to wrap my head around blocking standard input but only if input is a chosen key combo for my bind combos to slots mod
So far it's pretty damn useful for me already, I set L3 + square to sword, then l3 + R1 to pickaxe, l3 + L1 to bomb, and then l3 + x to food, so if I'm about to die I just hit l3+x and in that Case I forgo the suppress because bam, we eating salad at 1 hp
Play on controller with gf on couch so it's ideal
Inventory management while those dbag dragons flying at u drives me up a wall
I don't know if anyone else will care for the mod, but I think as with all things with code the more versatile and customizable I make it the more useful to others Itll become tbh
Everyone has ideas it's all about the impl
no matter where i go, i stray off topic
in the off topic chat, talking about the topic this is off topic from lmao
smh
so programming amirite
does anyone happen to know about jemalloc and other malloc implementations
all I know about jemalloc is that it used to be in the rust standard library and was then removed
Fandom what the actual flying fuck
20% of the screen gone for some fucking irrelevant stats thing
Everytime I though they couldn't possibly ruin their site more than it already had been ruined they pull this shit
I see the problem. You can still see the wiki text
this need an autoplay video popover
preferably about some random different game unrelated to the article
💀
that's perfect
u see i am build a cpp library for work
and it was explode with free() invalid pointer until i stopped linking to jemalloc
for some reason it hasnt had a release since 2022 even tho there's been commits as recent as 5 days ago
oh i did build jemalloc too
well, coworker did
i dont really know what jemalloc even does beyond "malloc faster"
Brave
I feel like I've used your mods before, all of you lmao
I may also be stupid, but I feel like jemalloc vs malloc is one of those things that's like "if you have to ask, probably don't"
