Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand Home Photos to Use Variable Snippets #75405

Merged
merged 6 commits into from
Aug 3, 2024

Conversation

TheMurderUnicorn
Copy link
Contributor

Summary

Content "Add Variable Snippets for Home Pictures"

Purpose of change

I wanted to learn how to use variable snippets after doing some other contributions. Home Pictures previously used about 35 static descriptions and I thought it would be a good learning exercise to expand them using variable snippets. This is the first of probably 3 PRs to add the new ones I created, they'll be coming in small chunks due to the complexity and because it felt bad to drop like a 300 line PR with lots of nested variables.

Describe the solution

I added variable snippets. This PR covers only three framed types of pictures, graduation photos, puzzles, and small movie posters. In Additional Info I will over-explain each snippet group individually to hopefully make testing/merging easier.

The TLDR is that I enabled variants for home pictures so it can pull from the old list or my new variable list. I set up 3 sets of main snippets, movie posters, grad photos, and framed puzzles, and then used variable snippets to randomize them. So if the game poops out that you found a graduation photo, the combination of variables mean that one picture might be one of hundreds of possible combinations of descriptions.

Describe alternatives you've considered

Not submitting it. I made this like a month and a half ago and it was hard to sort it out and re-test to make sure it was good to go. I thought about just never doing it but hey I already did all the work I might as well.

Testing

When I made the changes locally, back when first created, I tested them extensively to make sure they worked. Today my testing was mostly to make sure the small group I decided to add in this PR all functioned properly. I'm pretty good about grammar but I might have missed a comma splice in there somewhere. I don't know, tested it to make sure none of them are broken but you never know what small thing you might have missed.

Additional context

Okay, so lets tackle these one at a time, I'll make them collapsible, hopefully this helps whoever's merging this. I'm going to probably over explain so here comes huge walls of text.

hp_nested_1 - Movie Posters These are probably the simplest of what I've added. When spawned, it uses only one variable snippet. So the descriptions are: "A scaled-down image of a famous movie poster! <movie_poster>" where movie_poster pulls a random movie description snippet. There are fourteen possible descriptions, I initially wanted to do 2 types for each of the core genres, but in hindsight 14 is probably too many. I don't know, I just tried to have fun with it. Samples:

image
image
image

hp_nested_2 - Graduation Photos These are graduation photos. They feature multiple variables and have the most randomization of what I've added today. The base description is:

"A framed photo from a graduation ceremony. It features <grad_base>, wearing a <color> gown. <grad_details>"

<grad_base> describes the person we're seeing, so they are adjectives with a randomized gender. Example: "a vaguely sleepy-looking <character_gender_adjective> ", with the gender adjective choosing whether its a man, woman, boy, or girl.

It then uses <color> which is an existing snippet group to choose the color of the gown.

Then it adds <grad_details> which is a group designed to add more flavor to the existing photo by adding randomized descriptions of the scenes background/additional info. Sample: "A young woman stands beside the graduate, love and adoration etched on her face."

And when we put it all together, we get these sort of descriptions:

image
image
image

hp_nested_3 - Framed Puzzles I noticed some of the initial snippets for home pictures included puzzles so I thought I'd add a few variable ones so we weren't always seeing the same identical puzzle.

The base description is:
"Someone took the time to frame this small puzzle. It depicts <puzzle_desc>" This is pretty straight forward, it just pulls random snippets to describe the puzzle.

An example of the randomized puzzle description:
"a beautiful bouquet of flowers, mostly <flowers>, in a glass vase." In this example, we use the flowers snippet group (which already existed) to randomly choose what flowers are in the puzzle.

And then as part of the puzzles, I have added a dog_breed snippet group as well, which allows for them to be randomly chosen.

Examples of the dog_breed puzzle:

image
image

Puzzle Samples:

image
image

This is probably the hardest PR I've ever written in terms of formatting and needing to explain things. I hope everything came across okay and though I'm slow to respond on Github (you can catch me on discord if you need me) I'll try to explain if there are any questions. Sorry to whoever's merging this, I know it's tough to deal with these nested snippets, especially when there's a lot of them.

I have two more batches to add in future PRs, one for adult-ish things (weddings, drinking, etc) and then one for child things (school pictures, notes to grandma, etc.) that are probably even more complicated than this one x_x

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON astyled astyled PR, label is assigned by github actions labels Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • a detailed and ornate railyard, showing a multitude of trains. The pieces are very small, truly a difficult puzzle.
  • labrador

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

Hints for adding a new word to the dictionary
  • If the word is normally in all lowercase, such as the noun word or the verb does, add it in its lower-case form; if the word is a proper noun, such as the surname George, add it in its initial-caps form; if the word is an acronym or has special letter case, such as the acronym CDDA or the unit mW, add it by preserving the case of all the letters. A word in the dictionary will also match its initial-caps form (if the word is in all lowercase) and all-uppercase form, so a word should be added to the dictionary in its normal letter case even if used in a different letter case in a sentence.
  • For a word to be added to the dictionary, it should either be a real, properly-spelled modern American English word, a foreign loan word (including romanized foreign names), or a foreign or made-up word that is used consistently and commonly enough in the game. Intentional misspelling (including eye dialect) of a word should not be added unless it has become a common terminology in the game, because while someone may have a legitimate use for it, another person may spell it that way accidentally.

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Aug 2, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 3, 2024
@Maleclypse
Copy link
Member

This is very neat and your explanations made it very easy to understand. Thank you for doing this!

@Maleclypse Maleclypse merged commit 1fc1e9a into CleverRaven:master Aug 3, 2024
18 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants