Chapter navigation improvements #244
Reference in New Issue
Block a user
Delete Branch "Iggy/SnootGame:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Went into full 'tism mode and rewrote the way the game handles chapter navigation.
General and ending chapters labels are now stored into global string lists.
Instead of manually calling each chapter as the game previously did, I wrote some Python functions to handle the logic, similar as looping through lists.
A new tool for watching global variables has been added to make testing easier.
Only noticeable bug I've encountered so far when testing, was that words containing the letters 'ft' such as 'after' or 'left' are shown with a weird russian symbol as shown in the picture attached.
Finally, starting from RenPy version 8.1 onwards, there is a new way of playing movies. I've modified it in chapter 5, where the fang tail movie plays, to make it work.
All testing for the game has been done on RenPy's latest version as of making this PR (8.2.3).
WIP: Chapter navigation improvementsto Chapter navigation improvementsThis rewrite isn't very necessary on it's own, however it makes perfect sense if a chapter select could be implemented, and one that's more sane than Wani's. See if you can implement it.
I think this set up with needing a separation of a 'next chapter' and 'next ending chapter' is a bit convoluted. A simpler way of thinking this is the game will always know there is a set of general chapters to start with, but it will only know the rest of the chapters if we decide on an ending.
An array of chapters and an index for where we are in the story is already perfectly intuitive to understand, so if we append to this array when an ending is determined, then there's no need to track a different set of variables. The logic for determining what chapters to go to can be handled entirely by next_story_chapter() if we check the current ending when needed.
Speaking of, I'd recommend putting the watched variables and anything else chapter related into initstats() so long-term story vars can be organized there.
Aside from chapter code, if you're testing on the latest renpy version, please test it on the build system we use, Woodpecker, if you want your changes to be reflected properly. It's config file is in the root of the project (.woodpecker.yml), and controls the version of renpy and renkit. Since both are currently using outdated versions, refer to Wani's more updated config file and the updated renconstruct.toml file to update them. If they turn out bloated, it may be related to this issue.
Additionally if you want to fix the font issue, just copy the font file from Wani. A few other people had forks to fix it separately, but you'd be the first to implement it in a PR.
@@ -133,6 +133,11 @@ default preferences.text_cps = 50default preferences.afm_time = 15init -999 python:Is this a leftover from debugging? Remove if so.
@@ -55,0 +95,4 @@debug_story_variables(True, True)# label storyline:If these commented out code bits truly aren't needed (as in, they cause problems or saves work fine without them), remove them wholesale.
@@ -20,3 +18,1 @@return(2) # Doomerelse:return(1) # Shooter# label get_ending:Ditto for these
Yes, you are perfectly right. At first I thought about only using the same next_story_chapter function to handle all chapter navigation, including the endings but couldn't find the proper way of doing so.
By appending the chapters from the ending dictionary once the ending has been locked we manage to simplify things by a lot.
About the chapter selection tool, I have one implemented in the project I'm currently working on. Gonna try implementing it here when I can. Should this only be usable if debug mode is enabled, no?
Thank you for your input.
Just have it as Wani does, still available to the end-user but disabled by default while not in dev mode.
Chapter navigation improvementsto WIP: Chapter navigation improvementsImplementation of the chapter selection tool and of the suggested improvements is done.
I've also updated woodpecker.yml and renconstruct.toml to handle new Renpy versions. However, I'm stuck with the woodpecker build error shown in the image. Any ideas on how to fix it?
/tmp/renkit-x86_64-unknown-linux-gnu/renconstruct build "." dist/I think you forgot the
-c "renconstruct.toml"I tried it and it complained the .toml file was broken so im sure thats also a problem
Pipeline is fixed. Take a look now.
@@ -199,0 +209,4 @@build.classify('android.keystore.original', None)build.classify('*dist/*', None)build.classify('game/dev/**', None)We don't need these 3 classifiers since we don't use them.
Done.
Sorry, I meant to continue on with a review but I got sidetracked.
No chapter selection for the ending chapters? Please put them in.
I'm iffy about using a function to increment scores. If
lock_scoresis only used in chapter selecting, then alternatively it could instead store the ending to lock to and have any functions that calculate score to return the designated ending, i.eget_endingor otherwise (and make sure this is noted by a comment). This removes the need for an abstraction so adding to score remains as simple asfangscore += 1With that info you can easily make the chapter select only display chapters of a designated ending to make things concise.
Otherwise, this all looks fine. I've only tested up to the ending branch-off point for anything that bugs out because of the engine update, but I'll get the rest in the next day or so.
@@ -12,3 +1,1 @@cert_file = "certificates/developerID_application.cer" # the path to the Apple-generated certificate file generated during the provisioning processapp_store_key_file = "certificates/app-store-key.json" # the path to the combined App Store key file generated during the provisioning processjson_bundle_file = "certificates/renotize.json" # the path to the combined certificate file. replaces the key, cert and app store files above[tasks.patch]Why did you enable patching?
This was a leftover from when I was trying to fix the Woodpecker pipeline. It's now removed.
@@ -55,0 +17,4 @@# Add check "is_end_reached" to have this if statement be executed only once when finishing the general chaptersif not is_end_reached and is_end_of_chapters():process_ending()This doesn't need to be a function since it's only called here, just move the function's code to here and if it needs further clarification add a comment
Done.
@@ -55,0 +34,4 @@def process_ending():global ending_route_numberending_route_number = get_ending()You are abusing global variables to the point that most of the code is unreadable, this is only a specific example but in this case it would be 100x better if instead of doing
You did
That way you communicate what a function does beyond of what it's called and where it's getting it's information without having to investigate and jump around different functions seeing which one updates a specific variable.
Functions are now (I hope) easier to read. Thank you for your advice!
Originally, I wanted to use the functions to avoid unnecessary increases in points. I realize that it won't matter if points keep increasing, since the ending is already being set with the tool.
Nice to have a different opinion on these things.
noting this down:
completing ending 1 should close the game during normal play after creditsImplemented in last commit.
For the time being this is all seems good. I'm probably gonna revise this after the fact, but merging this needs to not stall.
WIP: Chapter navigation improvementsto Chapter navigation improvements