What if you did it client-side? Then it wouldn't strain the servers at all, in theory. You'd just serve an HTML page with inline code as-written by the author, and each browser would crunch the numbers using locally cached shit. It's not like these things are competitive multiplayer.
Interesting. What kinda restructuring? I figured the server would just be serving plaintext stories like it always has, and the client would be the only thing to change. I can't think of any reason to touch the backend. Maybe I'm misunderstanding what you mean by "restructuring."
Right now, the server does most game mode stuff. So that needs to be shifted to frontend. And there might be some restructuring to make sending/receiving data more convenient and faster.
I would love an RNG feature - I could find use for it as a standalone to generate random tips or events for the reader, or if the range can affect/be affected by other variables as a way to create probabilities in the story, like creating a battle system of sorts. As for where the option should be, wouldn't it make sense to it put near the conditions? A checkbox of "Enable random generation", then listing a variable to contain a result from X to Y should work. Since variables reset to their earlier state when you go back to a previous chapter, I'm assuming there's some kind of rollback - with a seed for the RNG it means you could just reset it to avoid "rerolling" your result.
As it creates/modifies variables, I guess it would make sense to have that as a Score Change. Currently, the rollback doesn't use the given calculation but just goes back to the previous chapter's Score. (Otherwise, rollbacks of operation that caps at the maximum or minimum values would result in wrong score values.) That means, that the reader could basically cheat by going back and forth until they get a result they like.
I hate to necro a thread that is, uh, three years old, but does anyone know if any progress was made in this, and if so, how to use it? I've used Twine to design a CHYOA friendly combat system (I'm making a fantasy ero-adventure story) with bitch basic variables and it should 100% work when uploaded, it just needs access to random variables to do some calculating.
A simple version to use Random Numbers has been implemented for Score Changes. For the usage of the feature, see Creating Random Numbers.