Sunday, March 26, 2017

progress report

In recent months, I've seen Hugo mentioned in some unexpected places, and Dannii Willis is working on a glk interface Hugo web interpreter (to which I say, the more the merrier!).  The downside of this is that it has made me more frustrated with the ways Roodylib might be unaccommodating to beginners.  I've decided against my previous "throw it all in" philosophy for Roodylib and have been moving whatever code I can to extensions, and taking out code I'm not 100% satisfied with altogether.  I just want the heart of Roodylib as simple and readable as possible.

Unfortunately, this calls for even more updating to the documentation, so that'll be yet another process.  As much as I'd like to get a new Roodylib out the door, the interpreter opcode side of things isn't as hammered out as I'd like it to be, either, so it'll probably be some time yet.

Just to make this post fun, I thought I'd share some Hugo games hard-compiled with the HugoJS behavior that should work by default once the opcode stuff is all working right.

The first game is "The Hugo Clock" by Jason McWright.  Written for a Hugo minicomp we held a handful of years ago, it's a good example of a game that, despite lacking deep narrative machinations, hits that sweet spot of just being fun to poke and prod around with: The Hugo Clock

The second game, "ScepterQuest", was originally written with Hugo 1.2, back in Hugo's DOS-only days.  I ported it myself as a coding exercise some years ago (and because I find the game very silly and funny), but I intentionally never uploaded it to the IF Archive.  Still, check it out, and if you like it, go ahead and break out DOSbox and try out the original: SceptreQuest

In other IF news:

  • Bob Bates' Thaumistry: In Charm's Way hit its kickstarter goal.  People can still donate through PayPal to hit the stretch goals.
  • Jesse McGrew released version 0.8 of his ZILF compiler.  I'm well overdue to post to my other blog, ZIL Crazy After All These Years, but I'm really happy with how ZILF is coming along.
  • Andrew Plotkin and Chris Spiegel have been looking for official platform builders for the Gargoyle interpreter, and any steps toward more timely updates of one of the most popular offline IF interpreters are greatly appreciated!
  • The 2017 Spring Thing competition is just about to start.  I'm so glad that Aaron Reed has kept it running all these years.
  • One of my favorite videogame publishers, Devolver Digital, released a compilation of text adventures from a game company called No Code.  It's called Stories Untold.  Unfortunately, even with my settings set way low, it runs too slowly on my computer (I'm not so nostalgic for early 80s text adventures that I want to bring back waiting minutes between commands) but I look forward to trying it again if I ever get a nicer computer.
Apologies to all of the cool IF news things I am missing!

Wednesday, January 25, 2017

down the rabbit hole of parsing

I've been wanting to write an update post just to assure those that care that I have been working on Roodylib stuff, but it's been hard to pull the trigger as I imagine parsing quirks isn't very interesting to most people.  Then again, if I knew of some blog that was one author's exploration of parser theory or battles against an existing parser, I'd probably read it.  Just the same, anyone who doesn't care can skip down to the "In other news" section below.

