Game variable discussion

Discussion in 'Authors' Hangout' started by bejjinks, Aug 21, 2024.

  1. bejjinks

    bejjinks Really Experienced

    I have played some games here that used game variables well and I have played some games here that used game variables poorly. I'd like us to have a discussion here about how to use game variables well and how to avoid some of the game variable pitfalls.

    I am strictly talking about game variables. Customization variables are a completely separate subject for a completely separate thread.

    *arousal* seems like a good game variable. It's a number that keeps rising until it reaches 100 which causes orgasm.

    *exposure* could be another good game variable. It could be a number such as the number of items of clothing worn or it could be a subjective number measuring how embarrassed someone could be to be seen dressed that way or it could be a set of words used to describe the state of dress such as "fully dressed" "underwear" and "naked".

    I've seen games that use variables to keep track of inventory such as whether the person has the sex toy or not.

    Tell me some more?
     
  2. Gatsha

    Gatsha Really Experienced

    I think above all the variables need to serve the purpose of the story. Generally speaking, I see them as building blocks and not an element to be celebrated of themselves. In other words, the exciting part is "what questions can I make depend on this variable" and not "what variables do I track."

    I think the most obvious variables are things like "money" or "hit points" that we're used to being strict quantities with obvious related consequences.

    Another common one is to have the player select traits or talents or items, chapters that activate that variable for them as "true" and let them carry it through to choose different options in the story. This can similarly be done as in the example of "adding strength," where an option to open a door is only selectable at a value of 5 or higher.

    You could also use something like "days passed" to have a new event happen when cycles through the story hit a certain amount.

    You could use something like "dead ends" to track when the player reached a dead end and had to use your link chapter to return, and then tie that to something like a bonus chapter that can only be accessed with a perfect score, or a change in a character's attitude reflecting their exhaustion with their cycle of rebirth...

    I do see an "arousal" or "affection" variable tracked as a key to erotic scenes often.

    Of course, there can be exceptions to the idea that variables themselves can't be exciting. For example, if you have a chyoa story where certain paths result in your character finding an unexplained jizo statue, and you track it as a variable, you can bet whoever sees that is going to want to keep playing to find out why you're tracking how many jizo statues they ran across... then it's just up to you as the writer to think what the payoff is!
     
  3. bejjinks

    bejjinks Really Experienced

    This was my assumption when I started the thread. I wasn't looking for "variables to track". I was looking for variables that can be used to determine what ending the reader gets to.

    "exposure" could impact things like "arousal" which can impact things like how successful one is at seducing someone. "exposure" can also have legal consequences such as preventing someone from going where they want to go. People treat a naked person different than they would a clothed person.

    Good inventory examples I've seen have been "pies" that impact one's health score or "key" that unlocks door or "clues" that can be used to solve mysteries.

    I do like all the other variable suggestions you make. I don't think I personally will use the "dead ends" variable because I don't want to make my readers feel like there is only one correct way to go. The correct way to go is the one that takes the reader to the outcome the reader wants to get to. I will probably have some form of "hit points" or "health" variable and a "time" variable. I also like the idea of traits variables but I'm not sure which traits I would want to use.
     
    Gatsha likes this.
  4. bejjinks

    bejjinks Really Experienced

    Part of why I started this discussion is because I have attempted to create a game in the past, Ganymede University, but I didn't have it well planned out. It turned out pretty good for a disorganized mess but I did get to a point where I felt lost and overwhelmed from how the story was going so many directions at once.

    I might take the good parts of Ganymede University and try to remake it or I might start from scratch to create something completely new but either way, I want to plan out where I'm going better so I don't get to a point of feeling lost and overwhelmed again.

    Thinking about this caused me to wonder if I can use random variables. I won't use them as game variables but it would be nice if a chapter that gets repeated frequently has some parts of the chapter that change such as: "He ate Tilapia for lunch" or "He ate peanut butter and jelly for lunch". In other words, despite it being a repeat of the same chapter over and over again, can I do something to make it less obvious that it is the exact same chapter over and over again?
     
  5. bejjinks

    bejjinks Really Experienced

    After doing a little research, it's obvious that random is not possible. But I might have a way to make it seem random even though it isn't. Ask the reader to input a random number and then have the condition statements go through a list starting with that random number.

    Example: make a list of lunches such as 1=tilapia, 2=peanut butter, 3=egg salad . . . Then if the reader chooses 3, the condition statement starts with egg salad and moves through the list from there.

    I'm just thinking out loud at this time. This seemingly random system might become too complicated to bother with.
     
  6. Gatsha

    Gatsha Really Experienced

    I don't think there's a way to have the user input a number that will be treated as a variable, thus probably no way to do it truly random. If the goal is to make it seem random and changing to the reader, though, there are ways.

    In your example, the situation of the meal changing implicitly assumes you want to make it so the very same chapter will display that changing text when the story loops back to it (I assume; otherwise this doesn't need variables, the answer is just to change it in each linear chapter). Assuming a loop, I think the easiest way is to have the link back to that chapter add a +1 to a hidden variable called "cycles". You tie the description of what they eat to "if 1 = peanut butter, if 2 = tuna," etc. In that case, ideally make sure to have an "else if" statement in case that variable has no quantity (i.e. for readers not in game mode) if you want it to read normally out of game mode.

    I should mention while this kind of thing is clever, the downside in my experience is that the reader, when sent back to what seems to be an identical chapter, will have a strong tendency to skim if it is indeed a detail as mundane as a short description of what they're eating that day. Not saying it can't be done even just for fun or as an easter egg, but if you want it to actually have visibility, it should be through emphasis or context in the story.
     
  7. bejjinks

    bejjinks Really Experienced

    Another question. I have started a game story, Gay Wrestling Championship. I want to have several opponents for the reader to choose from but if I can, I'd like the opponents available to change based on the player's variables. I have seen this done in other games but I'm not sure how it was done.

    So, although I haven't created the opponents yet, let's say the opponents were Ryan, Chad, Bob, Scott, Tim, Jim, Bill, Mark, Mike, Mac, Buddy and Rex. If the player's "tricks" variable is low, then he should only be able to choose Ryan, Chad or Bob as his opponents but if the player's "tricks" variable is high, then he should be able to choose from any of the opponents.

    How would I do something like that?
     
  8. Gatsha

    Gatsha Really Experienced

    Say you have a hub chapter and, from it, your player will be able to choose a chapter to branch to any of the opponents. The only things you need to do, then, are:

    1. Either on the hub chapter or on a chapter before it, make sure the player runs across some assignment of the Tricks variable using "changes to the score."

    2. On each of the opponent branch chapters, you can apply a "condition to view this chapter". One of the options shows "00." Once you pick that, set the condition to be "Tricks > [whatever value you deem appropriate]."
     
  9. bejjinks

    bejjinks Really Experienced

    I just learned that it is best to avoid negative numbers. Although it is possible to use negative numbers, it can become complicated. So I just went through some of my variables and added ten to get out of the negative numbers.
     
  10. gene.sis

    gene.sis CHYOA Guru

    How so?
     
  11. bejjinks

    bejjinks Really Experienced

    I know we can use negative numbers but when I tried to set a variable equal to negative five, it wouldn't let me set the variable equal to a negative number. It would let me subtract five from zero but it would not let me just say "level = -5"
     
    gene.sis likes this.
  12. gene.sis

    gene.sis CHYOA Guru

    Indeed.

    "level - 5" would work if the variable hasn't been set before (as it assumes a default value of 0) but if you want to overwrite the existing value, that won't be useful.

    In that case, you would have to use two Score Changes
    "level = 0"
    "level - 5"
    in the same chapter to make sure it works as intended.
     
  13. bejjinks

    bejjinks Really Experienced

    I have another question. I've set it up so the reader can choose the gender identity of their lover and that means setting a variable called "lover" to equal 0 for no lover, 1 for male lover, 2 for female lover, 3 for trans male lover, and 4 for trans female lover.

    Later, I added a chapter that I want to set a condition that the chapter is only available to those who chose one of certain gender identities. So I set the following conditions:

    lover = 1
    lover = 4
    lover = 0

    Will that make the chapter available to any reader who has lover equal to 0, 1 or 4 or will those conditions cancel each other out making the chapter not available to anyone?
     
  14. gene.sis

    gene.sis CHYOA Guru

    To access a chapter, all conditions need to be met. (AND)

    So this
    will be the outcome.

    (There is currently no way to use OR in conditions.)

    A workaround would be to have two link chapters with the conditions
    1. lover < 2
    2. lover > 3 (or lover =4)

    The rest of options could be covered with
    3.
    lover > 1
    lover < 4
     
  15. bejjinks

    bejjinks Really Experienced

    Do you mean that I should make two chapters that are exactly alike except that one chapter has a condition of lover < 2 while the other chapter has a condition of lover > 3?

    Is that why I have seen some duplicate chapters in some game story maps?
     
  16. gene.sis

    gene.sis CHYOA Guru

    Well, it depends on what you want to do it, how complex it might become, and your personal preference.

    One possible structure might be
    Code:
    0 Hub chapter
        |- 1 Next story part (Condition "a > 100000", so you can't access it directly)
        |- 2 Link chapter to chapter 1 (Condition "lover < 2")
        |- 3 Link chapter to chapter 1 (Condition "lover > 3")
        |- 4 Link chapter to chapter 1 (Conditions "lover > 1" and "lover < 4")
    So you can put all the content into chapter 1. (You could add a Score Change like "path = 1" for chapters 2 and 3 and "path = 2" for chapter 4, and then use one if statement to have both paths.)
    A big advantage of this structure is that you don't have to take overlapping Score Changes into account.

    Another possible structure might be
    Code:
    0 Hub chapter
        |- 1 Next story part (Condition "lover < 2")
        |- 2 Link chapter to chapter 1 (Condition "lover > 3")
        |- 3 Link chapter to chapter 1 (Conditions "lover > 1" and "lover < 4")
    If you go with the two paths as well, you need to set up the variable "path = 1" in chapter 0 or earlier and only change it in chapter 3 to "path = 2". If you set the variable "path" in all three chapters, you will always end up with the variable being as it is set in chapter 1. (The Score Changes of both the link chapter and the destination chapter get applied. This can be a disadvantage or an advantage. (E.g. adding +2 and +5 or sth.))

    Another possible structure might be
    Code:
    0 Hub chapter
        |- 1 Next story part A (Condition "lover < 2")
        |- 2 Link chapter to chapter 1 (Condition "lover > 3")
        |- 3 Next story part B (Conditions "lover > 1" and "lover < 4")
    Here, you might apply Score Changes only to 1 and 3 and use 2 only to forward the reader to 1.
    You also don't have all the content in one chapter but one path in 1 and the other path in 3.
    Depending on how the story continues, you might later merge part A and part B.

    There might be multiple link chapters with the same name and while it might very well be related to the given situation, it might not be the same.
    As there are no complex calculations possible yet, you might sometimes need more chapters to do some stuff.
    So the link chapters might also be used to apply different Score Changes depending on the reader's score.
    E.g. if the variable "arousal" is > 60 it gets up by 15 points. If it is > 30 and < 61, it gets up by 10 points. If it is > 0 and < 31, it gets up by 5 points. If it is < 1 it goes down by 10 points.
     
  17. bejjinks

    bejjinks Really Experienced

    I don't understand a lot of that but I think two identical chapters is probably best to fit my need.

    First, I don't expect to have to deal with this situation often. I'm mostly going to use the lover variable for if-statements within the text of the story. It should be rare for me to have a chapter available if the lover is male or trans female but not available if the lover is female or trans male.

    Second, there probably won't be any need for complicated mathematics. I don't foresee any reason to add one to lover and transform the trans male into a trans female.

    It's just this one small, rare case and largely it's so that the protagonist doesn't fantasize about being fucked by the female's or trans male's nonexistent cock. (I know about pegging but that is still different from getting the real thing and would be much easier to deal with by writing a completely different chapter.)

    Also, since I am writing two identical chapters, they don't have to be exactly identical. I can leave out some of the if-statements and just write the text.
     
    TheLowKing likes this.
  18. TheLowKing

    TheLowKing Really Really Experienced

    As a reader, I consider chapters with duplicate text extremely annoying, because it pulls me out of "read everything" mode. If I regularly come across large pieces of text that are identical, then that makes me constantly mentally pause and ask myself "do I even need to read this?", which ruins my immersion.

    It's actually even worse if the chapters are not identical but only very similar, because then I'll end up skipping text that may contain useful or even important information. This one is particularly common in more sandboxey stories/games in which you're expected to see the same sex scene many times, with minor differences depending on, say, the participants' breast sizes or skin colour. If the protagonist has had a bunch of sex with small-chested black women, and I deliberately make decisions for them to seek out a large-breasted Asian woman, then being presented with text that is 99% identical feels like a huge letdown.

    I would reconsider the branching point. What's the purpose of even having one if the two branches have exactly the same outcome anyway? Either get rid of the fake decision point, or turn it into a real decision point, with different text on the two branches. Speaking specifically to the "small rare case" you describe, sex with someone who doesn't have a cock isn't merely a case of "well, it's like sex with someone who does have a cock, except, you know, there's no cock". It's a whole different beast, and imo deserves its own dedicated chapter, not just a copy of an existing chapter with a couple of word replacements.
     
  19. bejjinks

    bejjinks Really Experienced

    I do understand your concern. But I have some reasons why what I'm doing is okay.

    First, this duplication is not occurring during the main event. The protagonist fantasizes but it's not a full fantasy. The real action comes later and then there won't be any identical chapters at all.

    Second, I am offering readers a chance to skip all the "Design your own" stuff. If you don't want to make decisions, I'll just fill those variables with default values and you can get right to the action.

    Third, since this is part of a game, some chapters are designed to be skipped through. They are short chapters that don't "contain useful or even important information." If you are in one of my games and the text is short, you don't have to read it if you don't want to. Just move on to the good stuff.

    Fourth, the two identical chapters are not the only options at chapter 6. There are a total of six chapters to choose from when you reach chapter six.

    Finally, what you say is another reason why I probably won't have this issue often.
     
    Last edited: Sep 4, 2024
    TheLowKing likes this.
  20. bejjinks

    bejjinks Really Experienced

    Okay, at chapter 18, I'm running into an issue. In chapter 17, "You" attempt to pull your opponents shorts down. Whether "you" succeed or not should not be up to the reader to decide. The game should be able to use the condition "if tricky > foe tricky" then "you" should succeed.

    As it stands now, I think I have to write the following chapters:
    • If tricky = 9 and foe tricky = 12 then result = 0
    • If tricky = 9 and foe tricky = 11 then result = 1
    • If tricky = 10 and foe tricky = 12 then result = 1
    • If tricky = 9 and foe tricky = 10 then result = 2
    • If tricky = 10 and foe tricky = 11 then result = 2
    • If tricky = 11 and foe tricky = 12 then result = 2
    • If tricky = 9 and foe tricky = 9 then result = 3
    • If tricky = 10 and foe tricky = 10 then result = 3
    • If tricky = 11 and foe tricky = 11 then result = 3
    • If tricky = 12 and foe tricky = 12 then result = 3
    • If tricky = 10 and foe tricky = 9 then result = 4
    • If tricky = 11 and foe tricky = 10 then result = 4
    • If tricky = 12 and foe tricky = 11 then result = 4
    • If tricky = 11 and foe tricky = 9 then result = 5
    • If tricky = 12 and foe tricky = 10 then result = 5
    • If tricky = 12 and foe tricky = 9 then result = 6
    Then after the result is calculated I should write the following chapters:
    • If result = 0, not only do you fail but your opponent pulls a move that scores him 4 points such as getting you in a cradle hold.
    • If result = 1, not only do you fail but your opponent pulls a move that scores him 2 points such as stripping you of your shorts.
    • If result = 2, not only do you fail but your opponent pulls a move that scores him 1 point such as stripping you of your tank top.
    • If result = 3, you fail but your opponent doesn't score either.
    • If result = 4, you partially succeed. His shorts are pulled down but not completely off.
    • If result = 5, you succeed in stripping him of his shorts.
    • If result = 6, you succeed gloriously and not only strip him of his shorts but you also pin him to the mat earning a total of 4 points.
    Naturally, with each of these options I will write them out writing a few paragraphs to describe each scenario.

    Unless, someone suggests a better way to write out all these chapters?