Twine Dev Questions: Making A Mobile Game App Using Twine

The following is a project I’m wanting to develop and I’m looking for the right solution to get it done. My search has led me to Twine which, so far, appears to be able to handle 3/4 of what I need it to do. The question regards the rest of it, and how to go about getting it done. If Twine is not the right tool for the job, any suggestions on what to check out instead is most appreciated.

First, fundamentally, the game is pretty much a form with user submitted answers which can/should be able to be done with js. Whether Twine can do it is the question.

The game is a puzzle trail. This is from the old school 90s era html puzzle games with the puzzle on page 1, the user types in the url with the answer as the page e.g. domain.com/game/answer.html format.

In an app version it works like so:

Start or intro page to describe the game and objective and issues an example puzzle worth 100 points.
The player clicks start and goes to a new page.
On this page is either 1. text, 2. image 3. audio/video as the puzzle
Below that is the text “Answer” and beside that is a text box for the user to input the correct solution/answer
If correct, the player is awarded 100 points.
If incorrect, a message “Incorrect” is displayed. They cannot proceed until they input the correct answer.
The correct solution moves the player to the next page & puzzle in the level (passage)
All points are tracked, adding to or subtracting from the total on any given puzzle
When points reach a specific amount or last puzzle is complete, the player wins.
When points reach 0 the player loses, a Game Over page is shown, with the option to try again.
If they try again, from the start, all points and user input data is cleared.
A “stats” bar showing the current level, correct answers, incorrect answers, total points would be maintained across all pages and tracked.

That’s basically all there is to it.

From there, it is converted into whatever the required format to publish on the app stores for sale.

If Twine can do all of this but the app store is not an option in 2022, then the next option is a free to play browser game hosted on my own website, but the file itself with the source code is not handed off to people to run in Twine and do whatever. It needs to be as secure as any other web page, no view source, no inspect option for the actual code, so the solutions are not on display. It is a game, after all.

Finally, in either game format option, is there a way to do a purchase to play option so they get a page link to play the game or to download it as a game without being able to see the code structure and bones…just to play it.

Thanks! I hope someone can point me in the right direction. It’s a stupid simple game…I just don’t know what tools to use to make this happen.

I hate to be the one to tell you, but web pages do have view source and inspect options. Twine games on your web site will also. Inform games can be downloaded and disassembled. We’re working in an open-source environment here.

While there are techniques a web developer can use to try to limit an end-user’s access to the source code of the current web-page being shown, like suppressing the content menu and intercepting the short-cut keys used to access the Web Developer Tools, those techniques are fairly easy to overcome.as a web-browser isn’t designed to restrict such access.

The common process of converting a HTML file into a hybrid Mobile device application generally consists of embedding the HTML within a custom (Chromium based) web-browser, and again it is fairly easy for the end-user to gain access to the contents of that HTML file.

Generally if a web-developer doesn’t want an end-user to see something, like the comparison of an entered value with a “secret” value, then that something is processed on the web-server itself because the end-user generally doesn’t have access to the code being run there.

Soooo none of that makes any difference if twine cannot create the actual thing I asked out though.

There isn’t a way to prevent people from seeing the source code. However, there’s still a way to hide the answers in your code using hash functions, so that even if they see the code, they won’t find the answers there.

If you’re using the SugarCube story format of Twine, you could use the code found in the “Simple Password Hiding” section of my Twine/SugarCube sample code collection. That shows you how to turn text into a hash value (e.g. turn “password” into “1216985755”) and then you could just check their answers against any possible hash values for that question (I’d recommend changing their answer to all lowercase prior to hashing them using the .toLowerCase() method so that capitalization doesn’t matter).

Even if the player has access to the source code, there’s no way to turn any hash values back into a text string (at least not without running a prolonged brute force attack).

Everything else you described, other than hiding the source, sounds doable.

Hope that helps! :slight_smile:

Why do you want to do this? If the player chooses not to do the puzzle and to view the to source to look up the answer instead, who’s lost anything?

If the puzzle beats them, but they’re enjoying themselves so much that they want to view the source to look up the answer so they can get to the next stage, but they can’t, who’s gained anything?

If they can’t look up the answer and for some reason they measure their self-worth in whether they can solve your puzzle and they consider viewing the source an acceptable method of ‘solving’ the puzzle for purposes of self-worth measurement… so what?

Exactly!

1 Like