So, what with the release of HugoJS, I really want the next version of Roodylib to be as flawless as possible, both for the possible re-release of older games (so they operate best in all kinds of interpreters and make use of Roodylib's accessibility options) and for future games.  To this end, I've been making "recordings" (*) of games with available source and testing the playback against both the original and Roodylib-compiled version and then checking for errors.

( * In several IF systems, typing "RECORD" in a game will begin a transcript that only writes commands to a file.  Then, the next time you play the game, typing "PLAYBACK" will allow you to select the file.  At this point, the game plays all of the commands from the recorded file,  This is a great way to see how the same set of commands affects different versions of the same game.)

Luckily, several of the games have available walkthroughs to make this easier, but it's still slow going; many of the games have random elements so I "normalize" the random number generator to make them predictable.  Several of the games use a conversation system that handles choice entry through GetInput which isn't caught by recording/playback so I wrote a modification to the conversation system to allow making choices from the regular prompt.

I had finished going through a couple games (and, in the process, found a couple Roodylib bugs) when I caught a conversation where Jesse McGew speculated about optimal ZIL behavior when it comes to disambiguation questions within multiple-command inputs.

Say you have a command like this:
The issue was, if the game responds with "Which box did you mean, the cardboard box or the glass box?" and the player chooses one, should it then proceed to process the rest of the command?  Inform does proceed, but making the player re-type the rest could be seen as a viable approach, as it is an error of sorts and every IF language is allowed its own expectations of how to handle such situations.

This got me curious about how Hugo/Roodylib currently handled it.  I found that if the player used the disambiguation system added by Roodylib (using "1", "former","2", "latter" and such to refer to listed options), it cleanly stopped processing the rest of the command, but if the player used the engine-based disambiguation system (typing in "glass" or "cardboard"), the rest of the word array got mangled and resulted in a "I didn't understand that." response.

First, I added some hacky code so the engine-based disambiguation also exited cleanly, but then I decided that I preferred the "KEEP ON PROCESSIN'" behavior and modified both versions to do that.

Unfortunately, this opened up another can of worms as I then noticed that the "G"/"AGAIN" code was somewhat broken.   Fixing this took quite a while as I had to re-acquaint myself with all of the parsing code.

Now, everything works again and, in fact, works better than it did before I started.  The old code, borrowed from the original Hugo library, only restored the last command when "AGAIN" is used, so a multiple command input like >SHAKE CAN. G.. OPEN IT.  would lose track of the rest of the command before it got to "OPEN IT". As in, when AGAIN is called, the entirety of the word array was replaced with just "SHAKE CAN".  Now successive commands are not lost and are properly parsed.

Now that I have it working, I plan to clean up the code a bit and maybe put in some hooks so authors can easily put in optional behavior.  For instance, if an NPC is given a command that is an xverb ("save","undo","restore"), Roodylib intentionally gives the error "That doesn't make any sense."  The previous Hugo behavior was just parsing it like all is well, likely leading to a "So-and-so ignores you." response.  So, I'm sort of considering putting in some kind of hook so authors can re-direct it to some kind of "So-and-so says, 'Do what now?'" response if they'd like.

As soon as I'm done with that, it's back to testing games, followed by more general code clean-up and documentation updates.  Given that real life has been fairly hectic and will be for the foreseeable future, this will be a multiple month process.

In Other News

Hugor's Nikos Chantziaras is credited on the development team for a new TADS 3 game by Bob Bates (of Infocom and Legend Entertainment fame).  "Thaumistry: In Charm's Way" is currently being funded on Kickstarter.  I was lucky enough to be in its first wave of alpha testers and found it to be quite a fun romp.  I've been watching the kickstarter progress obsessively and am really looking forward to the finished product.  I'm sure almost all readers of this blog have seen an announcement for it somewhere else, but I just wanted to throw my personal recommendation out there!

Wednesday, December 14, 2016

The 2016 Hugo Holiday Newsletter

December offers an exciting challenge to finish or improve the projects one has worked on through the year, and it's a great time to look back on progress already made. It's actually been a pretty exciting year for Hugo! Let's recap!

  • Nikos Chantziaras has continued making improvements to the multi-platform Hugor.  The opcode system he introduced in recent unofficial builds should make for a smoother player experience in the long run.  Some of the logistics of the opcode system are still being worked out (see below), but we probably can expect to see a new official build released in the coming months.
  • Robb Sherwin's work in progress, Cyberganked, has been greenlit on Steam.  Cyberganked is an IF/RPG hybrid like nothing the world has seen before, taking inspiration from games such as Wasteland and Bard's Tale.  The secret word on the street is that Sherwin's next game may be a sequel to one of his earlier works, so anyone who would like to see any of these things come to fruition should get involved with the Cyberganked community and help make this thing happen!
  • Jizaboz continues to work on his multimedia-enhanced North Korea simulator, A Day In DRPK.  From what I've seen of the work in progress, I believe it's more than two-thirds complete and most likely will be released in 2017.  You can check out the game's original demo here and check its progress here.
  • Juhana Leinonen accomplished the Herculean task of writing a Hugo interpreter in JavaScript.  HugoJS has a page where you can play any of a pre-selected list or use the link tab to play any .hex file from a URL.  The interpreter itself is quite snazzy.  Juhana had previously provided an Emscripten DOSbox solution which used the Hugo DOS interpreter.  HugoJS blows the old method away in speed, presentation, and ease-of-use on mobile devices.  My limited experimentation also led me to believe it should work decently with screen readers.

    Juhana has been updating HugoJS with Nikos' Hugor opcodes, and we've been in the process of adding new ones.  When all is said and done, Roodylib should work nicely with all existing and future opcode-enhanced interpreters.  It may even have multimedia support at some point, too.
  • Kent Tessman, author of Hugo, is busy updating and promoting his screen writing software, Fade In.  In recent years, it has been embraced by some of Hollywood's best screenwriters (and many others more) for its ease of use and astounding list of features despite being much cheaper than old "industry standard" solutions.
As for me, I'm working on updating Roodylib to incorporate the new opcodes and fixing some bugs.  I hope to have another official release within the next month or two, at which point I'll re-release all of my games so people can see all of the new functionality.

Wednesday, September 7, 2016

roody labs

My latest bit of Hugo coding has been comprised of distracted yet productive meandering.

*  * *

Roodylib takes several important Hugo library routines and breaks them up into several routines for the sake of readability and modification (I'd rather provide authors with a method to change just the important thing instead of having to switch out the entire 126 lines of FindObject).  Of course, one side effect of this is that it greatly increases the starting number of routines in any given game.  The Hugo default max limit of routines is 320.  Now, this is a changeable, soft limit, but it worries me when a Roodylib game creeps up to that 320 limit; I don't want it to get to the point where my beginning advice to new authors includes how to raise the routine limit.  They have enough things to take in at that point.

DescribePlace, the routine responsible for room descriptions, was one that I split into several routines so authors had the ability to change the order in which things are listed.  To combat the creeping-routine problem, I redesigned the routines as objects with one routine to execute them.  It's actually been done for a while, but I didn't mention it because it's kind of a useless modification, all things considered, and the number of routines probably only bothers me.

* * *

I also modified the "shell" files included with Roodylib to automatically compile with the -s switch.  This provides compilation statistics like number of objects, routines, etc.  I always find this useful; I figure others will, too.

* * *

Sir Jiz has a lot of timers in his game- most of which he's been handling with the room each_turn property.  I usually do this by keeping the number-of-turns-spent-in-room in the misc property so the each_turn property routine can have some "select self.misc" code and go from there.  Long story short, Jiz was getting sick of reminding himself where the best place to set the misc value was.  I figured, ah, yeah, I guess Roodylib could do something about that.  So now there's a RoomTurnCount thing so nobody has to mess with misc anymore.

select RoomTurnCount
case 0
"Runs as soon as player enters room."
case 1
"Runs after first turn."
case 2
"And so on."

Although maybe I should have pushed him towards using a daemon instead.  Ah, well, always nice to have multiple ways to do things.

* * *

Some months ago, someone expressed interest in there being a Hugo Comp this year, so I tried to gauge interest from everybody at the forums and throw some theme ideas around.  I had been in the middle of playthrough of "Spellcasting 201: The Sorcerer's Appliance" so I figured a magic-themed comp would be fun.  I even offered to throw together an extension for authors to use so they wouldn't have to write the magic system themselves.

I started off by looking at Cardinal Teulbachs' (yes, back in the olden days, we used to have an IF community member named "Cardinal Teulbachs") take on a spellcasting system.  His code strictly prohibited modification, though, so I was going to have to write my own thing by scratch (I don't always honor code licenses, but hey, this time I did).

I think I came up with the base design for my system, but I decided I needed to refresh my memory on how spells worked in the Enchanter trilogy (how many memory slots the player has, if all spells can be memorized multiple times- stuff like that).

The funny thing, though, is that I found myself super distracted by the fact that you could not read dropped scrolls in Teulbachs' sample game which was a departure from expected Infocom behavior.  Just the same, it made some sense, and I decided it'd be nice to write an object class system for objects that had to be held to be read (like a pamphlet) while still allowing for ones that don't (like a billboard).

More difficultly, I wanted to do this on the grammar level so all "You don't have that." messages didn't use up a turn.  Truthfully, it's not easy to have varied behavior when it comes to held/unheld verbs.  I knew that when I did get around to writing this system, I'd have to use my Roodylib "routine grammar helper" system.

I finally got around to looking at this problem yesterday.  It was one of those funny times where you return to an old problem a bit smarter and almost resent the obligation to improve your solution ("WHY CAN'T I JUST STAY STUPID FOREVER?").

First, to help me design the readable object classes, I looked over some grammar classes I had made previously for containers that are emptied in different ways (those that had to be held vs those that don't and so forth).  In my testing, though, the "empty" code wasn't working, and for a while there, I thought maybe I had broken FindObject somewhere along the way (and getting FindObject to do the things I already have it do was a scary, confusing journey so I wasn't looking forward to working on it again).

It turned out that a call to FindObject from AnythingTokenCheck (which itself is called from within FindObject) should have used the "recurse" argument.  Whew!

I also decided that half of my original "routine grammar helper" code was unnecessary.

But anyway, that's all working better now, although I might redesign the routine grammar helper again, possibly to use attributes instead of variable masking.

And, oh yeah, if you were curious, no, I don't think the Hugo Comp is happening.  That discussion fizzled out pretty quickly.

* * *

STATUSTYPE is a global variable that determines what kind of information is displayed in the upper right corner of the status window.  One of the several options displays a game clock like in the game Deadline.  Since the HoursMinutes routine used to print the time could also do military time, a while back, I added a STATUSTYPE value that provides a military time clock (like in Border Zone).   It kind of bugged me that the code didn't have an easy way to switch between the military time with colon and without.  While easy enough to provide a choice for the author, I really wanted it to be as unobtrusive as possible because, really, there's like no chance anyone is going to write a military time game again, and it'd just be embarrassing to show that I spent much time doing some sort of time-configuration system for a feature no one would ever use.  I ended up with just going with a #set NO_MILITARY_COLON flag.

* * *

There are a couple other things, but I'm getting tired of writing.  Anyway, probably will try to put out a Roodylib update within the next couple weeks and then maybe do a round of uploading-stuff-to-the-IF-archive.  Then, maybe, write some IF?  (gasp)

Friday, August 19, 2016

Summertime Frolicking

One of my favorite things about frolicking is how quickly I get sick of it and want to return to my projects.  That said, August is lousy with birthdays among my friends and family (of course, I mean that in the quantitative, Catcher in the Rye sense and not the qualitative one), and I've still got some pool parties, a "pedal tavern," and possibly a trip to the Renaissance Faire in my future.

Still, I can't wait to submerge myself in something Hugo again.  Earlier this week, I made some progress in my most recent problem; I had noticed how horribly broken the baby-naming code was in my silly, nonsensical game, "Baby Uncle New Year," and I wanted to fix it up.

I was hoping my new code would be general enough that I could easily throw it into Roodylib for everybody to use, but it ended up being too specifically purposed.  When I get back to coding, writing that general purpose system will probably be my next task.

Ideally, I'd like it to do these things:
  1.  If the game is being played on an interpreter that supports Hugo's timing system (and accessibility mode is not turned on), it would throw up a floating window like in my game "The Halloween Horror" and use my "fake prompt" code to capture the input and writing it straight to an array.
  2. If the game is being played on a glk interpreter or has accessibility mode turned on, it has a prompt in the main window.  Actual Hugo prompts are tricky because unless the text is within quotation marks, Hugo can only keep track of one unrecognized word.  I'll have to find a tactful way to instruct the player accordingly.
  3. Both of these will result in a, "'<blah>'? Is that correct?" response so the player can double-check how it was received.  Even with whatever nudging I give, the main window Hugo prompts have a fair possibility of being wrong, like if the player used any of the "removal" words ("a", "an", "the", "some", "of") that Hugo automatically drops from input lines.
  4. Include an option to write all unrecognized words to the game dictionary and apply them to an object.
At least one game in progress by another person uses my "fake prompt" code so I figure this system could be useful to others as well.  Besides this, I need to reacquaint myself with my Hugo "to do" list and see if there's anything else I'd like to add before the next Roodylib release.  I also have some real world research I want to do on one of my game ideas.

Here's to ending 2016 with a little more Hugo in the world!

Wednesday, July 27, 2016

some progress summer

Since the last post, I helped that friend with that problem (GAME'S LOOKING GOOD, JIZ) and made some Roodylib progress (fixed some bugs, redesigned some stuff, and incorporated one or two new extensions).  I have an out-of-town friend coming in this week, and I'd been meaning to recompile all of my old games with my default menu code and just try to make them look as consistent as possible.

I've actually been meaning to do this for years, but this friend really doesn't know anything about IF so I kept putting it off because I wanted the consistency between games to be perfect...  and honestly, I usually like to give a middle finger to perfection.  It's too damn  hard to finish projects in the first place.

Still, applying something like Roodylib to old code is always interesting.  It's getting to the point where the library application is a lot more seamless than it used to be, and I even found the culprit in my update to Christopher Tate's "converse" extension that was keeping it from working straight out of the box.  That's been irking me for years, but now that it's fixed, my version is just about ready for public release, I think.

Anyhow, despite all of that Roodylib work, I'm getting to the point where I feel I need to give more attention to my WIPs.  One disappointment was the reminder that all of them are missing some big mid-game chunk of design.  The plan is to sit down with some flowchart software one day and stare at the screen until inspiration strikes.

But hey, it's summer and the days are beautiful, so it's been hard to make IF a priority.  Have to enjoy these few months of sun and warmth that we get, so I'm trying to get out as much as possible.  Frolicking, even.

So much frolicking.

Tuesday, July 5, 2016

Roodylib 4.1.2

I'm several months late in helping someone code a scene in their game, so me being me, that means I went and got Roodylib ready for a new release!  SORRY, JIZ!

The three main elements of this new update are:

  • Incorporated the accessibility code mentioned one or two posts back into Roodylib and made them available by default.  I may add another accessibility feature at some point- some kind of spelling system for uncommon words (as discussed on the forums)
  • Code supporting Nikos Chantziaras' Hugor opcodes system
  • Incorporated "newmenu.h" into Roodylib so one doesn't have to include the extra file.  I added mouseclick support to menus sometime within the last handful of months, too.