Choose Your Own Adventure Mobile App

So we want to build a mobile app for a "Choose Your Own Adventure" game. Let's start by creating a list of features that we'll need to implement:

Story

That's right, we'll need an actual story! Luckily, my sister is a dab hand at the old writing business, and has agreed to take care of that (with the help of a friend).

Art

Ideally, it would be nice to have some illustrations to spice things up a bit. Again, I'm in luck, one of my sister's friends is an amazing artist and is on board! If things keep going like this I won't actually have to do anything myself!

OK, now for some technical stuff:

Mobile Platform

I'd like to be able to run the app on both Android and IOS devices. Decision one: are we going to write two distinct native applications using the respective coding environments for each device or should we look to build the app using a cross platform framework? Life will be a lot easier if we can use a framework that lets us write the app in one environment but deploy to both Android and IOS without having to translate our code into new languages. The normal drawback from not going native is that there may be a performance penalty. The good news for us is twofold. Firstly, in 2018, technology has improved a lot and many of the available hybrid platforms are getting really close to native performance (or are really good at generating native code in smart ways). Secondly, the nature of our application is not something that should require high performance. We are just looking to render text and images. The most excitement we are likely to see is a few basic animations to gloss up moving between screens, there shouldn't be a need for 3D models, videos or any major animation.

So, it's probably safe to go with a cross platform framework. Cool, let's just Google what the best one is and use that. Oh, looks like there are still about 20 or more to choose from... (see this link for example). At this point it might be prudent to take a bunch of time to assess a number of these frameworks, maybe build a couple of simple prototypes to get a feel for performance and coding style. I also like to read blogs discussing the different platforms, it's often a good place to find an honest discussion of their various strengths and weaknesses. This is exactly what I did about a year or so ago when I had to build a mobile app for work. My conclusion at that time was to use the Ionic Framework. Things being as they are, a number of new frameworks have since shown up, and many of the older ones have made improvements. Ionic itself is now at version 3 and working hard on version 4 last I heard. I enjoyed using Ionic before so I think, for now, I'll keep with what I know. For my next project after this I'm tempted to try out either NativeScript Vue or perhaps React Native. They seem to be the new hotness!

How To Control The Story Logic

We need some way to hold the story content (text and images), available choices (actions or decisions for the reader to choose or make) and a syntax for describing how the reader can progress through the story (start here, go there, if choose option 1 then go over there, option 2 go to that other place).

Browsing the web a little, it seems that people have actually come up with a few ways to address exactly this problem. There is inklewriter, which created it's own scripting syntax named "ink". There is Twine, which has a pretty cool graphical UI. There is also "ChoiceScript" from Choice Of Games. Both ink and ChoiceScript decided to store the entire story and logic in a script file. Twine went the route of compiling everything into an Html output. This would be good if we wanted to host our story in a website but maybe not so useful for our mobile app. Either of the scripting options might work for our needs, however, I would prefer to store the story and logic in a JSON format, which has a bit more structure than a simple script file. Ink does provide an option to export to JSON but it seems to be overly verbose. I also want to build a user interface (UI) for my sister to be able to write the story in. I could ask her to learn one of the scripting languages but I'd prefer to make her life as easy as possible.

If I'm being honest, the part of this project that intrigues me the most is coming up with my own syntax for storing the story logic, and then writing a parser to interpret and render the story accordingly. So I'm going to do exactly that thank you very much! It's my project after all!


In our next adventure we'll dive deeper into the story syntax. Stay tuned!


Comments

Popular Posts