[HN Gopher] Rule-Based Programming in Interactive Fiction
       ___________________________________________________________________
        
       Rule-Based Programming in Interactive Fiction
        
       Author : ibobev
       Score  : 51 points
       Date   : 2025-01-18 14:22 UTC (8 hours ago)
        
 (HTM) web link (eblong.com)
 (TXT) w3m dump (eblong.com)
        
       | hlship wrote:
       | So close to describing the Dialog IF language it's almost
       | prescient.
       | 
       | https://linusakesson.net/dialog/index.php
       | 
       | Dialog is a Prolog dialect: it's like Markdown and Prolog had a
       | baby.
        
         | tunesmith wrote:
         | First I've heard of this one. I never got into Inform7 because
         | I didn't find the language very discoverable; it felt like
         | writing AppleScript. Do you know of any links to larger
         | examples of Dialog code, like a full open source game written
         | in the language?
        
           | hlship wrote:
           | https://github.com/hlship/sanddancer-dialog
        
         | Avshalom wrote:
         | I feel like I knew about this at some point but thank you for
         | reminding me especially now that I've got more prolog under my
         | belt.
        
       | spencerflem wrote:
       | Just started getting into logic languages / Answer Set
       | Programming!
       | 
       | Don't know much yet but some interesting things I've found:
       | 
       | Dusa, which promises an easier way to merge constraint languages
       | and answer sets https://dusa.rocks/
       | 
       | Puzzlescript, which isn't exactly the same paradigm (its
       | declarative but not a logic lang) that is beloved by the sokobon
       | puzzle community. Sokobon itself is three lines of code in this
       | and many other games only need to add one or two more. Its
       | genius. https://www.puzzlescript.net/
       | 
       | My goal rn as an art project is to try to combine the two, so
       | every puzzlescript game can be queried for interesting properties
       | in Dusa / Potasscio / Some Logic Language.
        
       | Jtsummers wrote:
       | https://www.clipsrules.net - CLIPS handles some of the things
       | discussed in this presentation pretty well.
       | 
       | When the author gets to the portion on priorities, in CLIPS this
       | is (primarily) handled with salience and modules.
       | 
       | Salience is a numeric value assigned to each rule, assuming only
       | one agenda the rules with the highest salience will be processed
       | first.
       | 
       | Modules group rules and there's a "focus" stack of modules. The
       | module at the top of the focus stack has its agenda processed
       | first before any other modules. Focus can be controlled by the
       | programmer.
       | 
       | It then has other mechanisms (selectable by the programmer,
       | default is "depth strategy") for when an agenda has multiple
       | rules of the same salience. Depth strategy is LIFO (last in first
       | out), treating the salience level as a stack. So if a rule with
       | salience 10 is activated and later a second rule is activated
       | with salience 10, the second one will run first.
       | 
       | https://www.clipsrules.net/documentation/v641/bpg641.pdf - Page
       | 26 for conflict resolution strategies.
        
       | cubefox wrote:
       | 2009
        
       | duskwuff wrote:
       | Don't miss the tiny adventure game in the footers of each slide.
        
       | sethrin wrote:
       | I feel like the missing option is event handlers.
        
       ___________________________________________________________________
       (page generated 2025-01-18 23:00 UTC)