Real Time in Interactive Fiction

I am toying with the idea of creating a CYOA game with real-time elements (e.g., events that can occur without input from the player). Which authoring system should I use?

2 Likes

Inform6 does arcade games. If you can hack that, then you can hack CYOA system out of it also. :slight_smile:

1 Like

I think @HanonO can speak more to this, but the AXMA system is really good at this.

2 Likes

I have done many games with real-time events using AXMA, although it’s not a popular option due to various reasons. This is done using the “repeat” macro that repeats a specific passage at specified timed intervals. It can be used to print messages, check variables, delay text, tweak the music that’s playing, and change the passage being viewed. Multiple repeat macros can be in effect at once.

The game where delays and real time events are most obvious are in my IFComp entry from last year where it was the basis of real time combat, live “player” chat during the game, and other effects.

EDIT: I use AXMA 6 since I don’t know JS, but the AXMA JS version can take advantage of everything Javascript does as well.

Simplest example: I want the player to see a passage and then there’s a knock on the door after 5 seconds that adds more text to the screen.

:: Apartment
You are standing in your apartment. 

<<repeat 'knock' 5>>
:: knock

Someone knocks on the door heavily.
[[Open the door and see who it is.|dooropen]]

<<stop 'knock'>>
* If I don't stop the repeat, it will occur every five seconds indefinitely.
4 Likes

Wow, I cannot begin to imagine the work that must have gone into that! :grinning_face_with_smiling_eyes:

Thank you, all who have replied!

Thank you, HanonO. AXMA looks super promising!

Do you know of any reason why it would be undesirable to use it in a sprawling work with several events happening at regular intervals?

The key is making use of timed-input. The other is discrete control over things onscreen. My own Inform6 game that’s not interactive fiction (robotfindskitten) doesn’t use timed-input, but it does use discrete control. The basic engine took me maybe two or three days to create.

3 Likes

There is a library extension to make use of timed input - inform-realtime-hack-610.zip. It’s made for library 6/10, so you’d probably need to update it if you want to use the newest library.

1 Like

Since fyrevm and fyrevm-web separate game engine from IO, it would be relatively straightforward to implement automated “invisible” commands to allow the game engine to “work” without the UI knowing what it’s doing. I’ve toyed with this a few times, but I had no practical use case to go further.

1 Like

To elaborate @DavidG response, here is the relevant passage from DM4.

Moreover, on most interpreters
you can set either kind of keyboard-reading to wait for at most a certain time before
giving up.
@aread text parse time function -> result
This opcode reads a line of text from the keyboard, writing it into the text string array
and ‘tokenising’ it into a word stream, with details stored in the parse string array
(unless this is zero, in which case no tokenisation happens). (See §2.5 for the format
of text and parse.) While it is doing this it calls function() every time tenths of
a second: the process ends if ever this function returns true. The value written into
result is the ‘‘terminating character’’ which finished the input, or else 0 if a time-out
ended the input.
@read_char 1 time function -> result
Results in the ZSCII value of a single keypress. Once again, function(time) is called
every time tenths of a second and may stop this process early. (The first operand is
always 1, meaning ‘‘from the keyboard’’.)

And you also want window property “x cursor, y cursor”.
HTH.

1 Like

I have certainly written some sprawling works with AXMA, but a few people I’ve had try it have encountered some issues that made it not work for them.

It’s Russian-developed, and it’s possible it might not be getting much support anymore. 6.1 has an English translation of the manual where AXMA-JS does not (it’s listed as “coming soon” but it’s been a while). This might not be an issue if you understand JS and use Google Translate.

