1. Homepage
  2. Programming
  3. Assignment 2: Step Monster High

Assignment 2: Step Monster High

Engage in a Conversation
UCSCMonster HighGame DesignInteractive StorytellingFoundations of Interactive Game DesignComputational Models of Narrative

Assignment 2: Step CourseNana.COM

Monster High CourseNana.COM

Introduction CourseNana.COM

In this assignment, we’ll write Step code to select and execute content units. Our content units are plot points for a soap opera world called Monster High. In this world, students, who also happen to be monsters, engage in conflicts and romance. CourseNana.COM

The provided code sets up the framework for the assignment. You’ll be adding code to two of the files, Queries.step and PlotPoints.step, as well as potentially changing the initial state of the world in Students.step to test your code. CourseNana.COM

This code works by testing the state of the world to see which plot points are potentially applicable and then picking one to execute. Two entry points have been provided for testing the code. The task [Events] selects and executes six random plot points. The task [ShowPlotPointMenu] shows a menu of all the plot points available in the current story state. The user can select one, it executes, and a menu of plot points available in the new state is displayed. Plot points will be represented as tuples, so if you haven’t done the reading on tuples, do that now. CourseNana.COM

For example, we might represent the plot point that Jayden confesses their love to Tiana with the tuple: [confess_love jayden tiana]. However, this only makes sense if we know that Jayden has a crush on Tiana, otherwise, why would they confess? And it doesn’t make sense if the two are already dating. So you need to make sure that the confess_love plot point is only available when there’s an attraction that isn’t being acted on. When this plot point executes, it might be printed as “Jayden confesses their love to Tiana” CourseNana.COM

We’re using fluents to represent the changing state of the world as plot points execute. Read more about fluents in tutorial 8. CourseNana.COM

Note also that we’ve provided you with a version of Mention that understands things like pronoun generation and capitalization of character names. You don’t need to do anything with it, just realize that it’s there. If you don’t know what Mention is, read part 6 of the tutorial on generating text in context. CourseNana.COM

Getting started CourseNana.COM

To begin with, drag the Monster High folder into the Documents/Step folder on your machine (the Step folder inside your Documents folder). Then, open the Monster High folder you just put inside the Step folder in Visual Studio Code. CourseNana.COM

Replace the earlier version of Step that you downloaded with the new version provided in the assignment zip archive. This new version of Step fixes a bug that affects the assignment. CourseNana.COM

Finally, start Step, and type “project Monster High”. CourseNana.COM

Optional: Making a student body CourseNana.COM

The file Students.step defines the student body, including what type of monster each student is, what clubs people are in, and who has crushes, is dating, and are friends. For the purposes of testing your code, you may want to create your own student body with a specific initial state. However, you don’t need to do this if you don’t want to. CourseNana.COM

Note that the Mention code we gave you will use they as the pronoun for all characters by default. If you prefer, you may optionally specify preferred pronouns for some or all of your characters. To do that, just add statements to your Students.step file of the form: CourseNana.COM

PreferredPronoun student pronoun. CourseNana.COM

Where student is the student you’re specifying a pronoun for, and pronoun is either he or she. You can specify they, but since that’s the default anyway, there’s no particular point in doing so. Anyone you don’t specify a pronoun for will be referred to using they. CourseNana.COM

Part one: Queries CourseNana.COM

The file Queries.Step defines predicate rules to infer interesting relations in the story world. Examples include:
UnrequitedLove ?a ?b (?a is crushing on ?b, but not vice versa) and,
CheatingOn ?cheater ?cheatee (?cheater is dating ?cheatee and is also dating someone else). Write predicate rules for each of the predicates specified in Queries.Step. CourseNana.COM

Part two: Plot Points CourseNana.COM

Here’s how plot point selection works. Calling [PlotPoint ?event] picks plot points at random to test and returns a binding for ?event for the first plot point it finds whose test is satisfied. For example, if the confess_love plot point between jayden and triana was the first plot point it tried whose test was satisfied, then [PlotPoint ?event] succeeds with ?event = [confess_love jayden triana]. CourseNana.COM

PlotPoint is a predicate: PlotPoint ?event means that ?event is a plausible thing to happen in a Monster High episode given the characters and relationships specified in Students.step. CourseNana.COM

