Topic on User talk:Hautarche

Jump to navigation Jump to search
Hautarche (talkcontribs)

This isn't a total overhaul of the Recreation page, despite how many edits I made to it. I have yet to check some things regarding gather spots, reigning from a throne, or anything regarding caravans or recreation fall rate. I just wanted to put the information that I found out about recreation gain rate while filling out the Anima Tree page in and then realized this one needed a lot of work, so let's do this point by point:

- "10 types of recreation": With the book system introduced in 1.5, there are now 9->10 distinct types of recreation. To be sure, I checked for all mentions of '</JoyKindDef>' using the Find in Files tool on the entire RimWorld folder, and then also checked to make sure there are no def classes that are derivatives of JoyKindDef.

- "Recreation gain rate": this is handled via the Need_Joy.GainJoy method. I found this referenced in JoyUtility.JoyTickCheckEnd (which itself is appended to every tick of every recreational activity's JobDriver), on every tick of JobDriver_VisitSickPawn (used to give the sick pawn joy as well), BabyPlayUtility.PlayTickCheckEnd (gives joy to pawns for playing with babies), and a couple other methods that I haven't had time to look at yet (pertaining to parties, caravans, ritual duels, and food/drug ingestion). In the three cases I looked at, the "base" joy gain is defined as 0.000144 (or 0.36/2500) per tick, which is why I call 36% the base gain rate per hour. In the case of JoyTickCheckEnd and PlayTickCheckEnd, this is then multiplied by the joy gain factor stat of the joy source building (if any); since VisitSickPawn never involves a joy source building, we can generalize this rather than noting the technical backend exception. In the case of JoyTickCheckEnd and VisitSickPawn, it is also multiplied by the recreation-seeker's job's joyGainRate, so I did another thorough Find in Files search for </joyGainRate> and noted down all the joy gain rates I could find (if a JobDef's XML does not specify, it defaults to 1x). Regardless of where it's used, GainJoy always multiplies the amount by the relevant recreation tolerance.

- "Activities table": was missing Reading, obviously, but was also missing Baby Play, which is easy to miss as it is not technically a JoyGiver - I only caught due to the searches I carried out in the previous point. Duration of meditation was wrong (source: XML). Gain Rate was misrepresented as a static value for some activities. There was no explanation for duration; while what it does is kind of obvious to anyone who has played the game, I both read the C# and tested in-game (along with altering the values in XML between tests) to verify that the explanation I have included as a footnote is correct. Cheering up a patient misleadingly claimed "Injured" as a required capacity, which wrongly implies that the pawn seeking recreation must themselves be injured - I felt it was better to leave that blank and just describe in detail in the dedicated text section for that activity below.

- "Activities": I went and read the JobDrivers and JoyGivers for every single one of them, and then implemented tests in a modless testing file to verify my understanding. I also wanted to ensure that each subsection actually details at least the following information: what conditions must be fulfilled for this activity to be available, where a pawn can perform this activity, and what pawns do when performing this activity.

(Cheering up a Patient and Watching Television were entirely missing, despite neither one being more intuitive than Going For a Walk; Praying and Meditating were falsely equivocated with each other, and along with various other activities were incredibly sparsely detailed which was starkly funny when compared to Relaxing Socially having an entire prescriptive (and somewhat incorrect) digression on the best way to handle gather spots.)

Hautarche (talkcontribs)

Building Snowmen: conditions were derived from the JoyGiver. The JobDriver did not provide mechanically relevant information, but did provide three interesting bits of trivia: snowman building speed = 1.7x the pawn's construction speed, and it can trigger 'Passion for my work' if the pawn is passionate about Construction, but it does not train Construction skill.

Cheering up a patient: was entirely missing. Derived from its bespoke JoyGiver and JobDriver. It was actually really interesting to learn about - and verify - the requisite conditions and strengths, because I've had sick pawns turn into a black hole that suck up my healthy colonists' time before and could never figure out how to get it to stop. If you have spare space in your hospitals, consider placing stools close to each bed for visitors' sake.

Meditating: pseudorandom capability based on ID is set by the pctPawnsEverDo field in its JoyGiverDef. Recreational meditating actually has the exact same JobDriver as meditation for Royalty-related reasons; it just flips some conditional switches if you have Royalty and/or Ideology.

Billiards: everything I wrote is obviously how billiards tables work, but I also verified it by looking at JG and JD as usual. Filled out the details I consider necessary per subsection, as detailed in the previous post, no matter how obvious they are to anyone who has used a billiards table before.

Chess: ditto. Is it obvious that the chairs have to be horizontally or vertically adjacent, rather than being usable on diagonals? Well, I've met someone who didn't even know the chess table NEEDS chairs. Don't chess tables give you an alert if they don't have chairs? I digress.

Hoopstone, horseshoes: ditto. Accuracy never hurt anyone, unless we're talking weapons.

Poker table: went with the precedent set forth by Billiards' description and noted its relative skill-training power.

Game of Ur: and conversely, noted this one's lack of instructive efficacy.

Praying: capability again set by pctPawnsEverDo. JG and JD for mechanisms as usual, though this was by far the easiest one to test all conditions of. Strangely, there are clauses for what rooms prisoners should pick to pray in, even though prisoners (of any faction, including the player's) do not have a recreation need.

Reading: JG, JD, extensive testing. Discrimination by book type is derived from BookUtility.TryGetRandomBookToRead, which evaluates each of the book's outcome doers based on their DoesProvidesOutcome function. The 'find a good reading spot' was very fun to test, and I actually needed to test it because I could not tell what was supposed to happen if no good spot was found just by reading the code. Decided to borrow the wikitable structure from the Anima Tree page to discuss Novel quality effect on joy gain.

Relaxing socially: JG, JD, testing. You can pretty trivially test the former claim that pawns prefer closer gather spots - no they don't, they'll go anywhere. I haven't conducted a robust search for all gather spot objects in the game, so we may still be missing some. This subsection needed to be more compact; it took like three sentences to say you could toggle gather spots, and did not provide a directly obvious causal link between gather spot toggling and adventures in dangerous mining pits.

Skygazing: it was already very correct and very thorough, just more long-winded than it needed to be. All I did was provide the specific maximum rain/snow level for skygazing and add DLC icons where appropriate. I thought its rain/snow level language was very good, so I borrowed it to describe the same phenomenon where relevant to other recreation activities.

Using telescope: cleaned up some potential confusion on wording (e.g. 'outdoors' and 'unroofed cell' are two very different things). Retained the "Oddly..." sentence.

Viewing art: JG, JD, testing (I mean this is true for all of them, we can stop saying this). Verified that all 'sculptures' in the game (including terror sculptures, cube sculptures of all kinds, and void sculptures) are usable for this activity: they have CompArt courtesy of CompProperties_Art, and all of them specify 'canBeEnjoyedAsArt' as true which makes them unconditionally usable for viewing art. The JoyGiverDef XML says that viewing art can be done while in bed, but the JobDriver is not configured to allow this to occur, even if an art piece is adjacent to the head of the bed.

Visiting grave: entirely correct, it was just missing what pawns actually DO when visiting graves.

Watching television: was entirely missing. Moved around a lot of beds, opened and closed a lot of doors, and built and tore down a lot of walls to make sure I had got the correct gist of how the viewing area is determined.

Musical instruments: was entirely missing. The ThoughtWorker code for the mood bonus seems to imply that the max range one can be from the instrument to still receive the thought is based on pathing distance rather than linear distance, since it incorporates a ClosestThingReachable argument, but increasing the path distance between a listener and instrument does not actually impact how far away they can be from it to still hear it, while moving the pawn two steps to the left into a different room suddenly cuts them off. I think Ludeon wanted to implement some sort of soundwave-travel effect into the radius, but then realized it was either player-unintuitive or nonperformant and just left what's basically an intronic sequence in the code. To test that drums aren't musical recreation options, I went Mr. Beast mode and locked four recreation-starved pawns in buildings each with a different instrument type; the one in the drums room never pursued recreation with them, no matter how many times I un/drafted him.

Playing with baby: does NOT have a JoyGiver. Does have a JobDriver. Before I had fully read the JobDriver (and the three associated sub-job JobDrivers) I erroneously assumed toyboxes had to be adjacent to the baby. This is not the case. In fact, the player does not even have to touch the toybox.

Speeds (half-speed, third-speed) were determined by the locomotionUrgency which pawns are set to by the JobDrivers. Amble (as in walking play with baby) multiplies pathing costs by 3, whereas walk (as in go for a walk) multiplies by 2.

Harakoni (talkcontribs)

What is the actual equation for snowman building time? Because 1.7 times the pawn's construction speed is ambiguous and could be interpreted as pawns with higher speeds take longer to construct a snow man

Hautarche (talkcontribs)

Good point. The amount of work to build a snowman is 2300, and each tick spent building the snowman performs 1.7x the pawn's construction speed worth of work, as phrased:

this.workLeft -= doWork.actor.GetStatValue(StatDefOf.ConstructionSpeed, true, -1) * 1.7f;

Reply to "Recreation details"