[dev] The Choice-Fiction Writers Tool for Android

I feel I should point out that this quote seems to be the only mention of open source, it doesn’t seem to be mentioned on the resources you link to either (also you don’t seem to have asked any questions, at least in the current version of your OP?) Is the project open source? And if so what do you mean by that, is it say MIT/BSD licensed, or GPL, or is it dual licensed so authors choose between paying a fee to distribute their games closed source or distributing them open source along with say your GPL code? The intention is unclear to me… can we for example see the Java source for the Android app?

On Texture you note that it requires an Internet connection yet I believe the games can be downloaded as HTML files and presumably could be packaged using say Phonegap to run as Android and iOS apps. I suspect that Texture is a simpler system that your own with less scripting ability, however your “summary for version 1” sounds more like what little I know of Twine, which like Texture is also web based, in that it uses client side web technologies (HTML, CSS and Javascript to run).

I am curious what you mean by “You have a range of devices that wont work (properly) with javascript.” especially as it seems the demands of an “expression interpreter to evaluate logical and mathematical expressions” would be rather basic, and it looks like you are depending on a WebView for rendering your layouts. What devices have such poor Javascript support that they can’t handle simple expressions? (I actually want to know btw; I understand there are limitations when it comes to newer HTML5 features, especially pre-Android 4.3, but the devices with really poor support, must be in a tiny minority which is ever shrinking as devices get dropped or traded in for newer, better models) Without further explanation it just sounds like you don’t like certain technologies, which is fine, it’s just that’s different to claiming nebulous problems (you mention wanting to be “native” but your screenshots look no more native then HTML running in a webview).

With the suggestion “I will release the first version of the editor in the playstore for free and ask for donations if you find it useful or like to see further development.” I see that as being rather a tough sell over an open source, well established Twine 2 backed by an existing community. Not least because while an author might have some pain to use say Phonegap to publish a Twine story on iOS and Android, the author knows that their story won’t die even if Twine’s community (not a single person) were to vanish; it would seem with your system the author is dependent on your app for their work to live on, and they have to trust that you will neither release changes that will break thier story nor change the terms that make that app available to end users in order that those users can play the author’s story (I myself am new to the community but I have noted concern over format support is a real issue - authors want their stories to be available for the long term and it seems that they have seen many authoring systems/formats)

I do think it’s great that you have solved a problem for yourself, I just feel you have shared less information about your intentions in this thread than your replies seem to suggest you feel you have, and from what you’ve actually mentioned it seems premature to ask people to buy into this idea. I’m sure there is room for alternatives for authoring choice based games, but it just seems like you dismiss the existing solutions too flippantly, and the people trying to help you too callously, for this to be worth much attention in my humble opinion.

Yeah, good point re: hijacking your topic. Your title is now more specific.

Thanks for your reply turnip, good questions. Thanks for pointing out that you’re missing info.

What is opensource is the saved stories, in plain json format. They are very simple to understand. Anyone can build a writer or reader reading those files, so continuation of support is somewhat guaranteed by giving the format a low learning curve and free to the community to use.
I’ve been thinking what portions I want to release and what not. Certainly the Android reader. Possibly the basic Writer too, and perhaps offer a paid version with fancy stuff to dress up your story with images, music, themed colours. That’s for a later release though.

Possibly texture supports offline use, I might have judged that too quickly. My tool is native android, no html/javascript, webviews or internet involved anywhere. I stay away from webviews. The output is a json file, which can be put online using the javascript reader I also developed.

I support down to SDK 11, android 3.0 Honeycomb. It accounts for 99% of all devices. I started out using a webview, reusing the javascript reader I built, but already I hit html5 limitations on storage of local variables. Webview has had several developments through different versions, and taking in account all those iterations in code is a lot of testing and work. In my experience there will be several issues popping up with webviews both in different versions and different manufacturers (like Samsung). The complication webviews bring about does not weigh up to its benefits for me. I rather develop native Android and Browser applications in their own right. I found this detailed support overview: mobilehtml5.org/ for individual features. Several of them I need for a smooth experience that aren’t there for 3.0, such as vitual keyboard, Filesystem API and audio. Hybrid solutions make it all possible but too much hassle for too few benefits in my case. So yes I definitely have a preference for certain technologies, and not for others. But it depends on the project whether or not I will use them anyway.

Their work can live on without my app: the reader is also available in javascript and they can host it themselves on their own site. The editor, yes, it is possible I would take the app from the playstore (though as long as they keep it installed on their device, they’ll have that). But that chance is extremely unlikely. The only time I ever heard of a popular app being taken down was Flappy Bird. I have no such intentions. The app stays in the store indefinitely as far as I’m concerned. I think chances are bigger that Twine closes down. And because the saved story file is freely readable, someone could take the initiative to build their own reader/writer tool, further allowing continuation of individual works.

I hope I clarified some of the missing information. Everyone is free to buy in my idea or not. I see no downside of premature promotion of financially supporting my investment in this project. The sooner I can convince people of the potential of my idea, the better.
I will watch my words dismissing advice and suggestions too flippantly. I get annoyed quickly by negative-focussed comments, but that is something for me to work on.

Thank you again for your time to comment!

It’s no problem, title was deceiving.

I hear a lot of arguments to the effect; use web technologies HTML5/CSS/JS and build your app as a webapp using phonegap/cordova.

This is basically saying, use a browser as your virtual machine rather than the native platform.

There is some merit in this, but also some serious drawbacks. The biggest drawback is that your app, running on mobile, is going to look a lot like a webpage and not so much like a mobile app (unless you spend an enormous amount of work on it, in which case it will be slow).

This is not to be underestimated because users have come to expect a certain experience with apps that differs from web pages.

when was the last time you paid for a web page?

I realise there are web subscriptions to newspapers and so on, but this sort of thing is a really tough sell. Selling apps is tough enough because they’re intangible - but they are, at least, a thing (sort of).

Where a mobile app rises above a web experience, is user customisation, user settings, preferences and use of media - sound, graphics, animation etc. and sharing, don’t forget sharing.

FWIW, i’ve already abandoned Android < 4.1 (api 16). The other day, i battled to get my code working on 4.1 (from 4.2) by adding additional workarounds for bugs in Android 4. Even that probably wasn’t worth it because it sucks time away from improving the actual product.

The other “big lie” of web technologies is that they work on all platforms. They do, only once you spend hours of relentless struggling and cursing testing and fixing them. Cough Cough Samsung.

Having said that, there’s no shortcut to Android development i’ve found. it’s always fraught with pain.

Ain’t that the truth…

Hey everyone!

It’s been longer than I wanted but I made significant progress. Had to overhaul a lot of code for technical and UX reasons. Still not entirely happy with the UX but it definitely feels better than it was. I want to focus on having a basic online library available where you can upload your story for others to read. Then I feel it’s ready for an alpha release. :smiley:

The basic app will be free (possibly with ads, not sure yet).
I’m planning the following features in a paid version:

  • Ad free reading for readers
  • Add images in your stories
  • Change colour scheme of your story
  • Add background sounds per paragraph
  • Add “tip the author” button on the end of your story (probably paypal donation)
  • Get your story featured on the main page

As a writer, does this payment setup sound interesting to you?
I would add a paid option for sequel stories, but technically that is much more complicated to do. In the future that’s something I want to add though.

If you’re interested in giving this app a test, send me a PM with your email. If there’s enough interest I’ll upload an early release without server storage and invite you to the closed alpha :slight_smile: .

Screenshot:

Made some more progress. Struggling with finding a nice default colour palette. Added the possibility to add one image per paragraph, sharing now works via Firebase cloud storage, and you can share the link to your story over social media for others to read/play :slight_smile:. Writing my own story in it, I’m noticing there’s definitely several improvements to make things easier, especially if you start creating more complex structures. But at least you can now fully create a choice-based story and share it with friends.

Planning to release a first version really soon.

Image fingerpainted on Android with Adobe Sketch btw :slight_smile:.


I released the app ^-^.
Sharing now works over social media, and if I add your story to a reading category (will be automated in the future), it will be displayed on the main screen for people to read.

play.google.com/store/apps/deta … on.android

Now I really need to write something of a tutorial for writing a story, it’s probably too complicated to use it straight away.
If you like to give it a try anyhow:

  • per chapter you write descriptions and choices, choice names must be unique per chapter
  • descriptions are triggered by, and show multiple choices, if conditions are met
  • In condition textfields you can do basic expressions such as ==, !=, ||, &&, <= and >=.
  • use brackets around a variable name, lke [variable], to test against a variable which you have created/modified in a choice action.

I’ll be more than happy to answer any questions and receive constructive feedback <3 .

Next on the list will be a condition editor so you don’t have to type that stuff anymore.
Also, need to add search option and more helpful ways to display choices and descriptions.

Sharing example:

I also keep track on amount of clicks per choice, so you can see which choices are being picked the most. Writers will be able to view these stats and optionally readers will too on important choices.

Installed, looks nice. Thank you.

Thank you for trying out! Let me know what you’re missing or bothers you most, I’ll put it on high priority :slight_smile:.

Current short-term feature plans:

  • Add renaming title/chapters
  • Condition editor
  • Title/landing page at the start of a story
  • An IAP extension enabling:
    • Custom colors
    • Trigger background music
    • Personal author page with Patreon/Paypal link
    • Encrypted story files

Music, check
Personal Author page with Patreon link, check
Title page: sorta check

Halfways my list :sunglasses:

Bug report, I was trying it out on an Android 6 LG phone I have, and I had ADB logcat open. It was a fresh install off the latest Play Store release and I went into download option to add stories. It prompted me for SDCard storage permission and I answered affirmative. That’s when it crashed. Stack trace here:

FATAL EXCEPTION: main Process: net.choicefiction.android, PID: 14492 java.lang.Error: Can't read json from story at net.choicefiction.android.app.d.b(StorageService.java:119) at net.choicefiction.android.app.d.a(StorageService.java:58) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:368) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:192) at net.choicefiction.android.read.activity.ReadStoryActivity.onRequestPermissionsResult(ReadStoryActivity.java:427) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6595) at android.app.Activity.dispatchActivityResult(Activity.java:6474) at android.app.ActivityThread.deliverResults(ActivityThread.java:3788) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3835) at android.app.ActivityThread.access$1400(ActivityThread.java:163) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1411) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) Caused by: java.io.FileNotFoundException: /storage/emulated/0/ChoiceFiction/Downloads/users/users/stories/stories/stories.proj/stories.json: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:452) at java.io.FileInputStream.<init>(FileInputStream.java:76) at java.io.FileInputStream.<init>(FileInputStream.java:103) at net.choicefiction.android.app.d.b(StorageService.java:95) at net.choicefiction.android.app.d.a(StorageService.java:58) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:368) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:192) at net.choicefiction.android.read.activity.ReadStoryActivity.onRequestPermissionsResult(ReadStoryActivity.java:427) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6595) at android.app.Activity.dispatchActivityResult(Activity.java:6474) at android.app.ActivityThread.deliverResults(ActivityThread.java:3788) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3835) at android.app.ActivityThread.access$1400(ActivityThread.java:163) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1411) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) at libcore.io.IoBridge.open(IoBridge.java:438) at java.io.FileInputStream.<init>(FileInputStream.java:76) at java.io.FileInputStream.<init>(FileInputStream.java:103) at net.choicefiction.android.app.d.b(StorageService.java:95) at net.choicefiction.android.app.d.a(StorageService.java:58) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:368) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:192) at net.choicefiction.android.read.activity.ReadStoryActivity.onRequestPermissionsResult(ReadStoryActivity.java:427) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6595) at android.app.Activity.dispatchActivityResult(Activity.java:6474) at android.app.ActivityThread.deliverResults(ActivityThread.java:3788) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3835) at android.app.ActivityThread.access$1400(ActivityThread.java:163) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1411) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) W/ActivityManager: Force finishing activity net.choicefiction.android/.read.activity.ReadPublishedStoryActivity

