#programmers-off-topic
1 messages ยท Page 9 of 1
but its techinally build and changed from tutorial code... granted its nothing like it anymore lol. which is what i mean by cant code from scratch
since i read the tutorial and learned why stuff worked i can now code from that, but i still need that buffer piece if that makes sense
@solar junco the downside of hiding unused UI...
following tutorials? ๐
no, I meant not knowing about a discord channel (but it was just a joke anyway)
oh LMAO I'm so tired my brain couldn't connect the dots
YEP that is a downside
but the benefit of not having to scroll for 5 minuts to reach the 3 channels I use on this discord outweights the negative ๐
yeah I know, I hid most of the channels of this server since I'm never using them
Does C# want you to compare strings with .Equals() like Java or is == equality safe in this land
i guess moreso what is the convention since it looks like it's safe to == comparison for general string/string comparisons
Just use == if you want a simple comparison, but Equals() has overloads that accept a StringComparison mode for case-insensitivity and such (plus the more esoteric stuff). Keep in mind that string1.Equals(string2) will throw an error if string1 is null, but you can use string.Equals(string1, string2) to avoid that.
(more to the point, I've always seen == preferred in C# for normal strings
)
Thats very brave. Nixos was maybe the most developer unfriendly distros ive used
๐ฉ I do a lot of different types of development, and on different environments on a daily basis, so NixOs ends up being the easiest way to keep things consistent.
i ran into lots of issues just getting LSPs and stuff set up
it was a lot of just making my own bin directory, which kinda defeats the point
Interesting, it works fine for my use case. I mostly work on simulation/ML which involves working a lot with clusters I have no real control over. Normally this is delt with solely by docker, but I find Nix flakes with docker to be pretty much the perfect solution to all my problems.
Question: why are my pin numbers not zero indexed
I now know more than I'd like about invisible walls in a very old game I've never played
pannenkoek2012 strikes again
annoying Dutch people by mispronouncing the word pannenkoek since 2010
anyone know how to batch make symlinks on Linux?
i have multiple files i need symlinked and i dont wanna type em all out in different commands
I mean, the obvious answer would be to put them in a folder and just symlink the folder
otherwise, if they have a common naming structure, you could do it in a loop
ahh im needing it to update retroactively, im symlinking my windows install and Linux install of Stardews content stuff and mods
I'm not too familiar with sdv modding, I guess it's not simple enough to just symlink some mods folder then
oh it is
im just symlinking the content and other files as well
its like 6 total but im lazzzyyyyy
yeah, unless they have a pattern in their name and you can use some wildcard, I think you just have to specify them
what mod are you making??
what do you have in mind to make life more quality
im trying to eventually give every item a use
along with making stuff more connected
example, i changed the seed maker to have a chance to fail, which outputs fiber, but that fiber can be composted into fertizers
so you in theory only need to throw stuff out in the mid to late games
unless youre one to make whole factories
turning stardew into factorio would be so epic tho
i like that idea, though does it not just kind of nerf the seedmaker? unless fiber is really that great
fertilizer is useful
what's that
it nerfs it yeah, but i then made it easier to get and earlier to get
i know what batch files are, not symlink
uhhh google will be able to explain it better since i barely know myself, but they are basically links to other files but... better and useful
I'm not quite sure that qualifies as batch lol
symlinks are short for cinnamon links, they're links that are great in pastries and other baked goods
batch mean all in one go
to me at least
Dont lie to them. Theyre simian links, named after the chain of monkeys that connect them together
symlinks are symbolic links. a basic explanation is that they can serve as an alias/another name for a file, with some caveats
it's a little confusing, because Batch (in the scripting context) tends to refer to the Windows Batch files, the script file for DOS/Windows
Is there a reason it has to be a one-liner? Typically the advantage of using a shell script would be to allow for several commands to be done in sequence, with better readability
Because I could do. "Replace all" in vs
I was lazy
Ahh true my bad
Well congrats on getting it working! Excited to see what comes of your modding journey

Wonder if I should include https://gist.github.com/KhloeLeclair/51a988d6c522fc7fa4e24fc13fb0c0fc in my as-yet unreleased mod monorepo starter template. ๐ค
I suppose it depends on your target audience for the templates...
I know a whole bunch of Stardew modders probably wouldn't touch that, but a handful that would.
Yeah, I've got no clue really just figured a starter project would be nice for people. I should really keep it simple.
The common project mainly has something in it just to show off how to use the common project.
https://nvd.nist.gov/vuln/detail/CVE-2024-2961
Just a 24-year-old bug in glibc, particularly exploitable through PHP. Fun!
fun indeed
is this what they teach in ui devs school?
I have never actually been to UI school, but that seems like the kind of thing someone who teaches would come up with.
It would also explain Microsoft's love of ribbon UI in Office and Windows.
The problem with "rectangular menu" is that it's trying to reinvent the wheel. The wheel being toolbars. We already had those. And rectangular menus make things problematic the moment you introduce sub-menus as a concept.
Pie menus are very nice in the right situation, but they are situational.
i feel like the ribbon menu is the exact opposite of what that picture wants to encourage
The ribbon menu is pretty much exactly what the rectangular menu in that image is
eh, i think its closer to the linear one on its side, although there are some stacked items, i think thats more because they run out of screen space lol
Just because Microsoft did a shit job implementing it, doesn't mean it isn't a rectangular menu, lol
I just don't like rectangular menus as a concept. Again. Give me a toolbar.
Put the money toolbar in the bag UI.