All right. I’m editing this question because every single person who bothered to respond went on about the least relevant thing mentioned as an aside. This is what I would like to know…

CAN TWINE…

Have the first page display a) text b) image c) audio or video file
Have the first page display a text box
Have the player type in an answer in that text box
Have the correct answer a) be rewarded with points b) go to next page for new question
Have the incorrect answer a) display “incorrect” b) offer 3 chances to get the correct answer c) deduct points on final fail
Keep track of all of the incorrect and correct answers, calculate rewarded or deducted points, display current level/scene, etc.
Display Game Over screen when points reach 0
Be converted into whatever format to be published in the app stores
Be converted into a standalone game to share, launch and run on the phone as a mobile game without going through any app store e.g. direct purchase off a dedicated website, download game to phone, install, run, etc.
Be converted into a browser based game launched as another “page” from a dedicated website
Be converted into whatever format to be downloaded and launched on the desktop, in offline or online mode

It either can or it cannot.

I’m not interested in a story. I am interested in a puzzle game with user supplied input to advance to the next page. I wondered if Twine could be useful for this since it’s basically a js based form whose answer transitions to another page when correct, with a points system.

I can make the “game” and the form and make all that work using js. What I cannot do is get that into a game format for the mobile, browser or desktop so I am looking for a tool that can.

Can Twine do it or not?

Thank you.

YES

Twine builds a single page server-less HTML/CSS/JavaScript based web-application, and everything you describe can be done with/to such a web-application.

The likely reason people focused on the “securing the source code” aspect of your original list of requirements is because you made a big deal about that being a major requirement.

I literally did not make a big deal about it. I mentioned it as an aside at the end of the question…

I’ve decided to go with gdevelop anyway so whoever can lock or delete this pointless thread.

Thanks for all the “help”

As I said before, everything else you described, other than hiding the source, sounds doable. Other than converting it to an app, most of it is ridiculously easy too, thus why people didn’t put much effort into commenting on it.

The only caveat being that most modern browsers require that the user interact with the page first before audio can be played. Thus you’ll likely have to wait until the user has clicked something first to play audio.

As you were already told, yes.

No need to be so rude about it or act like that question wasn’t already answered.

Treating people like dirt when they were literally going out of their way to try and help you is hardly a decent way for an adult to behave.

I’d recommend reflecting on your actions here.

Actually, it’s because Zarf answered the question, and other people latched on to the subject. It’s certainly very frustrating when people answered the already answered question and ignore other, more important questions of the post.

And when it’s pointed out, suddenly the OP has an “attitude.” It has happened several times, BTW, so I see no solution to the problem.

IMO, the question hasn’t been answered. The correct answer would be: Yes, see [part of relevant documentation]

So, acting like the question hasn’t been answered is understandable. No need to shutdown the question because you think “yes” is the whole and complete answer.

Note: Just to head off confusion, Zarf is right to answer the question the way he does. It’s the way other people latching on the subject that is unhealthy. It’s too close to thread hijacking, IMO.

Note: Nobody is forcing you to answer if you don’t want to. Discretion is the better part of valor. Silence, too, is an answer.

And how are we supposed to do that when they haven’t even said what story format they’re using? Are we supposed to go point by point through the documentation for all story formats? Especially when they could find most of those answers fairly easily if they’d just looked themselves?

It’s kind of ridiculous to expect that, and I see that you didn’t attempt to do that yourself.

Also, I’ll remind you that the question was summed up as:

How is “yes, it can” not an answer to that? Also, if you take a look, they didn’t specifically ask how to do any of it, they just asked if it could be done. Again, “yes” is the answer to that question.

If they wanted an answer to, “How do you do X?” then they should have asked a question like that and said what story format they’re using.

Of course, I have no desire to help them anymore after this display of disrespect towards the people who tried to help them.

I believe the one caveat is if you have audio or video on the very first page of a Twine that is displayed in a browser, the user’s browser-settings may not play it due to individual security settings. The player must interact once (click forward to a new page) to enable sound/video. (I believe this is to prevent spam-style audio popups when pages intially open.)

Please keep the discussion civil. We’re all trying to help each other.

Sometimes complex questions require follow ups. It is not constructive to argue that the question hasn’t been answered immediately or as succinctly or in the exact manner as the OP might prefer.

Many people here are very generous with their time and knowledge, so clapping back at free advice, or instructing someone how they should have answered a post really doesn’t do anyone any good.

1 Like