Game mode Improvement: Changing variables inside chapter

Discussion in 'Suggestions' started by blank97, Aug 4, 2020.

  1. blank97

    blank97 Really Experienced

    One problem with game mode right now is "change score" changes variables instantly(as the chapter is loading). If you want to change score you have to write short chapters in which score change is happening otherwise in a long chapter, readers would know what change will happen without scrolling and reading how the change in any variable happened.

    One solution is to change score in next chapter and write the change in the chapter which I have mentioned in another thread.

    Other solution is to change score within a chapter using a syntax like {variable+=5} to increase variable by 5 or {variable=5} to assign 5 to variable. These lines could be used inside a if statement to change variable only if it meets certain criteria e.g. {if condition<5} {variable-=5} {endif} deduct 5 from variable if condition is less than 5. I am thinking these changes will happen when reader scroll to the place where these lines are written but won't see these lines. They will only see the change in score while scrolling.

    I know this is probably impossible to implement and even if it is somehow implemented, it could slow the site. But I am hoping this is somehow possible and that is why I am posting this suggestion.
     
  2. Almax

    Almax Really Experienced

    I think the scrolling thing's a bit unrealistic, but I do like (and have often thought about!) changing variables inside curly brackets of chapters like that, and having set conditions. However! For your other thing, a good fix that I've found is just having the variable added after the chapter. Say in Chapter 2 you win the fight and your score increases, but you don't want that to be spoiled, then you can only increase the score variable in the follow-up chapters, ya know? It might be a bit annoying to do retroactively, but if you plan it from the start/take a bit of time to go through and do it then it's a pretty effective solution.
     
    Greyrock likes this.
  3. blank97

    blank97 Really Experienced

    I have mentioned it myself that it is probably impossible. But just in case if it is possible, I suggested it.
     
  4. blank97

    blank97 Really Experienced

    I know that, I am even using it right now. But just to show the reader what changed. I am writing the change like: change in angry level=+3% current angry level =33%
    But unless I am willing to stop writing the current level this will fail because I will not know the current value so adding or subtracting from it won't be possible unless there is a way to display addition or subtraction of variables which I have mentioned in another thread as a possible solution.
     
  5. insertnamehere

    insertnamehere Really Really Experienced

    Good ideas, but the scrolling thing isn't happening. If that was available to the user, Friedman might as well let us code our stories in JavaScript.

    Hey, I just had an idea...
     
    Almax likes this.
  6. blank97

    blank97 Really Experienced

    And What exactly is the problem in that?
     
    insertnamehere likes this.
  7. insertnamehere

    insertnamehere Really Really Experienced

    Well, I don't know for sure, but given it's not the case, I assume there's a good reason. I suppose something like that would essentially be giving users free, unrestrained server space, whereas the current system is rather light. Don't get me wrong, it'd be great to use proper JavaScript or something in CHYOA stories, but if you're at that stage, you may as well host your story yourself.
     
    Almax likes this.
  8. blank97

    blank97 Really Experienced

    See this https://forum.chyoa.com/threads/planned-feature-formula-parser.700/

    I just found out about this. Looks like some type of coding is already in development.
     
    insertnamehere likes this.
  9. insertnamehere

    insertnamehere Really Really Experienced

    Unfortunately we've been waiting on the formula parser since well before I even joined CHYOA. I believe the issue has to do with CHYOA versions, but either way, it's not happening for a long, long time.
     
    Almax likes this.
  10. gene.sis

    gene.sis CHYOA Guru

    An easy way would be to hide potential spoiler variables
    Variable +0 // set to invisible
    and show them in the next chapter.
    Variable +0 // set to visible

    It might be technically possible to trigger an event as soon as the reader reaches a certain point but this would be different for every reader because of different sizes of the browser window. (js should be able to get the height of the browser window and the relative position of an element.)


    The real problem is that it is difficult to add additional easy-to-use syntax for chapters as there is basically no variable naming convention besides not using braces.
    For that reason, it isn't possible to determine if it's "variable" + "instruction" or just "variable".
     
    Sune's Kiss likes this.
  11. blank97

    blank97 Really Experienced

    Well, It looks like not having a naming convention is the problem then. Why don't you have a naming convention. I am sure nobody is using +, = etc. as part of a variable.
     
  12. insertnamehere

    insertnamehere Really Really Experienced

    What makes you so sure? Some stories on this site are old enough to make accounts here. Caution should be exercised when making changes that could potentially break earlier contributions.
     
    Almax likes this.
  13. blank97

    blank97 Really Experienced

    I am sure as I think, it makes no sense to use these symbols inside the name of variable. Besides you said it yourself there are not a lot of stories properly using game mode. So whoever is using it most likely have at least some kind of programming experience. And believe me even if you read just a little programming in high school like me, it is hard to accept there is no naming convention. Most people who are using game mode might not even know there is no naming convention. My point is nobody used + or =, although you might have to check for - .


    None of those old stories use game mode as game mode didn't exist before something like 4 years ago.


    As for caution, since game mode is not used in many stories. It should not be very hard to check.
     
  14. Almax

    Almax Really Experienced

    I think you two are sort of agreeing then, aren't you? You're both saying that the decision shouldn't be made unless they can check it won't mess anything up. The "-" key is super possible, like ya said blank, because of hyphens, but we also shouldn't possibly ruin some Game Mode stories on the basis that it's unlikely that people used "+" and "=".

    For example, in one of my stories, you have a Strength variable that's separate from your "EffectiveSTR" variable (hidden most of the time), because heavier armour takes up more of your strength to use. In examples like this, somebody easily could've used the name "STR=", or "Armour+Strength", since it was going into a system that allowed for it. The three of us even just had a chat about how you can get around needing variable addition by having a third variable, and it'd be even MORE likely for the variable that's the sum of the "Happiness" and "DancingSkill" variables to be named "Happiness+DancingSkill". Again, when it's being done in a system where it works, people will quite often do it.

    (The Happiness + DancingSkill example is for another way that a plus sign could show up, of course in that one specific example by pure fortune it'd actually produce the desired result)

    So, ye, I think we're all in a sort of agreement when we're saying that it should be checked first. Even if it was next to impossible to cause problems, which I don't think it is, especially with the hyphen existing, I'd still much rather have a system where potentially story-breaking changes are checked before being implemented. Because I've got a story, and I like it a bit.
     
    gene.sis and insertnamehere like this.
  15. blank97

    blank97 Really Experienced

    Well I guess being new to this site, I shouldn't be making suggestions. Because of your experience you know what people might use. Being inexperienced I was making some assumption, I should not have.

    But I think everyone agrees a naming convention is a must.

    I just had an idea. We could email writers who have used game mode in their stories to use a naming convention. Instead of some moderators checking every game mode story, every writer can make sure their story is in accordance to the naming convention. I am not saying you have to use the naming convention, I am proposing; but whatever the programmers of this site think is a good naming convention should be emailed to everyone.
     
  16. insertnamehere

    insertnamehere Really Really Experienced

    I've been on this site long enough to assure you that most people who use Game Mode do it because they're horny, not because they like coding.
    As someone who has had more than a little to do with programming in their life, I've found that naming conventions often differ. Java users like camelCaps, while Python users prefer under_scores, and those are just human tendencies. Different languages have different reserved keywords and different banned symbols. Sometimes you can't start a variable name with a digit; sometimes you can't use numbers at all. Above all, Game Mode isn't really a programming language. It's never had any reason for a naming convention.
    CHYOA is far too large for that to work. You're talking a lot of emails.

    If you wanted to check for bad symbols, I imagine it could be done automatically, but I doubt it would turn up empty. The point is, changes to a system that apply to components that depend on (recent) old versions need to be backwards-compatible. It'd be bad if anything got broken.
     
  17. blank97

    blank97 Really Experienced

    Those who are just horny can write without game mode. And I am not saying those who use game mode like coding. I am saying those who bother with writing a story with game mode have at least a little bit of coding experience otherwise they wouldn't bother with game mode.

    Well I don't think any programming language allows +, - or = in variable name.


    If you want any kind of update in game mode then you need naming convention otherwise as gene.sis said operator and variable will be indistinguishable.


    CHYOA might be large but game story writers are not. And if you don't like email use CHYOA's message system.
     
  18. gene.sis

    gene.sis CHYOA Guru

    Well, the name of the variable is at the same time the display name, and having not many restrictions allows authors to style them as necessary.
    E.g.
    -=(variable)=-
    @>--,--'--
    Number of orgasms left ->
    ε|_][+ε-/\/\ε/\/\8εя
    3some w/ Amy+Sam

    If score changes allow for some more sophisticated operations, you're able to easily precalculate values for the use in chapters.

    I don't see any problems with making suggestions.

    It would indeed be useful to have 2 or 3 characters that can't be used by authors.

    I don't think so.
    You can use game mode in very different ways.
    Some users only use Score Changes and Conditions. At that level, programming experience doesn't help at all.
     
    Almax and insertnamehere like this.
  19. blank97

    blank97 Really Experienced

    Actually, That is something I've been meaning to suggest by creating one more thread but decided against it as I've already created 4 threads in suggestion.

    Well basically I was thinking game mode variable should have two separate name and description field like immersion variables. This should not be too hard to do and to avoid breaking previous stories you could do something to copy name in description for previous stories.
    Just like immersion variables, game variables should have description that the author can style however they want but name of variable follow a convention so that operators can be used. It even has an added bonus that name of variable can be short and easy to write inside chapter to show its value while description that readers will see could be long and styled however they want.
     
  20. gene.sis

    gene.sis CHYOA Guru

    Well, there are two ways to add a display name to a variable name.
    - add an input field beside each Score Change in each chapter
    - initialize the variables at the Edit Story page
    So you would either have to type the display name for every Score Change or you would need to predefine the variables.

    It would be good because it could be shorter to write.
    But on the other hand, you would need to remember the right variable for the name and might mix things up more easily.
     
    insertnamehere likes this.