text-engine has been updated to version 3.0.
There are several new features, but the one I'm most excited about is the new command-replay save system. Game saves are now just a list of commands entered by the player, and loading a save instantly plays back every command. This makes developing games with text-engine way more fun! Iterating goes like this:
- Play your game until you encounter something you want to change, then save.
- Make the change.
- Load the save to see your change instantly.
Additionally, players can now save their game state to disk in a simple, readable (and editable!) text file to load back up at any time. This is also great for developers, because if someone encounters a bug in your game, they can send you their save file so you can reproduce it effortlessly.
In order to support this, text-engine now expects your disk to be a function returning an object rather than just an object. However, the old disk format is still supported, and happily, migration is a breeze.
Since the save system has changed, you should check the updated notes on the system and verify your game is compatible before upgrading to text-engine 3.
Here's a list of the major changes:
- Switched to command-replay save system.
- Added support for saving to/loading from files.
- Added
getItem
function which searches player inventory and the current room. - Improved performance.
- Adding handling for more variations of commands. Players can now type "characters" (vs. "char") to list characters in the room, "inventory" (vs. "inv") to list items in inventory, and e.g. "go n" (vs. "go north" or "n") to move in a cardinal direction.
- Modern CSS now responds to browser zoom level.