Thank you and keep up the progress!

Thanks aliensocket for trying out. I saw the crash happen. Hadn’t tested the latest release on a fresh install. Will patch asap.

Got the update today, but still crashed. I noticed it said 12MB for the data this time, yesterday it was 10MB? Says version 1.3.2

D/net.choicefiction.android.read.activity.ReadStoryActivity: Story Uri: file:///storage/emulated/0/ChoiceFiction/Downloads/users/x3EoA6x00DZ2K4qAqPZcDunSdEO2/stories/The Spider Mountains/The Spider Mountains-4.proj D/net.choicefiction.android.app.d: Loading existing story /storage/emulated/0/ChoiceFiction/Downloads/users/x3EoA6x00DZ2K4qAqPZcDunSdEO2/stories/The Spider Mountains/The Spider Mountains-4.proj/The Spider Mountains-4.json D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: net.choicefiction.android, PID: 20943 java.lang.Error: Can't read json from story at net.choicefiction.android.app.d.b(StorageService.java:119) at net.choicefiction.android.app.d.a(StorageService.java:58) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:368) at net.choicefiction.android.read.activity.ReadStoryActivity.b(ReadStoryActivity.java:346) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:72) at net.choicefiction.android.read.activity.ReadStoryActivity$4.onReceive(ReadStoryActivity.java:318) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:953) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) Caused by: java.io.FileNotFoundException: /storage/emulated/0/ChoiceFiction/Downloads/users/x3EoA6x00DZ2K4qAqPZcDunSdEO2/stories/The Spider Mountains/The Spider Mountains-4.proj/The Spider Mountains-4.json: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:452) at java.io.FileInputStream.<init>(FileInputStream.java:76) at java.io.FileInputStream.<init>(FileInputStream.java:103) at net.choicefiction.android.app.d.b(StorageService.java:95) at net.choicefiction.android.app.d.a(StorageService.java:58) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:368) at net.choicefiction.android.read.activity.ReadStoryActivity.b(ReadStoryActivity.java:346) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:72) at net.choicefiction.android.read.activity.ReadStoryActivity$4.onReceive(ReadStoryActivity.java:318) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:953) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) at libcore.io.IoBridge.open(IoBridge.java:438) at java.io.FileInputStream.<init>(FileInputStream.java:76) at java.io.FileInputStream.<init>(FileInputStream.java:103) at net.choicefiction.android.app.d.b(StorageService.java:95) at net.choicefiction.android.app.d.a(StorageService.java:58) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:368) at net.choicefiction.android.read.activity.ReadStoryActivity.b(ReadStoryActivity.java:346) at net.choicefiction.android.read.activity.ReadStoryActivity.a(ReadStoryActivity.java:72) at net.choicefiction.android.read.activity.ReadStoryActivity$4.onReceive(ReadStoryActivity.java:318) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:953) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5585) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

Ugh, thanks. Yes I updated the demo story. I don’t know why but the android download manager adds a “-x” to the end of newly downloaded files if they already exist. There is no option to overwrite. I added code to remove any old files before downloading new ones, but apparently that doesn’t work properly on all systems. If you haven’t written any stories yet yourself, you can manually remove the ChoiceFiction folder from your sdcard to fix that. Once these bugs are fixed I’m switching to a beta release plan before updating production.

Found some time to try out the scripting language Ink through the editor Inky from Inklestudios. The syntax is very close to my json setup, and conversion should be pretty straightforward. Since their editor only supports showing text and choices, and no music/images/themes/etc, I think it would be very useful to hook their tool on Choice Fiction, so you can also write stories on pc and then publish to mobile platform and further decorate it and create atmosphere by adding sounds and colours, have access to a publication platform and easy sharing. So this will be my focus on the next weeks.

There will be very limited support on syntax and stories must be written in a specific way, but it’s a promising start.