Announcing the orLibrary 2.0b for I6

Hello again. I wanted to share something I’ve been working on: a collection of extensions for the Inform 6 Standard Library.

A handful of you long-timers might remember the “ORLibrary” from when I6 was relatively new. A couple of years ago I ran across this post: Onyx Ring library v1.3C (2004.06.08)? and it inspired me to bring my library in line with the latest version of I6. I removed extensions with functionality now included in the Standard Library, tweaked it to take advantage of I6 features which didn’t exist when it was first created, and added a few extensions I always thought should be there. It’s been refactored a lot so code written against previous versions will need updating. To my eyes, seen through “I’ve-just-achieved-a-milestone” spectacles, the update looks shiny and new, but until now it’s had limited eyes on it so may be rougher than I expect. As such, I’m hedging my bets and considering this a “public beta”, but I have successfully produced an IFComp game using it, revised some previous works with it, and generated more than a hundred unit tests to help protect against regression, so this version has at least some measure of maturity.

Here’s a quick sampling of what the orLibrary is (and is not):

First, the orLibrary is not a replacement for the Standard Library, like Puny Inform or Platypus. This is a common misconception, owing in part to its “library” name. It can also feel like an alternative foundational library, depending on how much of it you choose to leverage.

It is a collection of opt-in extensions, designed to work together, which enhance the Standard Library. Once you’ve downloaded it, you can snap the framework into an existing WIP in 60 seconds or less, then begin picking and choosing the extensions you want to include in your project. The Z-machine and GLULX targets are both supported.

There are dozens of extensions. Some are deep and rich; others basic and convenient. Here’s a small sampling of things they bring to the table:

  • Objects can be both containers and supporters and more. New forms of “containment” are easy to create, resulting in game text like:

There is a cubby here (on which is a book, in which is a lunch box, under which is a pair of shoes).

  • You can define new state qualifiers:

On the table is a box (which is closed and glowing an eerie green).

  • You can consolidate the output from multi-object verbs:

> take all rocks

5 rocks: Taken.

  • You can declare inline styles and with text substitution and automatic noun-verb conjugation, honoring the narrative tense and person your game is written in:

orPrint("~$b;Don’t$n let the $i;man$n get you down!~ $the:actor(cry).");

Don’t let the man get you down!” the ogre cries.

  • You can use malleable string objects, enabling things like:
str = orStr.new("Dance a little jig.");

str.replace("Dance", "do").replace("a little j", "p").prepend("That’ll ")).print(); 

That’ll do pig.

It includes menus, queued player actions, autonomous NPCs, a framework to add implicit commands, a “Swiss Army Knife” of utilities, and quite a bit more.

The orLibrary User’s Guide attempts to adequately cover extensions which are likely to be useful to game authors while skimming over the more esoteric extensions likely to be used only by extension authors or “library hackers”. While dwarfed by the DM4, orLUG is still not tiny and has benefited from a few proof-readers. The easiest way to view it is via this free online viewer (it may take a few seconds to load) or to directly download it from GitHub. You can also just navigate to the project repository and get it from the “_extras” folder.

I also want to extend a tremendous thank you to @otistdog who spent a serious amount of time proofreading the orLUG and offering suggestions which would make the library itself more useful.

Anyway, please excuse the long post; I hope those still writing in traditional Inform will find this project useful.

Thanks.

Jim

18 Likes

Hey, nice! I didn’t expect ORLib to pop up again.

3 Likes

Originally, this was just supposed to be an update to the original library, but it did sort of take on a life of its own.

Thanks for remembering the old ORLib, Zarf.

Jim

This seems very cool and useful! Do you happen to know of some new game coming up that will use some of the features mentioned here?

3 Likes

Thanks for asking Fredrik! My 2025 IFComp entry “Monkeys and Car Keys” was the first game built from the ground up on the 2.0 codebase. I discussed the orLibrary, and identified some of the extensions I used for the game, in the postmortem.

I didn’t want the game to come across as just a library demo, so it uses… maybe 30% of the extensions. I’ll probably end up including the source code for MaCK in the library’s _extras folder for those individuals who like to peek through working code for examples, but I’ll need to clean it up and expand the comments first.

The five-minute play piece “Medusa” has been around since the original ORLibrary 1.x days. It definitely is a showcase of some of the orLibrary’s extensions, not much more than that. I’ve updated it to use this version, added comments, and have put a little time into expanding it just touch. The updated source code will also end up in the _extras folder relatively soon.

As for an additional “new game coming up”… only my current personal WIP (“Unwelcomed”), which isn’t even remotely near completion, at the moment.

[Edit for clarity: I’ve updated “Medusa” from a source code perspective, but the link above doesn’t reflect that. Currently, that’s still the one based on ver 1.3c. I’ll update it when I get a chance.]

1 Like

Thanks, Jim !

On your “what is and not is”, I prefer continue to parse orLibrary as ORlibrary (OR library), because of its opt-in extensions nature :smiley:

Best regards from Italy,
dott. Piergiorgio.

:grinning_face_with_smiling_eyes: Of course, and that makes sense.

It’s funny, because I put an annotation in the orLUG discussing the change from “ORLib” to “orLib” on page 1.

FYI, onyxring is significantly underselling the revised library. It’s a huge grab bag of functionality that requires a fair amount of expertise to implement, all made much easier to use and work with.

Some examples are:

  • orRecogName, which automatically parses the words in an object’s printed name without having to remember to create a .name property when defining it. (You probably still should, but in its absence the object will be functional.)

  • orParentChildRelationship, which implements something quite close to I7 relations and provides automagic player commands that make use of the new concept. It’s pretty straightforward to implement something like >PUT ROCK BEHIND TREE.

3 Likes

I’ve updated this. It’s still 2.0b (beta), but the version stamp now reads as 2026.02.08.

This update contains a number of reported bug fixes (which I won’t detail here), plus a handful of improvements:

orBetterChoice - defined constants to make ChooseObjects parameters and return values easier to read and maintain.

orParentChildRelationship - introduced automatic preposition resolution, so the author doesn’t have to define new grammar for new parent/child relationships. That is, “Look behind the dresser” works without having to define a new verb.

orDynamicMap - added some additional options for managing complex situations, where a dynamic room may try to map to a room which already has the return path defined.

orNamable - added the ability to customize the qualifier for objects which the player has renamed. So your inventory could show as:

sword (which you have named "bob")

orUtilUiGlulx - Since I’ve been digging deeper into Glulx, I’ve introduced an early, experimental extension named orUtilUiGlulx. It’s still super nascent and will definitely develop further, but helps make Glulx in I6 a little easier:

winStatus.resize(3); 
leftThumb = winStatus.splitLeft(uiGraphics, 0); 
h = leftThumb.getSize().height;
leftThumb.resize(h);  !--make the image as wide as it is tall
rightThumb=winStatus.splitRight(uiGraphics, h); 

leftThumb.drawImage(_blorbMap.coverArt, 0,0, h,h); 
rightPerson.drawImage(_blorbMap.coverArt, 0,0, h,h); 
winMain.drawImage(_blorbMap.coverArt, uiCentered,100,100); 

Finally, I’ve update the 2002 example game “Medusa” to use this updated version of the orLibrary. The source for it is in the “_extras/examples” folder, as are the .z5 and .ulx files which compile from the source.

I also noticed that the original version for 2002 doesn’t really work as expected in Parchment, so I’ve uploading the newest version (both Z-code and Glulx) to the IF-archive. The files should be there as soon as they are processed.

Thanks!

-Jim

2 Likes