Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rule-Based Programming in Interactive Fiction (2009) (eblong.com)
12 points by eudox on June 5, 2015 | hide | past | favorite | 1 comment


A while back I made a rule-based text adventure game engine in Python, inspired by Nelson's Inform 7 and also this presentation. My rule system didn't solve for specificity; it simply took the first rule which applied, so hopefully you define the rules in the correct order.

Here's the obligatory Cloak of Darkness: https://github.com/kmill/textadv/blob/master/games/cloak.py

Decorators can go a long way for pretending Python has a metaprogramming facility!

(I made the engine so that I could experiment with a continuation-like object which saves the entire world state. Example at http://tep.mit.edu:8888/game/continuations )




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: