site banner

Wellness Wednesday for July 5, 2023

The Wednesday Wellness threads are meant to encourage users to ask for and provide advice and motivation to improve their lives. It isn't intended as a 'containment thread' and any content which could go here could instead be posted in its own thread. You could post:

  • Requests for advice and / or encouragement. On basically any topic and for any scale of problem.

  • Updates to let us know how you are doing. This provides valuable feedback on past advice / encouragement and will hopefully make people feel a little more motivated to follow through. If you want to be reminded to post your update, see the post titled 'update reminders', below.

  • Advice. This can be in response to a request for advice or just something that you think could be generally useful for many people here.

  • Encouragement. Probably best directed at specific users, but if you feel like just encouraging people in general I don't think anyone is going to object. I don't think I really need to say this, but just to be clear; encouragement should have a generally positive tone and not shame people (if people feel that shame might be an effective tool for motivating people, please discuss this so we can form a group consensus on how to use it rather than just trying it).

1
Jump in the discussion.

No email address required.

Not a wellness question, but I don't want it to get lost in the old small scale question thread:

I've always been mildly interested in programming, but my formal training in it was only in the absolute basics of Javascript in school. We didn't even get to pointers in C, to give you an idea where I bottomed out.

However, my fondness for rat-adjacent spaces makes me probably one of the people who sorta somewhat understand programming concepts as much as possible without actually being able to code well.

I can mostly follow code or pseudocode, but I've noticed that programmers mostly leverage existing functions in libraries or APIs to massively abstract their work.

My issue is that I simply don't know most of the interesting functions that might be relevant if I have a specific concept in mind. I don't know whether there's an existing function I can call, let alone something I can import as a library, like math.js. I know that there's plenty unknown to me, and unknown unknowns I couldn't possibly estimate.

I can definitely ask GPT-4 about such things, but leaving it aside, how do I understand the options available to me as best as I can?

For example, when I look at a little of the code for the few ML models I've learned, it seems simple enough if you can abstract a lot of it. I simply don't know what to abstract.

How do I build this fundamental knowledge? I suspect it involves something I'd find mildly unpleasant like reading documentation, textbooks, or trawling through code on Github. But I'm asking just in case a more interesting alternative exists that I'm not aware of.

I'll pre-emptively tag @DaseindustriesLtd, because of course I will haha. But I know there are plenty of you programmers out there, don't be shy!

If it helps, I have the following concrete interests-

  1. Modding games. I'm aware reading documentation or code is mandatory here. I'm sure @ZorbaTHut would be mildly pleased to hear that I'd like to make small mods for Rimworld, especially if AI makes generating art assets easier.

  2. Small automation tasks on my PC. GPT is helpful here if I know what to ask.

  3. ML, just enough so I could apply it to medicine if I needed to. I'd like to think upskilling myself there might lead to more money if I can leverage my medical degree into a career involving it.