If you wanted to see all the plot points that are possible in the current story state, you can use: [FindUnique ?event [PlotPoint ?event] ?eventList]?eventList will be bound to a list of all the possible plot points. CourseNana.COM

We’ve defined two hot keys, Alt-e/Option-e, which executes six plot points in a row, and Alt-m/Option- m, which shows a menu of all the possible plot points, allowing you to pick one to execute (you then see a new menu). CourseNana.COM

For each plot point, you need to write a method for the PlotPoint task to test if a plot point is available in the current story state. CourseNana.COM

We represent plot points as tuples: CourseNana.COM

  • [confess_love ?a ?b]
    means?aconfessestheirlovefor?b. Thiscanoccurwhen?ahasacrushon?bbuttheyaren’t already dating. CourseNana.COM

  • [start_dating ?a ?b]
    means ?a starts dating ?b. There are two different conditions in which ?a can start dating ?b: CourseNana.COM

    ?a knows that ?b has a crush on them, there’s a mutual attraction, they are not currently dating each other, and they are not star crossed lovers. CourseNana.COM

Same as the above, except that they are star crossed lovers, and ?a is confident. CourseNana.COM

  • [romantic_rejection ?rejector ?rejected] CourseNana.COM

    means ?rejector romantically rejects ?rejected. This can occur when the ?rejector CourseNana.COM

    knows that ?rejected has a crush on them, and the love is unrequited. CourseNana.COM

  • [fight ?attacker ?defender [triangle ?attacker ?defender CourseNana.COM

    ?loveInterest]]
    means ?attacker has a fight with ?defender about the fact that ?attacker and ?defender have the same ?loveInterest. This can occur when ?attacker and ?defender are in a love triangle with ?loveInterest. CourseNana.COM

  • [fight ?cheatee ?cheater [cheating ?cheater ?cheatee ?other]]
    means that ?cheatee fights with ?cheater about ?cheater cheating on them with other. This can occur when ?cheater is cheating on ?cheatee with ?other. CourseNana.COM

  • [fight ?cheatee ?other [cheating ?cheater ?cheatee ?other]]
    means that ?cheatee fights with ?other about ?cheater cheating on ?cheatee with ?other. This can occur when ?cheater is cheating on ?cheatee with ?other. CourseNana.COM

  • [breakup ?char1 ?char2]
    means that ?char1 breaks up with ?char2. This can occur when ?char1 and ?char2 are dating and ?char1 had a fight with ?char2. CourseNana.COM

  • [smoldering_look ?a ?b ?club]
    means ?a gave ?b a smoldering look when they were together at ?club. This can occur when the characters are mutually attracted to each other and they both belong to the club. CourseNana.COM

  • [star_crossed_lovers ?a ?atype ?b ?btype]
    can only occur when ?a and ?b are star crossed lovers (see definition in Queries.step). CourseNana.COM

  • [support_from_friend ?supporter ?supportee [star_crossed_lovers ?supportee ?supporteeType ?crush ?crushType]]
    means that ?supporter supports ?supportee about ?supportee being star crossed lovers with ?crush. This can only occur if ?supportee is star crossed lovers with ?crush and ?supporter and ?supportee are friends. CourseNana.COM

    So for this part, you need to add methods for PlotPoint to the end of PlotPoints.step. The methods are going to look like: CourseNana.COM

    PlotPoint [eventType other-information ...]: condition Where: CourseNana.COM

    • eventType is the kind of event (e.g. confess_lovestar_crossed_lovers, etc.) CourseNana.COM

  • other-information is the other information that appears in that kind of event: definitely the characters participating in it, but for some of them, there are things like the monster types or clubs the students belong to CourseNana.COM

  • condition is the information to determine whether this plot point is allowed in the current state of the story world. CourseNana.COM

    only generate in plausible circumstances. CourseNana.COM

    Testing plot points CourseNana.COM

    You can test plot points in a few different ways: CourseNana.COM

  • Running: PlotPoint ?
    That is, typing PlotPoint ? in the green box, and hitting return, will generate a completely random plot point and print it in tuple form. CourseNana.COM

  • Running: PlotPoint [type args ...]
    Will force it to try to generate a plot point of the specified type. For example: CourseNana.COM

PlotPoint [confess_love ?a ?b]
Will find a character ?a for which they meet the conditions to confess their love to ?b. CourseNana.COM

PlotPoint [confess_love cameron hailey]
Will test whether [confess_love cameron hailey] is a valid plot point. If it doesn’t print anything, it’s valid. If it prints Call Failed, then that’s not a valid plot point. This isn’t a valid plot point in the Students.step file we hand out because Cameron and Hailey are already dating. But it might be true in your story world. CourseNana.COM

Part three: Executing Plot Points CourseNana.COM

Now write methods for ExecutePlotPoint. These should take the form of: ExecutePlotPoint [eventType other-information ...]: text-to-print state-to-change CourseNana.COM

Where, eventType and other-information are as above, text-to-print is what to print to describe this kind of plot point, and state-to-change is code to make state changes caused by the plot point. CourseNana.COM

Here are the state changes the need to happen for each plot point. CourseNana.COM

  • [confess_love ?a ?b]
    Now ?b knows that ?a has a crush on ?b. CourseNana.COM

  • [start_dating ?a ?b]
    Now ?a and ?b are dating, and ?a doesn’t know anymore about ?b’s crush on ?a (now that they’re dating, they are beyond worrying about crushes). CourseNana.COM

  • [romantic_rejection ?rejector ?rejected]
    Now ?rejector doesn’t know anymore that ?rejected has a crush on them, ?rejected no longer has a crush on ?rejector, and ?rejected considers ?rejector an enemy. CourseNana.COM

  • [fight ?attacker ?defender [triangle ?attacker ?defender ?loveInterest]] CourseNana.COM

  • [fight ?cheatee ?cheater [cheating ?cheater ?cheatee ?other]] CourseNana.COM

  • [fight ?cheatee ?other [cheating ?cheater ?cheatee ?other]] CourseNana.COM

    In all three case of fight, now the two characters involved have had a fight. The text will be CourseNana.COM

    different for three cases. CourseNana.COM

  • [breakup ?char1 ?char2]
    Since the two characters aren’t dating anymore, now they haven’t had a fight (the fight is no longer relevant after the breakup), and neither has a crush on the other. CourseNana.COM

  • [smoldering_look ?a ?b ?club] Only prints text. No state changes. CourseNana.COM

  • [star_crossed_lovers ?a ?atype ?b ?btype] Only prints text. No stage changes ?confessor confesses ?confessor/Possessive love to ?confessee. [now [Knows ?confessee [CrushOn ?confessor ?confessee]]] CourseNana.COM

  • [end] CourseNana.COM

    One way to test ExecutePlotPoint is by using the menu of possible plot points activated with Alt- m/Option-m and selecting a plot point to execute. You can then manually check the state, or check if the next plot points that are available make sense given the intended state change. CourseNana.COM

    There are methods defined in Mention.step to help with writing text for ExecutePlotPoint. The subsections below describe these. CourseNana.COM

    Pronoun generation CourseNana.COM

    As discussed above, if text uses a character’s name twice, it will generate pronouns to refer to them when appropriate. By default, it uses they as everyone’s pronoun, but you can specify pronouns for specific character using PreferredPronoun (see above). That’s purely up to you, though. CourseNana.COM

    What you should pay attention to is whether it’s generating pronouns in the right case. If your code to print says something like: CourseNana.COM

    I love ?who. ?who is just so great. CourseNana.COM

    This will generate something like: CourseNana.COM

    I like Jayden. They are so great. CourseNana.COM

Because the second use of ?who is the subject of a sentence, this is fine. We want it to say they rather than them. But if our code says: CourseNana.COM

I love ?who. I could just hug ?who. CourseNana.COM

Then we get something a little odd: CourseNana.COM

I like Jayden. I could just hug they.
Here we want to use them rather than they because the second use of ?who is the object of the verb CourseNana.COM

rather than the subject. This is easy to fix. Just change ?x to ?x/ObjI love ?who. I could just hug ?who/Obj. CourseNana.COM

This will produce the correct text: CourseNana.COM

