Wednesday, 11 July 2018

The battle for vertical space on Android

I thought I'd do a small blog post on the problems I've been having with Android, for about a year now. This post relates to just trying to get a serviceabile keyboard-based UI going on Android, and has nothing to do with the gesture / touch optimized UI that is scheduled for release later in the year.

The first problem is that Android's soft navigation buttons are impossible to remove (without hacking your phone) when the soft keyboard appears. This eats up valuable screen real estate.

The second problem (in Android OS) is that when the keyboard is visible (together with the soft nav buttons), so is the status bar at the top of the phone. This has the unfortunate effect of overwriting some portion of the location header text. It also takes you out of the immersion in a pixel typographic experience (if that is your game). Pixel fonts look great, but only when not mixed and matched with modern antialiased typography. I guess Adventuron is an edge case!

The third problem is that the GBoard software keyboard (the standard Google software keyboard that ships with the majority of phones), is antisocial when it comes to vertical space. I can set an INPUT widget to require noautocomplete, and the old Google Keyboard would honour this request. The new Google keyboard still takes vertical space but doesn't show autocompetions. It looks hideous. This can be rectified with installing a keyboard - such as simple keyboard, but it's too much to ask a casual player to change their system keyboard. I'm very disappointed with Google's decision to not give app developers the option to use that vertical space for themselves. Maybe it's a security feature - to stop web apps from pretending to be the autocomplete bar? Who knows? ... but it makes using Adventuron on Android an awful experience.

The fourth problem, and one that I have been pushing to have fixed in Chrome for over a year now is the full screen immersive mode is simply broken in that the bottom area of the view area is obfuscated by the visible keyboard. You can't scroll down and see the invisible area. It's just plan broken.... but there is some hope that this *may* be fixed in Chrome 69. Let's see.

... for sure problem #1 and problem #2 are not getting solved any time soon. In my view, these are poor design decisions at an OS level, and the only workable solution is a bespoke written software keyboard as a bottom clipped widget... So that's ultimately what I'll have to do.

Assuming that problem #4 is fixed, and assuning that the player installs a keyboard that respects the NOAUTOCOMPLETE attribute, then this is the best that will be possible on Android (until I build my own integrated keyboard):

In terms of iOS, well, no problems. well done Apple.

Never say never, it's possible that GBoard is fixed, the Chrome fullscreen issue is fixed, that new versions of Android do away with the status bar showing when the keyboard is up, and Android allows the sofware nav buttons to disappear when the keyboard is up. Or maybe Google just builds in per-app keyboard preferences, that lets users select a more optimal keyboard -only for text adventures. But it's a lot of ifs. Right now, and at least a year into the horizon, Adventuron will be sub-optimal on Android, at least, without a hack of the highest order (building my own software keyboard).

The good news is that the screens are getting longer, and that it actually does feel quite good to type on a mobile keyboard. In time, all of this will be resolved, let's hope.

Saturday, 7 July 2018

The Final Minute

The Final Minute as an experimental piece of interactive fiction, that integrates an innovative real-time text-based sports-action mechanic and multiple endings. Blurring the line between fiction and reality, TFM integrates the real-world news-cycle into gameplay.

As timeless as the pop songs in Shrek, TFM is best experienced today.

What would you do, in THE FINAL MINUTE?

'Secret' map-drawing commands

Adventuron doesn't yet have an integrated auto-mapper, but it does have something of a workaround that might help help players draw something of a map.

These commands should be typed "in-game", at the command line....

Using "The Quest For the Holy Snail" as a demo game here:

Type in:

> drawmap

... to output a text based map of locations that you have already visited.

Type in:

> drawmap all

.... to output a text based map of all locations (based on the navigation table).

Right now, this process isn't super smooth, so my apologies, but the text based maps need to opened in a text editor, then copy and pasted into and the map will be rendered, courtesy of the plantuml and graphviz libraries.

The maps aren't north-centric, and therefore are sub-optimal for instant "grokking", but this will improve in future releases.

It's difficult to know if the "all" variant of this encourages cheating, or spoiling the game for the player, but if an author is concerned about the all variant, they can block it using a custom T1 handler.

Thursday, 17 May 2018

Keyboard shortcuts in Adventuron Editor

It has come to my attention that I have not properly drew attention to the keyboard shortcuts that make editing in Adventuron's editor fast and easy. So here they are.

Adventuron Actions

Adventuron actions trigger adventuron specific events .

  • Control + Spacebar = Context Sensitive Autocompletion Options.
  • Control + S = Save document (to local storage) + refresh game window. NOTE : Currently Adventuron's web UI does not support saving more than one document at a time locally.

Text Navigation Actions

Text navigation options allow game authors to navigate around the document using the keyboard.

  • Page Up = Move up by one screen worth of text
  • Page Down = Move down by one screen worth of text
  • Home = Move to beginning of start of text on current line
  • Home then Home = Move to absolute beginning of current line (before column 1)
  • End = Move to end of current line
  • End then End = Move to end of text on current line
  • Tab = (not after autocompletion has been selected) Insert three spaces into a document. (After autocompletion has been selected) move to next demarcated block of text to be edited.

Text Selection Shortcuts

Text selection allows game authors to select blocks of text without using the mouse (or touch).

  • Control + A = Select all text in document
  • Control + Home = Go to beginning of document
  • Control + End = Go to end of document
  • Shift + (Up or Down or Left or Right or Page Up or Page Down Or Control + Page Up or Control + Page Down or Control + Start or Control + End) ... select additional text between current cursor position and new location - as per descriptions above.

Text Mutation Options

  • Del = Delete character to right of cursor, or delete SELECTED TEXT.
  • Backspace = Delete character to left of cursor, or delete SELECTED TEXT.

Text Actions

  • Control + F = Find text in document
  • Control + F then Control + F = Replace text in document.

NOTE : This list is Windows-centric. Please replace "Control" with "Command" on OSX.

Friday, 11 May 2018

Adventuron 0.5.7 released - Fixes for Chrome 66

Adventuron 0.5.7 has been released with fixes for the new audio blocking features of Chrome 66

See Article:

A Google Chrome update breaks the audio in numerous web-based games

Unfortunately, in adventures exported (via HTML5 export) with 0.5.6 or earlier engine, any Adventuron adventures using a BEEP command will hang on Chrome (66 or greater).

This happens because Google appears to have broke web standards in it's implementation of blocking audio on autoplay media.

Google's heart was in the right place, but it just broke thousands if not hundreds of thousands of web based games, many of which were and are absolutely standards compliant.

Adventuron sequences game events using callbacks, so a sequence of commands is structured as a chain. You can think of this as a game of pass-the-parcel, with each task that Adventuron executes, being aware of the person they will pass control to next.

Tasks such as "set the value of a variable", "create a game object - such as a lamp or a shovel", "make a beep sound", "clear the screen", "display an image", etc.

With Chrome 66, the audio playback policy changes created an issue when playing a beep instigated a non-handled error that meant the next command in the callback sequence was not being executed, therefore the person at the end of the chain that is responsible for re-displaying the prompt, never performs their task.

This lead to a hang of any games that used a BEEP command (on the Chrome 66 or above browser).

The fix for 0.5.7 was threefold:

  1. To create the JavaScript AudioContext ONLY when the first beep is played. This is usually after the first user interaction (touch, mouse click, or keyboard press). It's possible that games that start with a beep will still hang (I haven't fully tested it yet), but this should be a fix for 99% of scenarios, which is better than nothing for now. It'll be 100% in the next release, just thought it was better to get this out there.
  2. To call AudioContext.resume() prior to any any beep. This is near-zero cost (in the grand scheme of things).
  3. Strengthen exception handling in the audio playback - this should hopefully mitigate bugs that might occur on games that start with beeps before user interaction.

Future fixes (not in this release):

  1. Detect when games start with beeps before user interaction, and force a "Click to start game button" to appear first.

Entity Disambiguation Demo

Adventuron features engine-level adjective support, and entity disambiguation. A short demo of this feature is show in the video below.

Friday, 20 April 2018

Packaging your Adventuron game inside a HTML file

The IDE for the 0.5.2 release of Adventuron added a feature called "Save HTML5 Game".

This feature allows a gamefile to be saved in a HTML wrapper, alongside the game engine, and all required assets.

In the future, this may not save 100% of all assets (as ambient sound and active sound effects are due to be supported in the future), but everything else, and all current supported features are embedded.

The HTML5 wrapped Adventuron engine can be used for non-commercial text adventure games free of charge. So far, Adventuron's HTML5 UI is not ideally optimized for mobile clients due to vertical space annoyances in the OSs, like this Chrome issue is still not fixed after 1 year. I'm going to make a larger post about this someday, but it still does work on mobile clients, albeit, a bit scrunched up.

Anyway ..

The first batch of games released in this format can be found here.

I look forward to seeing more games distributed in this format.

The battle for vertical space on Android

I thought I'd do a small blog post on the problems I've been having with Android, for about a year now. This post relates to just tr...