For modding games take a look at dnSpy. It lets you open any .net assembly (compiled c# dll) and decompiles it into surprisingly readable code*. Comments and variable names are missing but class structures, method and attribute names are present so it's easy enough to tell what's going on with some digging. You can modify and recompile the code into a new assembly dll file.

This effectively means you can mod most games that use the Unity engine. In all the games I looked, Game_Data/Managed/Assembly-CSharp.dll will contain the game entry point, but larger games may sprawl out into their own assemblies that are referenced by this file. dnSpy should open those automatically.

I used this method to patch the recent Derail Valley update where they introduced a new difficulty system. I picked the "realistic" setting in a new game but found the teleport feature was limited to about two metres ahead, versus the twenty or so metres it used to be before. This feature is meant for VR to avoid motion sickness but I just use it walk faster between the train and track switches. I eventually traced it to a hardcoded class initializer for all the difficulties and modified one attribute (it was easiest to look at the IL assembly and change one instruction). Saved the assembly and now I was happily teleporting from one end of the train to the other in a tenth of the number of hops as before.

This method won't work if you see references to il2cpp as that's an optimization where the original assembly was turned into c++ code and compiled into native machine code. This is much harder to reverse engineer and is effectively impossible to meaningfully decompile as entire class structures and functions can disappear and type information is lost during compilation.

  • Curiously you can even pick between c#, visual basic and f# (iirc), as all three compile into Intermediate Language and can be decompiled back seamlessly, making them interchangeable. You can't even tell what the original source language was.

You can't even tell what the original source language was.

Maybe not if it was VB code, but F# code is obvious when decompiled into C#.

This seems a little advanced to me, especially since Rimworld only uses C# and XML, but I'll keep it in mind if my horizons expand! Thank you.

Rimworld specifically uses a lot of dnSpy, coupled with a tool called Harmony to patch code at runtime. I don't have a link to this, but go hunt down the Rimworld modders discord - I haven't been there in years but they were always a good bunch of people.

If you're doing something of the form "add new stuff to the game" then you won't need dnSpy/Harmony; if you're trying to change existing mechanics, you probably will.

I aim to start small and see if my appetite persists. I can always ask around in the Combat Extended discord server too, they're used to stretching the game's code fat beyond it's initial capabilities.

Obligatory plug, since it's been brought up: the Combat Extended lead developer is working on a standalone game.

(we've been chatting on Discord a ton, good guy)

I'm incredibly hurt that you'd think I haven't long been aware of Ascent of Ashes (I knew what you linked without opening it) ;)

Look, I'm a CE fan, and in our previous debates I've always stated how I feel more simulationist elements would make the game much better in my eyes.

For example, the recent Biotech DLC made my eyes bleed when I saw the implementation of "genetics" in it.

Hell, I even thought of pinging you when I saw this mod come out:

https://steamcommunity.com/sharedfiles/filedetails/?id=2996971119

I didn't, in the end, because I didn't want to unnecessarily disturb you (or I forgot haha), but as a junior doctor whose seniors have had to patch up the mess I've made of a minor procedure, god knows I appreciated it.

(Another thing that drives me up the wall is the inability to have multiple doctors perform procedures in parallel or cooperatively, from a gameplay perspective it would certainly make having more than 1 or 2 or them worth it, or multiple pawns working together at all)

I'm looking forward to AoA, though I have the minor gripes that I don't really like the art style, it's rather ugly even by indie standards. But I play Rimworld, so you can see where my priorities lie. I'd play just to have z-levels as a basic feature!

Hell, I even thought of pinging you when I saw this mod come out:

https://steamcommunity.com/sharedfiles/filedetails/?id=2996971119

Hah, entertaining. Hadn't thought of that one myself :D

From a gameplay standpoint . . . I dunno, one downside to stuff like this is that it makes it much easier to grind specific difficult jobs. It's kind of weird if you have a doctor just waiting for someone to get injured so they can chaintend them for the next three days straight, right? Maybe "xp is granted only for the first tend" but now we're adding weird unintuitive explanations to it. And this still cuts down a lot on the risk factor of choosing who gets tended with what medicine.

I think this might be an example of something that (1) doesn't result in good gameplay, and (2) isn't even necessarily realistic - like, if an apprentice doctor cleans a wound badly, well, it's possible they did damage that cannot be fixed, and if we're diving so deep into this that we're trying to simulate that as well then the question becomes "is this the best use of developer time or can we find something to work on with better bang for buck".

(Another thing that drives me up the wall is the inability to have multiple doctors perform procedures in parallel or cooperatively, from a gameplay perspective it would certainly make having more than 1 or 2 or them worth it, or multiple pawns working together at all)

This sort of thing might just be code complexity; Rimworld's job system doesn't really support "two people working on one project", and it's unclear if it would be worth building it just for something like this. (In this context, "actions on a specific character" is a project - the character is locked until the task is finished, so even "two people working on unrelated surgery jobs" would be hard to implement.)

I strongly suspect that in a counterfactual world where this had been the default implementation (with additional balancing), there would a clamoring crowd of precisely zero people who'd be advocating for the version Rimworld has today.

I can certainly think of trivial solutions, like a critical failure in tending exacerbating the wounds or progressing an infection (the latter is more dubious, but I can suspend my disbelief, if we assume that represents crappy quality of care spreading an infection to other parts of the body)

In this context, "actions on a specific character" is a project - the character is locked until the task is finished, so even "two people working on unrelated surgery jobs" would be hard to implement

From the Ideology DLC, it seems to me that there are mechanisms in place to make pawns gather at one spot and surround it.

I might be wrong, but I can see an implementation that simply has two or more doctor pawns standing at the bedside, throw up an interaction taskbar, and then have the process proceed according to a weighted value of their skills. It should certainly be sublinear and have diminishing returns with added pawns and medical skill, there's a reason we don't usually have 20 surgeons elbowing each other at work on a single patient haha.

The Biotech DLC sort of does this during childbirth with the midwife, and one bystander, usually the spouse, standing close by.

Now I'm no expert, if this thread hadn't revealed that, but unless the code is really spaghetti, it should be a tractable problem.

While I'm on it, I'd much rather diseases be of the communicable sort where possible, since I don't see how an isolated colony in the middle of nowhere can develop the flu or plague all at once. (I'd hate to see their Epidemiologists grapple with social distancing when Covid-5500 hits).

It could be a hidden hediff for visitors or traders, with a small chance of being spread.

But of course if I nitpicked every little detail in Rimworld that drove me up the wall, we'd be here all day. Suffice to say that I have 600+ mods of which I'd call 200+ "must haves", that should illustrate my degree of dissatisfaction with the base game haha.