Releases: johanberntsson/PunyInform
v1.5
New feature, optimization and bugfix release
Changes in functionality:
- Before including globals.h, the game can now define the constant INITIAL_LOCATION_VALUE and set it to the object where the player should start. This makes sure location is set right when the game starts, so interpreters that display a statusline immediately (like the Gameboy interpreter) don't run into problems. If the game defines this constant, there is no need to set the location in the Initialise routine.
- Printing the game banner has been moved to a routine named Banner(), just like in I6 lib.
- A game can now make the library skip the game banner when the game starts, by returning 2 from Initialise(), just like in I6 lib.
- with_key can now be a routine. The object which is currently being tested as key is held in second. with_key returns an object id, or false if nothing fits.
Optimizations:
- Skipped compilation of code to automatically put things in sack object if SACK_OBJECT has not been defined.
- Optimized check for correct key in Lock and Unlock.
- Slight optimization in Look.
Bugfixes:
- An extra newline was printed in Look if the player was in/on an object which didn't provide an inside_description.
- A newline was missing in Look when a room description was not printed (when brief or superbrief lookmode was enabled).
- The statusline showed the real location in z3, when the player was in darkness.
- Run AfterRoutines() after taking inventory and it's not empty, just like I6 lib.
- Changed so location.after() is printed if debug verb "routines" has been entered, regardless of whether location provides such a routine.
- Fixed bug: Insert and PutOn checked the capacity of the object inserted rather than the container/supporter.
- Made many library messages safer, in that they will work even if adding new grammar which use a different verb word. This also made the code smaller.
v1.4
New features, optimization and bug fix release
Changes in functionality:
- Changed synonym 'yourself' for player to 'self', to harmonize with I6 lib, and because it makes sense.
- Improved parsing of delimiters between direction commands.
- Faster direction matches which appeared in v1.3 breaks old Infocom interpreters, due to lack of support for printing to memory. Changed implementation to not break. It is also smaller, but it gets less easy to change direction words.
- Changed grammar of 'get' to match I6 lib. "get on object" and "get out of object" now work.
- Added global receive_action to let receiving object know which action is happening.
- Made _PrintContents() public, thus changing the name to PrintContents(). Changed the use of workflag to only print objects which have workflag set, just like WriteListFrom in I6 lib. Changed so initial string can be set to 0.
- Changed so the invent property is consulted whenever a list of objects is presented by PrintContents, most notably also affecting object listings in room descriptions.
- Added calls to object parent's before and after rules (if container or supporter) with LetGo action when taking object.
- Changed so debug verb 'routines' prints calls to before routines and after routines even if object doesn't provide them.
- Added printing to calls to before and after rules for fake actions Receiver and LetGo for when debug verb 'routines' has been entered.
- A game programmer can check the version of PunyInform being used by looking at the values of constants PUNYINFORM_MAJOR_VERSION and PUNYINFORM_MINOR_VERSION.
Optimizations:
- Optimized to skip parser phase 2 when possible for speed gains
- Updated Library of Horror to use the new constant DIRECTION_COUNT.
- Stop checking ObjectIsInvisible() for every object during parsing, since it's slow and shouldn't be necessary.
- Smaller, faster code in PrintVerb.
- _FindBarrier() was made shorter, and faster when set not to print.
- Remove 'embrace' from PrintVerb when optional verbset is not enabled.
- Changed a lot of checks in action routines from if(AfterRoutines() == 1) to just if(AfterRoutines()) and from if(keep_silent == 1) to if(keep_silent) to save 30 bytes.
Bugfixes:
- "take obj" bug when already held has been fixed.
- the pattern score was wrong when 'all' was used to match a multi token.
- Fixed that PutOnSub didn't call before- or after-rules for Receiver, and that InsertSub didn't call before-rule for receiver.
- Fixed bug in Search message.
- Added checks to see if objects can be touched to many action routines.
- Added call to AfterRoutines in WearSub.
- Fixed TryToTakeNoun() so it clears concealed attribute when an object is picked up.
v1.3
New feature (and bug fix) release
Changes in functionality:
- Extended 'all' so that 'take all Xs except/but Y [one]' works.
- Split up extra verbs in normal verbs and metaverbs. New constant: OPTIONAL_EXTENDED_METAVERBS
- Made parser a little quicker by not checking if an object is visible once per word in player input.
- Unified some messages, to save space.
- Changed the role of initial for rooms to match I6 lib. location.initial is now printed whenever the player enters the room, just before the room name.
- Added GetOff action ("get off X").
- Added global num_words as described in DM4
- Changed default name of Directions object from "unknown direction" to "direction", since it looks more sensible in most situations.
- New constant DIRECTION_COUNT holding # of directions (8 or 12).
- Avoid checking if Directions is visible, since it always should be. Good for parser speed.
- Check direction matches faster in z3.
- Changed so the location's add_to_scope property isn't checked, since this causes aliasing problems, and isn't supported by I6 lib either.
- Freed up a common property for use by game authors. Game authors can now create 3 common properties (2 if OPTIONAL_FULL_DIRECTIONS is defined) in z3 games.
- The player object was renamed to selfobj to mimic I6 lib, and it got an empty parse_name property, and it got extra synonyms - now it has 'me', 'myself' and 'yourself'.
- Moved some action subs in grammar.h to put them in alphabetic order.
Bugfixes:
- Fixed a bug that made PronounNotice calls in before rules go unnoticed.
- Fixed so "it" can not refer to Directions.
- Fixed error in order of directions. (ne, nw, se, sw came in the wrong order, causing errors when some of these directions were translated to/from fake direction objects.)
- Fixed bug in cloak.inf which gave a point even if "hang cloak on hook" failed.
- Fixed so PutOn requires the noun to be held.
- Added call to AfterRoutines in PutOnSub.
- Removed extra error message if the player fails to auto-take noun in InsertSub.
- Fixed a bug where an already scored room would be scored again if moved into using PlayerTo().
- Marked all objects held by the player as moved and not concealed when game starts.
- Fixed a noun caching bug that made 'throw X at Y' go wrong
- Fixed bug with words in "name" property of location.
v1.2.1
v1.2
v1.2: This release fixes a few serious bugs and has some (hopefully welcome) improvements
Changes in functionality:
- Library message for inventory slightly changed.
- ObjectIsUntouchable() now has a flag to check if an object is takable too, like in the standard library.
- Added TouchCeiling() to help TAKE ALL.
- Made game name bold in z5 games.
- Added a second parameter to LibraryMessages routine, to allow for messages requiring two parameters.
- Changed so TAKE ALL tries to pick up all things in TouchCeiling plus things in/on normal containers/supporters in the touchceiling.
- TAKE ALL doesn't try to take other people's belongings or things that are part of other things anymore.
- Improved 'all' so that 'take all from/off X' works.
- Added 'get all from/off X' to grammar.
- "(putting x into [sack_object])" now has a newline at the end, and is printed by PrintMsg, so it can be modified by game.
Bug fixes:
- Messages for pushing, pulling and turning scenery objects were missing.
- You could use action Drop/Insert/PutOn with something worn without taking it off first.
- Take improved so it's not possible to take things which are part of other things or held by an NPC.
- Fixed bugs in handling of low priority scenery/concealed objects in disambiguation
- "(worn)" was never shown in inventory.
- Made LoopOverScope safer by having it loop over a copy of the scope array.
v1.1
This release holds a few changes in functionality and a number of bug fixes, some of which are critical to be able to build full size games using PunyInform.
Changes in functionality:
- Reimplemented darkness handling as described in DM4. To test if the player is in darkness, check if location == thedark.
- Changed names to 'buffer' and 'parse' for the player input and parsing arrays, since DM4 is describing them and renaming them breaks some existing Inform code and extensions needlessly.
- Examine now works as in the standard library: containers without a description get a Search action, switchable objects show a message to say if they're on or off, after and react_after are run afterwards. Examining in darkness shows a message that it's dark.
- The contents of a closed transparent container are now printed in Look.
- Objects providing light now get "(providing light)" appended in Look.
- The message "[Actor] has better things to do." is now a regular library message, so it can be customized.
- Reordered the version info to mimic the standard library.
Bugfixes:
- Parsing failed for big story files because of bad pointer comparisons
- A programming error lead to bad parsing results on older interpreters
- Fixed various bugs in conversation code (ask X about Y etc)
- Disambiguation bug fixed (only appeared in complex situations)
- "drop all but x" should now give a reasonable error message. ("but" is not supported.)
v1.0
Initial release. Release note:
We just released PunyInform 1.0, a library for writing interactive fiction or text adventures in Inform 6, with focus on making the games fast enough and small enough to be enjoyed on 8-bit platforms like the Commodore 64. Games are compiled to Z-code, the format used by Infocom, and more specifically they can be compiled to z3, z5, z7 or z8 format. This allows the games to be played on anything from an early eighties home computer to the modern computer of your choice running Windows, Mac OS, Linux or pretty much any other operating system.
The main github page: https://github.com/johanberntsson/PunyInform
The manual (also included as PDF with the library): https://github.com/johanberntsson/PunyInform/wiki/Manual
The download page: https://github.com/johanberntsson/punyinform/releases
PunyInform behaves very much like the standard Inform 6 library. Some features have been dropped and others have been altered to gain speed and decrease code size. Also, some features are optional, so you can choose to enable or disable them depending on the game. The Designer's Manual, 4th Edition (DM4) is still recommended reading, and the PunyInform manual lists everything that is different from the standard library.
While the smallest possible Z-code version 5 game using the standard library takes up 57.8 KB, the same game compiled with PunyInform takes up only 23 KB. With abbreviations enabled, the PunyInform version shrinks to 22.2 KB. PunyInform comes with a standard set of abbreviations which is good for shrinking the strings used by the library, but of course you can also supply your own abbreviations.
Additionally, you can compile games to Z-code version 3. This allows the minimal game size to go down to 21.2 KB, with abbreviations. With the standard library, it's not possible to compile a Z-code version 3 game.
The most notable feature which isn't present in PunyInform is the handling of identical objects - all objects need to be distinguishable from each other. Having a red book and a green book isn't a problem, but having two green books is. Also, when compiling to Z-code version 3, you can't use dynamic object creation or destruction.
PunyInform comes with a few handy extensions. Converting extensions written for the standard library should be quite straight-forward as well, in most cases. Many extensions will work out-of-the-box.
PunyInform comes with a fully working demo game called Library of Horror, as well as a minimal game template which can be used as a starting point for building your own game. There is also an implementation of Cloak of Darkness, which is compiled with the standard library if you compile it to a z8 file, but with PunyInform if you compile it to z3 or z5.
PunyInform requires the recently released Inform v6.34 compiler, which can be found at http://www.ifarchive.org/indexes/if-archiveXinfocomXcompilersXinform6.html .
To compile a game, unpack the files, place the Inform 6 compiler binary in the base directory, and type i.e. "inform6 +lib -v3 -s -e library_of_horror.inf" (type "inform6 -h2" for an explanation of all commandline switches).