bobbobbobthethir
Experienced
Hello! I'm working on a story (https://chyoa.com/chapter/Introduction.1029570) that makes heavy use of conditional text. The story is relatively small, but I've already noticed some issues with load times & the corresponding amount of resources that have to be downloaded (in the images) that will likely get worse as I try to expand the story further. A few questions aimed towards optimizing user experience/lightening server load:
- Is there a way to take advantage of text parsing so that text/images not needed are never downloaded?
I haven't noticed a method to accomplish this, but maybe it's possible. Right now it seems like all text (and images) are displayed first and then parsed for display logic, which makes sense for most stories but not mine. Any information speaking to this would be helpful!
- Next best, what is the preferred way to structure conditional statements?
Is it better to have more nested conditionals that contain many `elseif` statements (the most extreme case would be to have the entire story contained within 1 if statement with all the other possibilities nested within) or to have a 'flatter' structure where each chunk of text is given its own set of conditionals, making minimal use of `elseif`? Or something else?
I could imagine either being faster/more efficient based on the specifics of implementation and wonder if you guys would know.
- Is there anything else that would help?