I just finished up the changes that encompass a leap from V1 to V2.
After completing V1 there were some clear gaps in the platform, namely how an author can have the same flexibility for text emission that they have with other platforms. One of the core concepts of Sharpee has always been to replace “say” concatenation or streaming text with a system that gathers every change and associated text, then combine it all in a pre-defined manner, then hand it to a UI to place pieces of text in predefined spots on a canvas. In the case of Sharpee this was always going to be a browser.
I did create local install versions of Sharpee in early stages, but that was premature. The platform needs to shake out its early development before we can land on a clear desktop (Tauri) implementation.
So V2 was almost entirely a top down redesign of how text gets from action results to the browser, including how it’s formatted and accounting for pronouns, first/second/third person, articles, lists, and more. There’s another scenery effort to embed their descriptions logically in a room description and that will be implemented in the next week or two.
The design for the new text processing system is called Phrase Algebra and it uses four stages to transform actions into final pieces of text. Sharpee still employs channel IO, so the highest impact is on the room description, but the same system handles any text. The author still has the design flexibility to emit text to alternate (custom) channels besides the room description.
I honestly wasn’t sure how thorough the post-turn text formatting would be, but the benefit of using Claude was a deep conversation about ways to do that. The result was not the first design. There were a series of stabs at ways to emit text logically, but none of them provided the flexibility I desired for the platform. Eventually we found the term algebra and it was mostly downhill from that point forward. I still had to keep the design focused on core elements and that’s why there are a dozen ADRs (architecture decision records) involved. I’d also point out that most of this work is buried in the language provider package lang-en-us and parser-en-us. Sharpee still uses message IDs to emit standard text and now those standard messages implement Phrase Algebra.
This is the talking.ts language file:
/**
* Language content for talking action
*/
export const talkingLanguage = {
actionId: 'if.action.talking',
patterns: [
'talk to [someone]',
'talk [someone]',
'speak to [someone]',
'speak with [someone]',
'greet [someone]',
'say hello to [someone]',
'chat with [someone]'
],
messages: {
// Error messages
'no_target': "Talk to whom?",
'not_visible': "{You} {can't} see {the target}.",
'too_far': "{capitalize the target} {verb:is target} too far away for conversation.",
'not_actor': "{You} can only talk to people.",
'self': "Talking to {yourself} is a sign of madness.",
'not_available': "{capitalize the target} doesn't want to talk right now.",
// Success messages - general
'talked': "{You} {greet} {the target}.",
'no_response': "{capitalize the target} doesn't respond.",
'acknowledges': "{capitalize the target} acknowledges {you}.",
// Success messages - first meeting
'first_meeting': "{You} {introduce} {yourself} to {the target}.",
'greets_back': "{capitalize the target} {verb:says target}, \"Hello there!\"",
'formal_greeting': "{capitalize the target} {verb:says target}, \"Good day to you.\"",
'casual_greeting': "{capitalize the target} {verb:says target}, \"Hey!\"",
// Success messages - subsequent meetings
'greets_again': "{capitalize the target} {verb:says target}, \"Hello again.\"",
'remembers_you': "{capitalize the target} {verb:says target}, \"Ah, it's you again.\"",
'friendly_greeting': "{capitalize the target} smiles in recognition.",
// Success messages - with topics
'has_topics': "{capitalize the target} seems willing to discuss various topics.",
'nothing_to_say': "{capitalize the target} {verb:has target} nothing particular to say."
},
help: {
description: 'Start a conversation with another character.',
examples: 'talk to guard, greet merchant, speak with wizard, chat with innkeeper',
summary: 'TALK TO - Start a conversation with another character. Example: TALK TO MERCHANT'
}
};
Reminder that everything I’ve done is visible in the GitHub repository in docs/context/ where every work summary is written. There are hundreds, though I do archive them on occasion.
The book has also been updated and the website shows version 2.1 as of last night, though the GitHub repository still has separate books and tutorials for 1.5.
I do suffer from tool-building passions over actually writing games. It’s a problem. I have several WIPs and would like to get one out for the IFComp, but I’m starting a new job soon and that may not be a practical goal. Softly looking for a partner, but even that may not be enough. I may still try.
