Weekly bulletin: command refactor & 2021 ...

Weekly bulletin: command refactor & 2021 wrap-up

Nov 29, 2021

Well, this is it: my last update for 2021. I'm taking the month of December off to move and settle into my new home, but I've been working hard to leave initiative.sh in a decently-polished state, with the most-requested features done and the most annoying bugs ironed out.

From the outside, my release cadence is down a lot, with only two releases going out, only one of which (a small bug fix) had any functional impact. However, I've been up to my eyebrows in a long-needed refactor of the command parsing logic, which should make it much simpler to implement new syntax in the future.

Changelog updates last week

  • Bug: Fixed imports silently failing. If you upload a valid JSON file that the application can't parse, you'll get a more helpful error message indicating what went wrong.

  • Enhancement: First steps towards improved command parsing on the backend. Hopefully there will be no functional impact of this one, but it should improve my velocity in the future.

This week

My command parsing work continues. Ultimately, all of this is in aid of delivering a new syntax to round out my recent hierarchy work, allowing you to define relationships between things in-app rather than having to export and manually edit the JSON file. Some tutorial updates will also be needed to show off the new feature.

What's coming next year?

I'm not done yet, not by a long shot. The headline features that exist are close to where I want them to be, but there's a lot of new and exciting work to come. Some highlights:

  • The demographics of the party's current location will affect what is generated.

  • Creating and editing things, moving between locations, and changing the time of day will trigger API events. Integrations I have planned include HomeAssistant (for lighting control), Spotify (to change playlists), and webhooks (to let you build anything you want). As always, I'll involve the Discord community in coming up with more integration opportunities. (Integrations will be a paid feature.)

  • Implement a controllable modules system, allowing you to enable and disable features such as 5e reference and setting-specific generators.

  • Open-source initiative.sh. This will depend on the module system work, as I want to have a middle ground between merging new features into core, and rejecting them entirely.

  • Sync your journal to the cloud. (This will also be a paid feature.)

What happened over the past year?

I'm putting this section last because, well, it's going to take some scrolling. Of course, the most exciting thing that happened this year was getting actual users! Thank you all for your involvement and support - knowing that my work is being used by real people to make their lives a bit easier and their players' lives a bit richer is incredibly rewarding.

I wish you all happy, safe holidays and a happy new year. See you in 2022!