Reasons you might not wish to use AXMA
  • There are a some weird idiosyncrasies in 6.1 I’ve just learned to live with and work around that aren’t really explained in the manual but I figured out via trial and error.
  • There are a couple types of syntax mistakes you can make that won’t trigger an error message on compile and will only be discovered on playtest - usually by a randomly blank screen.
  • 6.1 seems to have a bug on PC where sometimes dragging passage windows in the interface doesn’t work correctly - the “handle” to grab the window is often in a weird offset place instead of the passage title bar where it should be. My games have so many passages that I’m not so worried about the structure, and turn off the passage connecting lines and just make stacks of related passages, neatening them together by dragging them on top of each other when I open AXMA on Mac OSX.
  • The program won’t export directly to HTML unless you buy a license - not a big deal at about $20 USD, but the export has to log into your account online to verify before exporting. This is not a big deal if your stories are small and don’t use tons of multimedia - you can upload to the AXMA library and then download the HTML file, but I believe you can only directly edit HTML if you export directly with a licensed account.
  • The major problem I’m very sad about: Further development of AXMA seems to be all but abandoned. I’ve gotten some responses from the devs when I’ve had to change my password, but I also had trouble installing on OS X Big Sur…the devs seemed not very interested in advancing 6.1 or JS to work on current Macs. The online browser editors seem to work just fine unless you want to do complicated multimedia (images and music.) The official forum has a few messages every month, but these have largely been going unanswered, and there has been little activity on the Russian IF forum that has an AXMA section.

If you’re not using a ton of multimedia and your games are only of moderate size and you don’t need to tweak the HTML directly, the online AXMA browser editors seem to work just fine on both PC and Mac, and you can upload your game for free privately to their library and download the HTML for distribution purposes. The Russian library has some incredibly creative titles that have been made with it. I’ve browsed a few despite not understanding Russian, and have been able to play a few online via Google Translate - which mostly works during online play.

2 Likes

I7 in action:

Proof of concept: Text adventure graphical RPG-style game - Technical Development / Development Systems - The Interactive Fiction Community Forum (intfiction.org)

1 Like

Thanks, once again, to everyone who has replied!

I’ve ruled out the following suggestions:

  • AXMA JS: This looks like it would be almost perfect for what I have in mind, were it not for the fact that there is no documentation. Also the fact that it has been around for a while without documentation makes it look a little too much like abandonware.

  • Brian Rushton’s Marriage of HTML and Inform 7: This is nothing short of amazing, but sadly there is no documentation for this either.

  • The Inform extension for timed input (as mentioned by fredrik): I have coded next to nothing in Inform 6 (or Inform 7), so I am afraid I am not going to be the one to update the extension.

It looks like I am going to have to see what I can dig up on Inform 6, timed input, and discrete control.

Is there anything I am missing?

1 Like

You may want to look at a few " Realtime" games on IFDB.

https://ifdb.org/search?searchfor=tag%3ARealtime&sortby=&pg=all

and see if deconstructing these will help you structure your game.

1 Like

I am not at all familiar with Twine and its various formats, but I feel like they might be a better fit? My understanding might be wrong, but my sense is 1) they’re already focused around choice-based design, which sounds like where you want to head, so you wouldn’t need to completely kitbash that aspect like you would with Inform 6; 2) Javascript is easy to integrate, and given your positive mention of AXMA JS sounds like you’re comfortable with that language; and 3) there’s a big community with lots of documentation, tutorials, and potential support.

I’d defer to others who know Twine better, but even based on my limited knowledge it sure seems like it’d be worth at least considering.

2 Likes

Yeah, Twine would be worth looking into: AXMA is heavily Twine-inspired so a lot of the functionality is similar.

Twine has several different “story formats” which are sort of different command languages. They all (?) share the double-square-bracket syntax for links, but other commands are expressed in different ways.

Harlowe (the default Twine story format) has (live:) and similar commands: there’s probably something in that family that does the same thing as AXMA’s repeat.

SugarCube (another popular Twine story format) has <<timed>> and <<repeat>>.

3 Likes

Yes, this looks quite promising. Thank you, Josh and Mike!

3 Likes

If you’re familiar with Javascript, Twine/Snowman could be your best choice.

Twine is a great platform for composing a branching narrative. The Snowman format will let you add any custom JS functions you need, inline or as external .js files.