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?
Inform6 does arcade games. If you can hack that, then you can hack CYOA system out of it also.
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.
Wow, I cannot begin to imagine the work that must have gone into that!
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.
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.
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.
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.
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.
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?
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.
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.
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>>
.
Yes, this looks quite promising. Thank you, Josh and Mike!
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.