Just for fun, I'll close off with the complete changelog since I started keeping track in July.

  • New: Implemented a basic web frontend.

  • Bug: Specifying a species would not restrict suggestions to that species.

  • New: Previously-generated content is now saved to memory and can be loaded by saying its name.

  • Enhancement: All occurrences of "race" have been changed to "species".

  • Enhancement: Commands now parse more strictly, which ironically enables more flexibility in the future.

  • Enhancement: Basic commands are now included in autocomplete suggestions.

  • Enhancement: Proper nouns are now included in autocomplete suggestions.

  • New: Aliases are now available for newly-generated NPCs, eg. 0 to get alternative 0.

  • Enhancement: Restyled to use the Solarized colour scheme.

  • New: An autocomplete popup is now available in the web UI.

  • Enhancement: Included at-a-glance summary of autocomplete suggestions.

  • New: SRD spells have been added. Try Acid Arrow.

  • Enhancement: Improved experience for users with JavaScript disabled.

  • New: Added "message of the day" and intro text.

  • New: Added commands about, help, and changelog.

  • Enhancement: Keywords are now clickable, like this: npc.

  • Enhancement/bug: Improve mobile experience, including styling and bugfixes.

  • Enhancement: Added content formatting to improve readability, while remaining within the bounds of what is possible with an actual terminal.

  • Bug: Fixed capitalization of possessives: Arcanist's Magic Aura is no longer capitalized as "Arcanist'S".

  • Bug: Fixed rendering inline lists in spell descriptions.

  • Enhancement: New command: spells.

  • Enhancement: Added equipment, all of the essentials like Dagger and Bagpipes, as well as categories like weapons and ships.

  • Bug: Fixed the page not scrolling predictably. Scrolling behaviour should also respect browsers configured to prefer reduced motion.

  • Enhancement: Adopted Source Code Pro for the interface font. Most importantly, the common font ensures that the blocks in the logo are always the same width.

  • Bug: Fixed changelog output being truncated and not always displaying 10 entries as intended.

  • Bug: Fix fallback font for browsers that don't support or haven't yet loaded the default Source Code Pro font.

  • New: You can now save generated content with save [name]. Saved content will be available on future page loads. A lot of work remains to refine the usability of this feature.

  • Enhancement: Autocomplete suggestions now provide more detail about the command being suggested.

  • Enhancement: Temporary commands (those that are only valid in the current context) now have a dashed underline, distinguishing them from permanent commands (that are always valid) like help.

  • Enhancement: When viewing an NPC that has not yet been saved to your journal, a note will appear reminding you to save.

  • Enhancement: Autocomplete now properly suggests save and load commands.

  • Enhancement: Attempting to save a thing that has already been saved will give a distinct error from saving a thing that doesn't exist.

  • Enhancement: Autocomplete suggestions when loading a thing will include a brief summary of that thing, eg. "adult human, they/them".

  • New: New command journal lists everything you've saved to your journal.

  • Enhancement: Rewrite inn name generator to provide a greater variety of results.

  • Enhancement: You can now look up SRD magic items such as the inimitable Deck Of Many Things, as well as categories like magic weapons and wondrous items.

  • Enhancement: Users that can't save to local storage (eg. private browsing, Firefox Focus) will see appropriate error messages instead of a broken site.

  • Enhancement: You can now delete entries from your journal with delete [name]. This completes the basic journal functionality.

  • New: Time! See the current time with now, advance and rewind time with +1d, -1h, etc. Time does not yet persist between sessions.

  • Enhancement: Tab key can be used to select an autocomplete option without submitting. If the selection includes a bracketed phrase like load [name], the autofill will update to suggest ways to complete the phrase.

  • New: There's a Discord server now! See the link in the welcome message to join.

  • Enhancement: Tab key now fills as much text as possible. Try typing "weap" and pressing tab.

  • Enhancement: This is just a dummy update to make sure Discord handles multiple bullet points nicely.

  • New: New additions to the changelog are now automatically announced to the #releases Discord channel!

  • Bug: Fixed formatting in error messages not being displayed.

  • Bug: Fixed things being silently dropped from the recent journal if the save operation failed.

  • "Enhancement": Removed buildings such as residence and temple for the time being. They weren't really generating anything interesting and were blocking features that expect all Things to have a name.

  • Enhancement: Inns now enjoy the same ergonomics as NPCs: you can reference alternative suggestions with numerals, and the "save" shortcut is now available where applicable.

  • Enhancement: Rewrote name generators to work syllable by syllable. You might end up with some awkward names, but you'll have access to a much greater variety of names as a result.

  • New: Rectified a major oversight for a D&D app: added a dice roller! Get your Fireball on with roll 8d6 or use roll (d4+1)^3 for Magic Missile.

  • Enhancement: Added a loading message if the site is taking a while to load or crashes silently in the background.

  • New: Added a privacy policy outlining what personal information we collect. Currently: we don't, which is why we haven't had a privacy policy until now.

  • Enhancement: Added support for more complex time expressions, like +1d5h.

  • Enhancement: Better behaviour if several names come into conflict, like in the case of Shield, or the automated test that failed because it decided to name a character Lance.

  • Enhancement: Changes to the game time are now saved between sessions. There's still some work to do before this feature is worth featuring more prominently, but at least it's in a usable state now.

  • Enhancement: Input field is now focused whenever you click or tap anywhere on the page, improving the "stickiness" of the experience, especially on mobile.

  • Enhancement: On mobile, the keyboard will no longer pop up when clicking a link.

  • Enhancement: The tutorial is now rather less brutal. Instead of killing the poor bartender, our hypothetical murderhobos just let the inn burn to the ground and delete that instead. (Spoilers, BTW.)

  • New: Added a tutorial! This will be updated very occasionally as new features are added, but initiative.sh is now sufficiently complex and feature-complete to be worth the effort.

  • Enhancement: Corrected terminology so that NPCs using "they/them" pronouns will be referred to as "non-binary" rather than "trans".

  • Enhancement: NPCs, locations, etc. can no longer have the same names as one another, and the random generator should never suggest a thing with the same name as one that already exists. Sounds anticlimactic, but this is a substantial change under the hood, and an important stepping stone to creating and editing your own journal entries.

  • New: Substantially improved the process of creating NPCs and locations. Rather than being limited to simple terms like inn or tiefling, you can now generate The Prancing Poodle, an inn, an old elvish woman, or a boy named Sue. (Editing of existing things is coming next.)

  • Enhancement: Things are now automatically saved upon creation if you include a name as one of the parameters. This should streamline the process of importing multiple things in sequence.

  • Enhancement: Fixed the description of the Detect Thoughts spell.

  • New: Added undo to fix those little mistakes. Mostly this frees us to be more liberal with interpreting commands, since it removes the risk of changing something you don't want if your command is misinterpreted.

  • Enhancement: Improved readability by setting a max width to the page and increasing line spacing between user input and command output.

  • Enhancement: The redo command is now available at all times, not just immediately after undo.

  • New: You can now edit things in your journal and recent items! Try [name] is [description] to get started.

  • Bug: Fix broken text selection, which was preventing copy/paste operations. I wasn't trying to do the annoying "right click disabled" thing from the early '00s, but it sure felt like it.

  • Enhancement: Creating and editing things will now proceed even if not all words are recognized, so long as the parser can make a reasonable guess about what you meant. If it guesses wrong, that's what undo is for.

  • Enhancement: Added box displays when generating a character or place, as well as emoji icons to differentiate people by age/gender.

  • Enhancement: When you generate a person or place, alternative suggestions aren't offered automatically, but are instead available via the "more" command. Also updated the tutorial and help to cover the latest feature changes.

  • Bug: Fixed the "more" command not being available when generating a person or place in a browser that lacks IndexedDB, such as an older browser or one with private browsing active.

  • Enhancement: Added tons of new place types, from kingdom to pet-store and everything in between (183 types and aliases in total). However, lacking name generators for all of these new types, their current purpose is just to make it easier to keep a coherent journal.

  • Enhancement: Minor updates to vocabulary (somehow I missed hotel and pub, both of which I ran into during last night's game). I've also added a Buy Me a Coffee link for those who would like to support development, though I currently have no premium features to offer supporters. Just the same site with extra gratitude!

  • Bug: Fix the text colour of the input box when browsing in dark mode. Black on black is hard to read, I guess???

  • Enhancement: By popular request, autocomplete and command parsing are now completely case-insensitive!

  • Enhancement: You can now navigate backwards and forwards through your command history with the up and down arrow keys while the autocomplete popup is closed. The history doesn't (yet!) persist between sessions.

  • Enhancement: Just for good measure, added a wee favicon to the site.

  • Enhancement: All place types now include an emoji icon in summary view, such as in the journal listing.

  • Enhancement: Refactored out the local cache. In practice, the only effect this should have right now is that if you have multiple tabs/windows open at once, the journal should remain in sync between all of them.

  • New: You can now export data from the journal! (There is not yet a corresponding import command, but that's coming next.)

  • Enhancement: Changes to the time are now properly integrated into the undo history and available at all times.

  • Bug: Clicking the right mouse button no longer runs commands or changes the selection. This was particularly annoying when trying to copy from the context menu.

  • Bug: Accessing the command history using the up and down arrows will no longer wrap around when you reach the beginning or end of the history.

  • New: You can now import data that you've previously exported!

  • Enhancement: Added a few more emoji for different place types. The generic pushpin icon is now fairly uncommon.

  • New: If things (people or places) have a location_uuid field defined, the location will now be shown in the details view. Presently the only way to define those relations is to export your journal, edit the JSON file, then import it again.

  • Bug: Fixed imports silently failing. If you upload a valid JSON file that the application can't parse, you'll get a more helpful error message indicating what went wrong.

  • Enhancement: First steps towards improved command parsing on the backend. Hopefully there will be no functional impact of this one, but it should improve my velocity in the future.

Enjoy this post?

Buy Mikkel Paulson a set of dice

More from Mikkel Paulson