I like Jayden. I could just hug them. CourseNana.COM

When you see your code is generating pronouns in the wrong case, just change it as follows: CourseNana.COM

• ?x
Prints they/she/he CourseNana.COM

• ?x/Obj
Prints them/her/him CourseNana.COM

• ?x/Possessive Prints their/her/his CourseNana.COM

Verb conjugation CourseNana.COM

Hopefully this won’t affect you for this assignment. I didn’t have to use it for my reference solution, but you may want to generate more ambitious text than I did. As discussed in the reading, you sometimes want to generate different forms of verbs, depending on how the subject is in third person plural or not. We’ve provided you with the [Is] task from the reading, which prints “is” or “are”, depending on what’s appropriate, as well as [Has], which prints “has” or “have” as appropriate. For example: CourseNana.COM

?a [Is] going out with ?b CourseNana.COM

Will generate “bill is going out with jenny” or “he is going out with jenny”, but “they are going out with jenny” when ?who is realized with the pronoun they. CourseNana.COM

For regular verbs, you can add [s] at the end of the verb and it will add an -s or an -es, as appropriate. For example: CourseNana.COM

TestCongation ?who: I like ?who. ?who read[s] books. CourseNana.COM

Will generate: CourseNana.COM

I like Jayden. They read books. CourseNana.COM

If Jayden’s preferred pronoun is they, but: CourseNana.COM

I like Jayden. He reads books. CourseNana.COM

If Jayden’s preferred pronoun is he. CourseNana.COM

CourseNana.COM

The magic [s] task only works for regular verbs. If you want to handle a different verb, then grab the code for Is from Mention.step and just change it for your verb. CourseNana.COM

Part four: Invent some more plot points CourseNana.COM

NowwritePlotPointandExecutePlotPointmethodsfortwomorekindsofplotpoints. Theycan be anything of your choosing, although they need to depend on the story world. Feel free to add new information to the story world if you like. CourseNana.COM

Some ideas: CourseNana.COM

  • Two characters have a heart-to-heart discussion while at their club. This would obviously only make sense when they’re in the same club. CourseNana.COM

  • Two characters become friends after a fight. For that, there’d need to be a reason for them to have the fight. And they probably shouldn’t be dating, since people who are dating should probably already be friends. Maybe they become friends because they have a shared friend. CourseNana.COM

  • A werewolf character does something on the full moon CourseNana.COM

  • A vampire character bites a human character CourseNana.COM

    Turning it in CourseNana.COM

    Save all your files, reload (control-R) to make sure everything really does load. Assuming everything seems okay, make a zip file of your Monster High directory and upload it to canvas.  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UCSC代写,Monster High代写,Game Design代写,Interactive Storytelling代写,Foundations of Interactive Game Design代写,Computational Models of Narrative代写,UCSC代编,Monster High代编,Game Design代编,Interactive Storytelling代编,Foundations of Interactive Game Design代编,Computational Models of Narrative代编,UCSC代考,Monster High代考,Game Design代考,Interactive Storytelling代考,Foundations of Interactive Game Design代考,Computational Models of Narrative代考,UCSChelp,Monster Highhelp,Game Designhelp,Interactive Storytellinghelp,Foundations of Interactive Game Designhelp,Computational Models of Narrativehelp,UCSC作业代写,Monster High作业代写,Game Design作业代写,Interactive Storytelling作业代写,Foundations of Interactive Game Design作业代写,Computational Models of Narrative作业代写,UCSC编程代写,Monster High编程代写,Game Design编程代写,Interactive Storytelling编程代写,Foundations of Interactive Game Design编程代写,Computational Models of Narrative编程代写,UCSCprogramming help,Monster Highprogramming help,Game Designprogramming help,Interactive Storytellingprogramming help,Foundations of Interactive Game Designprogramming help,Computational Models of Narrativeprogramming help,UCSCassignment help,Monster Highassignment help,Game Designassignment help,Interactive Storytellingassignment help,Foundations of Interactive Game Designassignment help,Computational Models of Narrativeassignment help,UCSCsolution,Monster Highsolution,Game Designsolution,Interactive Storytellingsolution,Foundations of Interactive Game Designsolution,Computational Models of Narrativesolution,