you'll get a pie menu and you'll like it
is it weird I don't....hate the menu MS does?
until I need to opne a new file, and suddenly I lose the ability to find anything
I think the ribbon is a fine design strategy
pie menu though... I thought it was called a dial menu
The pie menu is great for stylus based inputs for sure.
radial menu or pie menu...
where did I get dial from
the pie menu is great in steam input
for joysticks
Pie is fine for controlers or controller-like behaviors
I don't want to see it anywhere else
Also UI is influenced by input devices which there are more now than ever
you can set a pie menu in steam input?
yes
There is no one size fits all ui
steam input calls it radial menus but same thing
they're handy especially for games that assume you have a whole list of keyboard shortcuts available
tbh also it depends on like, what' you're doing
my least favorite ui thing is when I have to dig through nine million menus to figure out how to, say, set <insert random CAD attribute> to <different material>
checks Edit menu... nope
checks Tools menu... nope
I'm not even thinking of a specific app for that one... it's in so many
for very complex programs I just want a search tool which then in its result also tells me where to find it in the future
gonna redesign VS Code to use a ribbon instead of the command palette thing
(I love the command palette)
Another software I use thinks ยฅ is a character people should type often
I once had to set my windows region to japan for some visual novel and all my / characters turned into that one
I guess you might type it often... if that's your currency symbol
meanwhile I use the euro and have no idea how to type one so I always copy paste it from somewhere
isn't it alt graphic + 4
it is when I set my keyboard to use the dutch language mode on windows computers
not that I have an alt gr key currently set up on my keyboard layout
I could just add a euro symbol to my symbol layer
but I don't type it often enough to have bothered
ah
got the essentials...
do you press some modifier to get that
yeah the middle bottom key on my right thumb pad
i'm assuming you don't have a seperate keyboard for symbols
ah
why is f11 and f12 on both?
idk why they're not just transparent like the rest on my symbol layer
it's the same spot
ah
What version of Visual Studio is currently the best?
I've been using a older 17.2.3 until recently, but updated to the latest version since I needed .net 8 for a mod I am maintaining and it's god aweful.
Everything is slow and basic features (like ctrl+click to go to definition) kind of don't work
It's honestly impressive just how much worse it got
uh idk for me the best version is generally just the newest version
haven't had any serious issues on recent versions
well, new ones anyway
are you using win 11 by chance?
well then
spicy
it wouldnt be an open source project without people making a big fuss about things
it seems to be a little more than average though
hyprland drama has yet to result in this at least
something tells me nothing will come of this letter
some people will leave the project but none of em are probably going to be the one this letter is about
btw, anyone here gotten Reshade to work on Linux?
I don't even know what that is so no
i didnt think it was something anyone had working on linux
this sounds kinda like some other project... that I forgot the name of
it was some pun on vulkan
vkBasalt
right
basalt cause vulcanos...
looks like vkbasalt supports reshade shaders(at least some of em)
I give it a 10% chance you can get reshade itself working decently
i tried looking to that at one point i think
I also def played thru a game with a custom shader a year or so ago... but i dont remember how i did it
I had to do a meme edit after a discussion with someone.
I'm pretty shocked that nobody has put DOOM in Stardew Valley yet to replace either JotPK or Jumino Kart at the arcade machines
not DOOM, but... #making-mods-general message
Wow that's amazing
!
libretro is fun
that's sick af
I have a question about what is possible modding-wise, I'm currently making a Framework for Highly Customizable Furniture, and for now I managed to do it through Harmony and without having to modify the game's save data. But my next step is customizable hitboxes and according to what I understand from the code, it would require to patch A LOT of methods through Harmony.
What I think could make it easier is to derive a CustomFurniture class from the vanilla Furniture class and overwrite the methods I want to change.
My issue being : is it possible at all to have the game instantiate a CustomFurniture instead of a Furniture when it encounters a furniture added by my Framework? And how would I do that?
You could do that with about a million individual transpiler targets! 
i'm not sure it's the best idea to cross-post from #making-mods-general
But yeah, this is more on-topic than off.
Sorry, I didn't see that I had answers
okay so ive been tossing this idea back and forth in my mind but i cant get it to wirk
i want to make like a log system where i can input a new entry into the shell and it creates a new log with the entry number 1 above the last one (is the last entry was entry one, this one is assigned as entry 2)
but getting this to work properly has been
a pain
is there a way to like
logname = lognumber + 1
but like update lognumber each time a new entry is created so lognumber doesnt reset every time the program is opened
also like
im thinking the logs could be written to a seperate file but then whats the point of having the system if you can just open taht txt file
mauybe i can save them as strings but like
where are the logs being sent or stored in this case
im trynkg to decide becuasei cant get my write to file to wor
it says the path doesnt extist but i checked the path and it does but im just confued
i write half this while high so uh its rough but heres what i have soi far
im suree theres some command or something that i dont know how to use or something i just havent learned yet so if the answer is obvious please excuse me
i had the ("/Desktop/logdata.txt") with "a" at the end before idk why i got rid of it
ok i readded teh append
dont mind the readlog so much rn thats for later
i toyed with the idea of putting them into a dictonary but i dont know how to make it not read the whole dictonary at once
can't imagine that path is correct. From where are you running the file?
ohh
wait
ok hold on
do i have to have them in teh same folder bc i did that and it didnt work
lemme try smth
If it comes from desktop I'd use the absolute path. So the whole C:// shebang
else you'd use a relative path and remove that first slash at the front
yeah
what if theyre in the same folder
Question for the general public
or would i have to make a new folder so it goes down the directory
If I say "right angle banana" do you know what I mean
open("input.txt") will look for a file of that name directly in the same folder as the py
a banana thats like not curved but has a right angle
the open should work at least
I'm not familiar with python so idk how it does things here
hmm ok lemme try it
ok i got it to write it into the logdata.txt! thats good
lets see here
now my issue is
i want to assign that lognumber to whatever the new logentry is
so when i go to readlog i can type in the lognumber and it spits out the entry associated with it
but i dont know how to do that....
In python it's also often suggested to do like
with open("path/to/file", 'r') as my_file:
# Do stuff with my file
which will automatically close when youre done
ooh that shortens things
If you always want it to increase I think you have a few options.
- If you won't ever delete old entires, just get the number of log files and add one
- If you do plan on allowing deletion of entires, you could find the largest filename and add 1
- Or, store the index value somehow (which is how things like SQLite does it)
okay i know what i have to tackle now: linking lognumber with the logentry, making sure the logsequence doesnt reset whenever i start program, and getting the reading to work
all the entries wil be on one file
it not creating a new file its just appending to the end
in real world scenarios you'd probably use something better suited than a text file to achieve that but the simplest possible approach would just to read from the file how many "lines" there already are in the file and just using that + 1
I was gonna say, this sounds perfect for a SQL database
ok so
this is a box im gonna have to open
what would be better suited to this than a txt file
bc i was encountering the issue anyways taht if it writes it all to a text file anwyas theres no point to the readfile
The usual recommendation is that putting stuff in a txt file is fine if you're just writing stuff out for humans to read, but if the program is going to have to read it back, there are more ideal methods
i want it so that i can input text data and have it sotred under a lognumber and then later input that number and it read back the text taht was written for taht log
also lemme just look up sql database rq
sqlite is a good place to start cause you're working with a simple file still
Yeah, other SQL versions exist, which can store things in more or less the same way, but many of them are programs that you have to have running whenever your python program runs (which is fine on a server, a huge pain on your desktop computer), but SQLite is just a fancy file saved on your drive
You can sort of think of SQL databases as excel spreadsheets, but ones that computers can access very easily
But are more towards combining different tables together than doing weird equations
simplest alternative is some simple document database cause key: value pairs is about as easy as it gets
sqlite doesn't scale too great at the very high end but that's completely irrelevant in this case
it also doesn't have the sheer number of features something like postgres would have
You could use the autoincrease functionality, but idk if you can have it spit out what that autoincrease value is without a second query..
you don't really need to anyway. The auto generated id is basically already what you want you don't even need an extra field
do i do the uh pre release of the source code download
Are you on windows?
like this (i did this once befpre but forget how i did it sorry)
sweeeet
ok awesome awesome awesome time to figure this out
so i can use this database to pair a lognumber with the logentry?
since its like a table
ok time to do a lot of googling
THERES A KEYWORD INDEX

id have to add run sqlite at the top of my code tho yeah
- connect to the database(the file)
- create a table if it doesn't already exist due to some previous setup process
- insert a new row into that table
ok how does
ok ok ok let me get my brain in order
connecting to the database is "the file" a seperate file or
gotta learn some SQL. A useful skill to have tbh in almost any tech field
ok
any like place oyu rec me starting
like where did u learn
or do i just gotta raw dog it into google search
This might be a good start
yeah the
import sqlite3
con = sqlite3.connect("somename.db")
i really appreciate it
it'll autocreate the file if it doesn't yet exist
the trick is that if it doesn't exist, you'll have to run a step to set it up the way you want. But if it does exist, you dont want to overwrite what's already there
connection, yeah
you could probably get away with just a create table if not exists query you execute first
mmk
in bigger projects you'd have some setup file to create the initial database for you the way you expect it
with migrations and all sort of stuff
but starting simple...
h-haha yeah totally
it's making it idiot proof
To be fair I didn't say jack or plug but this is a right angle banana
oh
why call it a banana...
I'd have understood a right angle plug
.img banana plug
the metal tips kinda bow outwards like a banana
with some imagination
yes
honestly I gotta stop using postgres for little hobby projects it's so inconvenient
I'll just use sqlite next time...
I haven't used a non-sqlite database since college I think
governor 100% shouldn't be still using it, but here i am
most of my work is based around working with some far too big and complicated MSSQL database
Postgres for life
I probably should start looking into something like postgres... doing what I'm doing with sqlite is probably not advised
I like just having a file tho
has it ever actually caused problems
does it look like it might cause problems soon...
the only time I've had any issue was I think because of the SQLite GUI I was using
i see here how to call data using the data inputed, but how do i call using the auto cenerated id like you mentioned crumble? im a little lot on that since im scrolling though and i dont think theres anything pointing to that
The bot is probably single thread single process right? Nothing wrong with sqlite for that
Sqlite is used for some pretty big and popular projects too. It's stable and good enough.
Each of the commands do run asynchronously, but yeah. I think the more significant thing I did was mount the SQLite file into two different docker containers so both the webpage and bot could access it lol
granted, the webpage is read only
so im not in any hurry to really change it
in this case you can just use rowid which is a built in column sqlite create when you define a table unless you specify a primary index.
The id column already automatically increments by default so it's basically done for you
CREATE TABLE logs (
log_entry TEXT NOT NULL,
);
it'd probably help if you get some program that can help you look at what your database looks like
and query on it
hwews what im dealin with. thinking i can cur.excecute (SELECT) using the number = rowid
I'm gonna switch to a pc I'm gonna go nuts trying to type code on a phone screen
and then print row
fuck i gtg i need to helo my mom with grocery shopping
im bringing a notebook and some pens with me tho so i can try and write this down on paper and get it sotred out in my mind
unjumble my thoughts
thanks for all the help so far
I've never used cursor() before
idk about this scenario but cursors in MSSQL were designed by satan himself to to mess with sql devs
this seems to be a different thing
I've always just done con.execute("CREATE TABLE ...etc")
apparently that's just a shorter version where it creates a temporary cursor for you behind the scene
very kind of it
this is for T-SQL/MSSQL but I thought it was funny
seems like if you're doing mulitple executes in a row you should be getting the cursor yourself and use that cause else it will re-create one every single time
idk why this is called a cursor it doesn't seem to be what I'm used to with cursors aka pure evil
cursors in T-SQL are essentially pointers to rows in a table that you can shift to other rows(usually the next one)
the very ugly cousin of a foreach loop
LMAO
yeah the python sql guide was lie "use cursor bc you end and then make new one later so uhhh"
and i was like "ok that makes sense to me"
My new tweezers: apparently can cause reproductive issues in the state of California
oh yeah my melon soda does that too
a lot of things do that apparently
im not in cali tho so im fine /j
I don't think you're using them right
The thing inside of execute is a string, so it won't know what number is, it'll think you're searching for the literal word "number".
so i put like readlog(2) and it selects the readlog with rowid 2
You'll want something like
res = cur.execute("SELECT * FROM logs WHERE rowid = ?", [number])
OHHH right i cant put existing strings into these
I think you also need to call fetchall or fetchone on it as well
yeah
but i wanted to doubel check first
oppugh fuck you if not exists command in python
wait i can make an exception!!!!!!!!!!!
NVM
im doing this later
but i got some of it goin i think
thanks again for all your help guys
c-congrats
no one tell them about WSL
can someone take a look in my project:https://github.com/SparrowWithBrokenWing/StardewValleyMod, currently I meeting a weird bug: pets don't go to the target point and when manually move pet, pet "teleport" to target position. I attached a recored video, hope it will help.
It's few days now, I really want to know what's wrong with my code. The code is a mess because I don't have time to come out with a good design system so I hope you can get it.
#making-mods-general is probably better for this
I think the problem is in the code, also, my mode is reprogramming(is this right word) crow of game do i think it's better to ask for help here
No, this is for off-topic stuff
like "hey guys, what's the best IDE and why is it vim?"
"also, does anyone happen to know how to exit it? it's been 12 years"
Gotta keep the shitposting quotient up
my C++ professor was a diehard emacs user and I think about him every time someone talks about editors
i used VIM until I realized I could use VS Code's SSH extension for remote work and then I never touched VIM again
In my Comp Sci 1 class I did almost the whole course writing C++ in vim by SSHing into the school's server because for some reason I thought that was the only way to write it. I was computer savvy at the time, so I guess I just never thought about it just being a flat file you could edit with any editor, such as one on my own computer.
C++ feels it deserves cryptic treatment
like no syntax highlighting, "look at me i'm low level"
your cs1 class was in C++?
Yeah, we learned all the low level stuff by writing it ourselves. Linked lists and such.
we did that too but it was definitely not in the intro sequence
I haven't touched C++ since CS2
real
Prior to those two courses, I did Python in an Intro to Programming course I took as an elective for another major. Turns out it clicked with me, as I spent most of class helping other students with their code. Haven't touched Python since that class though either lol
I then switched to Comp Sci
sounds like you would have enjoyed TAing
Do I appear to be an actual software dev? People keep asking me that.
you appear to be a cat with a power drill
If you told me you held a generic software engineering position at a midsize tech or nontech company i'd believe it
Found my way to the merch store for Cypress, the testing library (don't ask) and omg they have the cutest nerdy kiddo clothes
cypress is fun, what's the merch like
wait they kinda cooked

You almost certainly have enough skills to be one if you want tbh
everyone is a software dev if they believe โจ
I don't believe
Every time LabVIEW boots and paused on loading system.reflection I'm mildly amused
i got that whole log thing to work!
heres the code rn. its ery bare bones
i have some kinks to work out but in the end i fugured it out!!!!
time for us to nitpick every little thing
thanks again for all the help yesterday
LMAO
honestly ill take whatever crit i can get
im an art student im used to it, and i know itll help me learn
theres a LOOOOT i dont know
so if you have greivences, by all means, go ahead
my next task for this project which will probably be a little thing i come back to tinker with code wise every once and a while, is amking it so i dont have to re run the code everyt ime to rad a log or make a enw one
that should be a pretty easy change
im thinking of implimenting a loop but id have to fiddle a bit since ya know
i dont know a lot
the last time i made a program repeat i shoved the whole code into a new def repeat command
and i KNOW theres easier ways to do it than that
just not quite sure what they are
or rather, how to approach them
Quick thing: I usually use ruff to format my python
Autoformatter
ohhh
why are there double indents
Nah, just something I install into the ide to consistently format my code
What about bython 
its a program that gives suggestions for cleaning up code
you'll need to either run it separately, but more popular is you set it up so your editor shows suggestions
here, i'll give you some feedback
Have you tried hitchhiker's guide to fractional sobolev spaces?
i have not
what happens if you run your program and type in "Create new log"
what is casefold
casefold is essentially a lower that lowers more characters
but like it works diff for other languages
oh i just always used lower lol
bc i think lower turns like hu
does it lower in place
I doubt it lowers in place
but i think casefold doesnt? or the other wya around
what does lowering in place mean
it means it should be action = action.casefold()
huh
Casefold just lowers more characters
basically. casefold() does not modify whatever it is run on. It has a return value you have to assign back to some variable
ohh...
huh. didnt know that. it orked fine on another project like this
well the more i know
a very simple project i made like a week or so ago
this wsa my first ever thing i coded
That wouldn't be actually lowering the case.
oh. guess i hust got lucky wiht people who tested it
Not too
mention you should use lower unless you really need casefold
original = "WitH caPitAL LeTters"
lowered = original.casefold()
print (original)
print (lowered)
as you can see the original is never changed in the casefold()
ah yes, spongebob case
yes
ohh i see
will using action = action.casefold() casue any weird issues? like should i make it action2 = action.casefold() or smth
nah, its fine, so long as you never need the original action again
also yeah. You're probably never going to notice the difference but casefold has some strange things it lowers like ร into ss
Yes
why /genuine
Casefold is worse for performance and you have no reason to use it
why is it worse for performance (i beleive you im just trying to learn more and knowing why i should or shouldnt do things helps me a lot)
Well it handles more things, so it needs to do more.
The main reason why you shouldn't use it, is because of use case. If you don't need it why use it?
fair enough
there's no real measurable performance difference between casefold and lower as far as I know
i guess if the program is big enough and youre casefolding enough things, but ig thats the case for most anything
Not any significant one.
thank you fo rthe input yall! even though its rough around the edges, i made a code that uses a database within my first week of coding, andim proud of that
its super simple yeah but im learning!! and doing things with my time!!!1
i even got an npc and maps to work in stardew coding (with plenty of help ofc) in that week!
tbh if the performance difference between casefold and lower ends up being a big enough concern in any project... you probably shouldn't have been using python in the first place
^^ it's not worth the effort of writing performant Python
yall have all been so nice to me i wanna thank you again for putting up with my admittedly sometimes idiodic questions
the most popular way to write performant python is to not write python and instead create a library written in C/C++ etc and then importing that in python...
Yup, and you eventually just write the whole thing in c anyways
im guessing performant python is like a code meant to perform certain tasks yeah
performant means fast and/or memory efficient in this case
ohhh
as in able to perform many tasks quickly and well without takinig up memory ok ok ok
im gonna learn c eventually but
its
very daunting
python trades performance for convenience a lot which means it's poorly suited for anything where performance really matters
im gonna spend time in python wrapping my head around a lot of the basics and getting used to the workflow
Python's a good place to start, don't worry about learning C for a while
the stardewmodding stuff uses javascript right?
numba 
C# or apparently json(idk I'm not a modder)
this is correct
so yeah
json covers mostly everything, csharp for what's left
that mightbe where i take my journey next after i learn more in python since i have experience in that with my cruddy mod
although, I remember Trent was working on an F# mod, so that's another possibility
it's the functional programming brother of C#
which I'm sure is followed by the question "what is a functional programming language"

functional programming vs other approaches is a whole argument you could dedicate your entire computer engineering career on 
I've been learning functional python, helps to write more performant python code, that I unfortunately have to write
interesting. functional programming isn't known for performance. More for correctness guarantees
Its to avoid using ugly nests of while loops, definitely not the best possible, but it's the next best thing
I'd rather just rewrite everything in C, but we struggle to write sensible code here so that won't work lol
so what i can gather and feel free to correct me. functional is more focused on gathering precise and accurate results and data based on whatever it is youre doing rather than doing that thing super fast and such like performant is
so while performant would be used fo rthings liek games where being fast and smooth is important
functional might be used for things like science whre extreme accuracy is more important
but they can still be used for the other scenario
jsut more the way my brain is kinda processing the ideas
I've written and deleted an explanation like 10 times
Same, its a complicated topic
A quick response would be they're both performant. Its not functinoal vs performant, its functional vs OOP
In science, we do tend to use functional programming, because we usually have a set of data, and operations we perform on that data, and we want to do a lot of things concurrently.
ok
so i guess... permormant is like functional but faster and a bit more loosey goosey?
the main performance caveat of "pure" functional programming is immutable datastructures. What that means is for example that if you had a list [1, 2, 3]. If you wanted to add a new number to this list, 4, you would modify the original list and turn it into [1, 2, 3, 4]. In pure functional programming you would instead opt to create a new separate list [1, 2, 3, 4] while leaving the original intact. (Languages that do this have clever tricks to not truly copy over the entire list but that's not something you see as a user of the language)
Performant is just a way to describe your code. Like it runs really well
functional programming likes this immutability because it makes it safer to reason about.
Like say you have a list again and you pass it to some function. In a mutable environment you do not know if the list will still look the same after the function is done without checking whether whatever you called changes it, which isn't always reasonable or possible. In an immutable environment however you don't have to worry about this because the list you sent would never change suddenly
there are functional programming languages that allow for mutation and there's a lot of imperative languages that have ways to try and have ways to make sure something cannot be modified or give easy insight into whether it will be
so it's not a clear cut thing
but that is one of the big things that is usually treated differently in functional vs imperative
the casefold()/lower() thing here is an example of what would be functional programming approved. It doesn't modify whatever you called it on, it just returns a new "version" of it without messing with the original
in a fancy term this benefit is called referential transparency
As a new programmer though, I wouldn't worry about this stuff. I've been coding for over a decade, and I'm sure Crumble has the same if not more.
Just practice coding, take some classes, and you'll eventually learn more.
I'm only at 9.5 years smh
well I guess 10...
fine, a decade
and yeah I wouldn't worry about it for now. You can form strong opinions about this later and argue with people online
and then all come together in that you all like rust
welcome to #lost-rustaceans
Idk what rust is but I'm sure I'll get there eventually
Unless you mean the game rust in which yes
Seriouy though, everyone here has been so helpful and patient, it's made the learning process enjoyable
rust is a programming language, probably not a good one to try and get into rn
Aggravation is realizing you're somehow editing the wrong file
Pro tip: if none of your changes work, try an assert False
reminding me of a much worse version of this I had with some programming language where it was just refusing to recompile some specific changes
I went insane trying to figure out why my code wasn't working
ended up completely deleting the old build for a clean build and suddenly it worked
I forget which language it was
might've been rust actually
love esoteric programming languages
im determined to learn the uwu one
but idk how to run it so no sense in learning it yet
You should make an esoteric language called esolang and cause everything to implode in on itself.
that's evil
thats just my normal code, can i have points!
the uwu language...
dear god
UwU is this fibonacci?
a iws 1
b iws 1
c iws 0
OwO *notices 100 gweatew than a *
c iws b
b iws b pwus a
a iws c
n iws n pwus 1
stawp
nuzzels a
you cant tell
That's horrid
but im dying of laughter
I love ot
theres also PythOwO
the name reminds me of an actually legitimate language which in my mind is still esoteric
A stack-based array programming language
i want MC commands as useable code
but sadly i havent found anyone thats done it yet
MC commands are already usable code
i meant syntax and all
i cant slap execute @e{type=arrow} ~ ~ ~ run summon arrow ~ ~ ~ into a terminal
I do wonder what exactly that would do
you did remind me of sethbling's compiler for datapacks
basically created his own language that then compiles into valid minecraft datapacks
i just wanna state how much i hate python and pip, they NEVER seem to work Path wise
grumpy noises
all my homies hate pip
I don't ever use python but I've had to install stuff with pip a few times and half the time it just breaks
it really does 
it have more fever dreams than AI does
i swear, it works only when it wants
im dying
hahaha
Wasn't it originally command blocks too?
I never use pip on my host machine. I either use python-* packages or a container anymore
if stardew valley was programmed in assembly how different and faster would the game be? Sorry i've always heard that assembly is crazy hard to program
The short answer is "it wouldnt be", as it's not really feasible to program stuff in assembly anymore. Since SDV needs to run on modern computers and consoles, you have to use the functionality that the console creators allow you to use, which doesn't really accommodate assembly (at least not very easily).
Uv looks super promising
But I don't really do personal python projects that often anymkre
I tend to use dotnet8 or rust these days
assembly also isn't a cheatcode to good performance. Assembly only gives you good performance if you actually know what you are doing which, chances are, you won't be
you'd be able to run it on anything if it was programmed in assembly? I'm just wondering about the pros and cons, I remember rct being programmed with that back in the day
When you program something in assembly, you have to program it for a specific processor type, so it actually would run on even less things than it does now, for example he'd have to completely rewrite it from scratch for modern Macs
The pros are basically none these days
Thereโs lots of rendering shit that would be super painful probably
Beating the compiler in assembly requires you to be smarter than a compiler dev
And compiler devs are scary smart
Ah I see
I donโt want to write an audio driver by hand, either
coward
Sometimes I have quibbles with how the compiler choses
compiler devs wouldn't even see me I am less than an ant to them
It sounds like you have to be mad man to program any new games in assembly nowaday from what it seems
But I wouldn't be able to do better across any decent project
I am but a simpleton who does not touch my wifi drivers or my audio drivers
There are games being made in assembly, but for systems that have the tools to support it, like old NES and Game Boy and such. You'll still find people making new games for them
I was just playing a new sega game today, although that one was made in C i think
weak
but maybe in assembly you have more control over your code? I'm no programmer but I love to research this stuff from time to time
Control... I suppose. But it's not a level of control you need anymore and you'd prevent yourself from using any other tools that exist to make things easier
you'd just be making things more difficult for yourself with essentially no benefit
I know enough game boy assembly to get around, but even then if I were making a game boy game I would just use a C compiler
and you too can learn game boy assembly with my overly verbose guide coming soonโข๏ธ
I had a lot of fun using mips back during computer organization class
Was gonna make a small game with it but couldn't find an emulator that had all the features I wanted
What about game boy color assembly? Somebody should make The Legend Of Zelda Oracle of Secrets! How possible would that be if you knew the know how in assembly, how different is og boy vs color? @pliant snow
Somebody should make The Legend Of Zelda Oracle of Secrets!
I think they already did lol
OG game boy vs Color is extremely similar. It's the same CPU and functionality, the only difference is how the graphics are laid out
oh secrets, I read seasons
theres no difference between game boy and game boy color assembly tho
Those games, seasons and ages had a third version called Oracles Of Secrets, they scrapped it for the gbc. It would've been neat the play that third version
if you wanted to make that, you probably would start with just hacking the released titles rather than creating a whole engine from scratch
You'd have to change game mechanics. this is what someone says from a reddit post "According to what I've read the original idea was actually for the third game to be about colors. Nayru was originally going to be a painter and you were going to use a magic paintbrush to solve color puzzles.
Meanwhile Farore was going to have the time travel mechanic, except it was only going to change the time of day, not send you back and forth 400 years.
Eventually the third game was scrapped and the time travel mechanic was moved over to Nayru's game as that one was reshaped into the Oracle of Ages, but the color mechanic still survives to a degree, that's why there's so many puzzles based around colors in that game."
speaking of game boys and rust tho if anyone wants to proof read a series of articles about a Rust game boy project ๐
I've read at least a paragraph of it once
Hopefully somebody someday makes this https://www.zeldadungeon.net/wp-content/uploads/2021/02/secrets2.png
Insert meme of celebrating because the error message changed
there is now many more paragraphs
if youre really lost-crustaceans, what greater joy could there be
actually using rust
gross
you're right. Rust is bout praising it online, not using it
My brain as I watch the VSCode talk in #making-mods-general
I don't know, it has a debugger
True. I argued that myself... even though it's an awful debugger
I've gotten it to work, but its awful and I don't recommend it.
I still remember watching my ram usage climb to 64 then my computer crashing.
/me changes position of two lines of code that should have nothing to do with each other
code works now
(Timing issue I think)
I even found my screenshot of the aftermath
This one is probably just windows not being great at handling out of memory though
Is anyone good at handling out of memory?
My computer keeps on crashing because opengl can't allocate more memory
My VS memory leaks when I try to profile anything
when I tested some LLM junk, python was pretty good at telling me "your graphics card doesn't have a terabyte of memory, reboot with lower settings" 
operating systems themselves, generally pretty upset about it
Arr you sure you don't have a tb of vram
windows says I don't, and I trust it completely
(that said, it's also bad about freeing up memory after python scripts sometimes)
Brand new sentence โI trust windows completelyโ
I swear Matlab has haunted shit in it regarding memory usage
Specifically with recording videos
Autodesk did to me for sure, had to factory reset to purge it completely
Yipes
O matlab. I had to use it for a class once, worst experience of my life. Just ened up writing code without ever running it
They don't implement thread affinity properly 
wish there was a less stupid way to specify that a method should only return the implementing type on an abstract class
maybe I could do something with interfaces but god there's already so many generics
c# I love you but sometimes you have some Serious Holes
Sooo the curiously recurring generic pattern?
interface ISomething<T> where T : ISomething<T>
I've recently found that you can completely balloon your memory usage and clog up the signalr message bus in Blazor Server simply by holding a key down while whatever you focus on has an @onkeydown
I just watched my memory usage go up to 900MB
just by holding down a button
luckily the feature to control this has been moved further and further back...
first was planned for .net 8, then .net 9 and now it has already been moved to .net 10
had to rewrite something for work to avoid this dang issue 
How can they consider this a low priority issue? 
they work in mysterious ways
Makes me glad I'm not interested in Blazor!
it's a very versatile web framework but yeah stuff like this is just baffling sometimes
Gotta beat me screwing around 10+ years ago making super trivial pages using C++ because I can. 
maybe its an easter egg
I love how actually possible that first comment is.
mainly cause they're an emacs user
We have a goose couple that comes back to our office building every year to nest. Except its up against the building along the driveway to get to the back of the building, where we all park. So the male is constantly attacking our cars as we drive by. Luckily we can go into the neighboring building's driveway and get to our back lot from theirs, but their driveway and lot are a bunch of crazy angles and hills, so it's not great. Anyways, geese can suck a lot of the time.
okay guys so i need help with transpiling
I get the concept
but is there an easy way to get the equivalent CIL code i need to generate by editing the decompiled game functions?
I use Rider on MacOS
I assume every goose yelling at me is yelling about ui/ux sins
The more geese you have angry at you, the more sins
it feels so good to see strings you recognise in an assembly/c decompile
mov
ooooh
debug features are in the switch build
heh
the smapi diagnostic check is in it too, doesn't make sense to remove it tbf
.. what?LooseSprites\\TutorialImages\\FarmTut
huh, /printdiag doesn't exist, most odd
:o it has the macro running text
I too did this, though it was when I didn't understand C++ very well so I didn't get much done ๐
:o i found the chatbox
oo savegame class
there's no save fixes it appears
nvm it has the lastappliedsavefix field
Can transpiled harmony patches access mod namespaces?
Just for accessing static / const objects / functions / primitives
you can access anything with reflection
even private methods
you can break just about anything with reflection
I have no idea what a harmony patch is but I assume a modding thing
yeah
Yeah it's a code injection library that comes bundled with smapi
You can patch existing game functions to implement modded features
Prefix and postfix are simple enough
Transpilation is somewhat more advanced
Wtf is reflection
It's "let me see your private things, please".
I believe it comes from this? https://en.wikipedia.org/wiki/Reflective_programming
awwwww this lost the fun name: https://soasis.org/posts/a-mirror-for-rust-a-plan-for-generic-compile-time-introspection-in-rust/
it used to be called introwospection
Unusable. Rust is dead now.
Friendship with Rust over. Becoming even more insufferable - learning OCAML
Aww, man... I mean the renewal process is easy, but...
reflection is what I do when the type system fails me or would make things more complicated than it's worth...
the next step
I still don't know why people are suddenly getting into ocaml lately
I don't want to
reading haskell enthusiast forum posts feels like I entered some conference for theoretical mathematicians
I've done an entire year of advent of code in haskell and written a simple compiler in it for school but still I feel like people who really love haskell are living in a different universe
try uiua, I'm currently taking part in a small code golf competition and uiua is the meta, is pretty fun to learn imo
please, you think crumble hasnt tried uiua
I've done 2 days of advent of code in uiua...
๐
uiua is a little much for me
especially uiua that isn't extremely inefficient
I think I just did the one where you had to find 2/3 numbers in a lost that add together to 2020
normally a fairly trivial problem and in theory trivial in uiua but my solution was slow as hell, it took like half a second while my rust solution took like half a millisecond or something
the uiua solution had like a ton of Cartesian products in it
found it
how do they expect you to type that
you write the actual function name and the formatter replaces it
for uiua, yes. Most other array programming languages have specialized keybinds per character
APL even has dedicated keyboards
Habha
I refuse to believe array programming languages are used in production anywhere
oh right I also had the short version for this:
โ(รท6/+โญรโ(=2020โ+โ+..)(โรโร..))(รท2/+โญรโ(=2020โ+.)(โร.))โparseโ @\n.&fras"input.txt"
I'm sure it could be much shorter
My uiua code to give the first 100 prime numbers : โต((&p|)>1โงปยฐ/*.)+2โก540
yes, this doesn't look optimized
definitely not optimized in any sense of the word but I can't even read my own code here
I think the rice paddies ็ฐ things are the Cartesian products
I forget
one of the participants in the code golf competition is so good at it, he got a solution shorter than mine in half the time it took me to get mine for every exercise
its "apply a function to every combination of elements of 2 arrays"
I've never done code golf though I understand the appeal
so yes
I'm honestly more prone to overly verbose code for the sake clarity
split calculations into pieces just so that I can give proper names to intermediate sections of the calculation...
of course, me too when I'm coding for stuff that isn't code golf
would be very counterproductive in code golf to be verbose...
either way I like uiua because it's the first time I code in a stack based array language and it's pretty funny to work around no variables
it's write only code but at least it's fun
all my code is write only
how do you get approval on your PRs
Chocolate
that would require reading their feedback, so i just keep clicking the submit button until something happens
Hii, can someone help me install a mod to stardew valley? Like I read a bit about it and saw I need to install Smapi and Content Patcher, are these two reliable and without viruses?
They are, they are widely tested and used for mods
However, you'll probably have better luck for advice in #archived-modded-support
Oh thank you!
i think thats the right one
hey guys anyone familiar with CIL / transpiling?
do branches with two operands pop them from the stack?
I wonder if anyone will be able to get with Moolah's Money Mod ngl
I need some help with my transpilation code
I'd love to help you but I barely know what transpilation is
I mean I've technically written one before but even then
I feel like if anyone did want to help they'd need to know from what language you're transpiling and into what other language
given the discord I'd have to assume c#, though given the channel could not be
though the question remains what the target language is then
I did once write a very basic and not even close to feature complete transpiler from C# to some funky little finite state machine
idk at what point it stops being transpilation and becomes compilation
I guess that's more a compiler since a finite state machine is a much lower level abstraction
C#
stardew related
actually it's more of a CIL question
do branch statements pop their operands from the stack?
I'll be keeping an eye open for this help actually happening, because I need to steal the wisdom.
I find the question weird, since operands normally are unrelated to the stack, other than for the instructions which literally put them on the stack
Like ldc.i4
I know next to nothing about CIL, although its stack based isnt it? So one would assume yes
could someone take a look at my transpiler code and tell me why I'm getting a mono.cil opcode exception?
https://github.com/arannya/BoomerangMod/blob/main/Patches.cs
i shouldn't have said operand, i meant branches such as bne that operate on the top two elements of the stack
I have a suspicion that my use of bne is wrong... CIL probably can't compare two strings that way
do i have to call a function? e.g. string.equals for this?
pretty much any instruction that reads from the stack, does so by poping
in other words, let's say i loaded two ints on the stack, then i beq'ed somewhere else, i don't have to worry about popping them?
is calling string.equals the simplest way to compare strings in CIL? or can strings be compared directly?
the simplest way is to call your own static method which does whatever you need
instead of trying to figure that out on the CIL level
The more complicated you make the CIL, the more likely you are to break things
am I using Label properly in my code?
KISS applies to transpilers (Keep it simple S****d)
You can say stupid on the internet
i.e. don't unnecessarily overcomplicate things. You'll regret it later.
my philosophy is the opposite
build anything as if it needs to handle a billion people using it even if the only person to ever see it is me
you seem to be using Label correctly. except don't use Bne_Un_S, just Bne_Un
Begin with the contribution guidelines
(i didn't check if this IL makes sense though)
get the readme and contribution guidelines set up and then cargo new
but that IS how you use Labels in transpilers, yes
There is such a thing as "over-engineering" and/or "over-optimizing" before you have working code
I'm the master of both
yield return new CodeInstruction(OpCodes.Ldarg_S, "weaponItemId");
this definitely is wrong though
SpaceCore has a nitfy "identify locals by name" thingy
Otherwise, this expects a short value
that's an arg though
Yeah, either case this needs the index of the argument, not the argument name
and please don't use the _S variants, you're making it harder for yourself
You can use the _S variants fine tbh
As long as you use a byte
Especially for arguments
Anyways
== has a name
Is op_Equality
y'all doin some arcane stuff
I'm trying to puzzle out what the _S variant would be without Googling going just by the context of Atra saying "as long as you used a byte"...
_S = short
Oh, well that's fairly obvious in hindsight.
that's what I assumed
The _S variant just means you do (short)5 instead of 5 that's the extra work
not that I have any idea what on earth ldarg is
Or 5s perhaps?
Damn i thought ldarg with vaeiab(e name works cauae i saq it in dot peek
educated guess would be that ldarg is should for load argument or something
Yes, it is exactly load argument.
what that actually means though I don't know
Ldarg are for arguments, Ldloc are for locals
Both refer to the arguments or locals by their index (not name)
Push that argument to stack
(this whole talk should really be in #making-mods-general and not crossposted here)
Also you need to be careful with ldarg because static functions start their arguments at zero, while instance functions start their arguments at 1 and the instance itself is zero.
I've never even looked at IL the dotnet IL this might as well be machine code to me
We aren't necessarily getting into SDV specifics yet
Harmony is a whole programming topic on its own
In fact, you may get more help on Harmony's official Discord
Talking about IL isn't even necessarily harmony specific. You can write methods using IL.
True, although I wouldn't know where to begin doing that
Stuff like ```csharp
internal static Func<T> CreateGetter<T>(this FieldInfo field) {
if (field is null)
throw new ArgumentNullException(nameof(field));
if (typeof(T) != field.FieldType)
throw new InvalidCastException($"{typeof(T)} is not same as field type {field.FieldType}");
if (!field.IsStatic)
throw new ArgumentException("field is not static");
if (!FieldGetters.TryGetValue(field, out var getter)) {
DynamicMethod dm = new(MakeAccessorName("Get", field), typeof(T), null, true);
var generator = dm.GetILGenerator();
generator.Emit(OpCodes.Ldsfld, field);
generator.Emit(OpCodes.Ret);
getter = dm.CreateDelegate(typeof(Func<T>));
FieldGetters[field] = getter;
}
return (Func<T>) getter;
}
Harmony is still magic to me
when would you ever write something in IL instead of just writing it in C# or something and then compiling it to IL
I've delved into doing non-Harmony IL stuff once, it was scary
I did a thing where I created generic delegates and had to generate IL
Writing something in IL lets you do two things:
- generate a function at runtime that's highly specialized for a specific thing that isn't obvious at compile time (probably, but rare)
- generate a function to ignore access stuff without being slow as fuck like normal reflection
I mean I've never had a use for doing anything with the IL other than look at what it generated in very rare cases but I guess this is a thing that's done in modding
Slightly on topic but SDV writes raw IL to generate the splitscreen state swap code
Granted in .NET 8 you can set up to ignore access restrictions, but if you're stuck on, say, .NET 6 for some reason...
(I wrote that fun bit of code...)
creating duck-typing proxies like my lib Pintail does; making a weird hook thing that lets you pass in any Delegate, skipping any arguments you don't care about, and making it work with some full method definition somewhere
This monstrosity from my "who knows if it'll ever be released" mod https://github.com/LeFauxMatt/StardewMods/blob/c882996551dfe0cdcc4f2ab09c239dbf4a38b862/SpritePatcher/Framework/Services/NetEvents/CachedEventInfo.cs#L151
My IL generator use case was dynamically subscribing to net events as part of a content pack format
I'm learning more and more that modding involves doing some arcane stuff that you would definitely never ever use or even get away with using in most traditional software projects
that's correct
Unless you own that project!
you can get away with anything if you own it
Unless youare reverse engineering rival products
Video games are all about slapping code together
@thin estuary @devout vault by the way, since I see both of you here and you helped me. I was able to use Pidgin to make my search parser thing https://github.com/LeFauxMatt/StardewMods/blob/develop/BetterChests/Framework/Services/SearchHandler.cs
reverse engineering rival products sounds like it'd be interesting and maybe illegal I'm not entirely sure
nicee
One limitation of this is that it doesn't currently handle multiple binary expressions chained together
Pidgin?
I kept on getting stack overflows when I tried supporting AND and OR recursively
Looks spooky
ah now parser combinators are something I know
It still needs work, but it works well enough for now
One big company i worked at defo do it
I can do things like "(this or !that) and other"
I only know Pidgin as an IM client from the olden days...
That's what I was thinking, DH
Thought the same
Ah, that is spooky. I haven't done that since college
I like parser combinators they're fun
Anyway, the consensus is that the feature, although technically sound is not very-well liked in the hands of average mod users
But like, I make most of my mods for myself, and share the results with others
It's funny too because the default config options I ship with are the ones I want to play with
I still like that my biggest mod came from me watching the Haunted Chocolatier trailer, and thinking "hey, that would be cool to be able to do in Stardew!"
So when people ask me to change it, it's like... I'm already being nicer than I have to by offering options.
My biggest mod came from "if I need to scroll through this entire twenty pages of recipes one more time I am going to strangle someone"
it'd be cool to watch the hc trailer in stardew?

Meta
someday I will install smapi and try a mod
...Haunted Chocolatier trailer cinema movie movie mod for Stardew?
It'd make more sense to have trailers preview before movies
Do you... play Stardew Valley?
Wait, that's on topic, sorry
uh I've technically played sdv since the very first hour the game got released but I've never reached year 2 
Because, if you ever get into mod making, those days are over /s
Spring Day 3, for all eternity
no worries there I never play the game to begin with
I joined this server in the hype of the game releasing "soon" but then never really got that into it when it did finally release
but made friends and stuck around anyway
Modding is notoriously debugging the same day to test one thing
that's honestly just software development
Facts. Although Software Development it's easier to make proper unit tests.

