A python library for writing parser-based interactive fiction.

Overview

About IntFicPy

A python library for writing parser-based interactive fiction. Currently in early development.

IntFicPy Docs

Parser-based interactive fiction

Parser based interactive fiction, sometimes called text adventure, is a story displayed through text, that the reader/player interacts with by typing out commands. Typing "get lamp", for instance, will cause the character to take the lamp.

Why IntFicPy?

All of the major systems for writing parser based interactive have their own languages, useful for nothing else. With IntFicPy, I wanted to make it possible for creators who already knew Python to use that knowledge for writing interactive fiction, and for creators new to Python to work in a language for which myriad tutorials, and a strong online community already exist.

IntFicPy Engine

IntFicPy is a Python game engine for creating parser-based interactive fiction (text adventures). IntFicPy is designed to be comprehensive and extensible. It has 80 predefined verbs, including all the standards of the genre, many with syonyms (get/take) and alternate phrasings (put hat on/put on hat). Game creators can define their own verbs - which integrate seamlessly with the predefined verb set - in minutes. Built in support for complex conversations with NPCs, dark areas and moveable light sources, locks and keys, save/load, and much more.

Parser

Parsing natural language commands can be challenging. For this project, the problem was simplified substantially by the conventions of interactive fiction (IF). Commands are always in the imperative tense (phrased like direct orders). Knowing this, we can guarantee the basic word order of commands. The IntFicPy parser starts by looking at the first word of the command, which should contain the verb. It then uses clues from the command, like prepositions, and number of grammatical objects to determine which verb function to call.

Verbs

At the time of writing, IntFicPy has 78 verbs built in. Users can also create their own verbs, specific to their games. Each verb in IntFicPy is an instance of the Verb class. When a new instance is created, the verb is automatically added to the game's dictionary of verbs. When synonyms are added using the addSynonm method, they are also added to the dicitonary.

Item Classes

IntFicPy currently has 28 classes for items, all subclasses of Thing. Each class of item behaves differently when used for verbs. For instance, you can put a Thing in a Container, read a Readable, unlock a Lock using a Key, or look through a Transparent. Composite items can be created with the addComposite method, to create, for instance, a box with writing on it, or a dresser with three drawers. Non Player Characters and Conversations The class for non-player-characters in IntFicPy is Actor. The most important distinguishing feature of Actors is that the player can talk with them. Creators can either set up responses to Topics ("ask/tell/give/show X (about) Y", where X is an Actor, and Y is an item in the game or creator defined abstract concept), or use SpecialTopics. Special topics allow for a menu style conversation, where the player can select from topics that are suggested to them.

Installation and Use

First Release & Current Developments

The first full length IntFicPy game, Island in the Storm was entered into IFComp 2019. Many thanks to everyone who played and voted.

IntFicPy's first release, originally planned for fall 2019, is postponed until further notice, while I improve test coverage and refactor.

If you want to play around with the library, please do - and I'd love to hear your feedback - but be aware that IntFicPy is not currently stable.

How to Install IntFicPy

After cloning the repo, install the dependencies, then the IntFicPy package.

$ cd intficpy
$ pipenv shell
$ pipenv install
$ pip install -e .

You should now be able to run the example game.

$ python examples/testgame.py

You can also run the tests.

$ python -m unittest discover

License

IntFicPy is distributed with the MIT license (see LICENSE)

You might also like...
Tool to generate wrappers for Linux libraries allowing for dlopen()ing them without writing any boilerplate

Dynload wrapper This program will generate a wrapper to make it easy to dlopen() shared objects on Linux without writing a ton of boilerplate code. Th

Just some mtk tool for exploitation, reading/writing flash and doing crazy stuff

Just some mtk tool for exploitation, reading/writing flash and doing crazy stuff. For linux, a patched kernel is needed (see Setup folder) (except for read/write flash). For windows, you need to install zadig driver and replace pid 0003 / pid 2000 driver.

WriteAIr is a website which allows users to stream their writing.

WriteAIr is a website which allows users to stream their writing. It uses HSV masking to detect a pen which the user writes with. Plus, users can select a wide range of options through hand gestures! The notes created can then be saved as images and uploaded on the server.

Procedurally generated Oblique Strategies for writing your own Oblique Strategies

Procedurally generated Oblique Strategies for writing your own Oblique Strategies.

Analisador de strings feito em Python // String parser made in Python

Este é um analisador feito em Python, neste programa, estou estudando funções e a sua junção com "if's" e dados colocados pelo usuário. Neste código,

:snake: Complete C99 parser in pure Python

pycparser v2.20 Contents 1 Introduction 1.1 What is pycparser? 1.2 What is it good for? 1.3 Which version of C does pycparser support? 1.4 What gramma

A Gura parser implementation for Python

Gura parser This repository contains the implementation of a Gura format parser in Python. Installation pip install gura-parser Usage import gura gur

Parser for RISC OS Font control characters in Python

RISC OS Font control parsing in Python This repository contains a class (FontControlParser) for parsing font control codes from a byte squence, in Pyt

Neogex is a human readable parser standard, being implemented in Python

Neogex (New Expressions) Parsing Standard Much like Regex, Neogex allows for string parsing and validation based on a set of requirements. Unlike Rege

Comments
  • Clean refactor 2019

    Clean refactor 2019

    Clean up and refactoring.

    • Reorganize modules. Move modules into their own folders. Separate modules that don't belong in the same file. Reorganize to reduce circular imports.
    • Move a bunch of imports from inside functions to the top of the files
    • clean up repetitive init methods in Thing subclasses
    • refactor the objects save mappings into class objects so they can store their own index and prefix
    • run black against the whole codebase
    • update the example
    opened by RALWORKS 0
  • Exception importing helpVerb, helpVerbVerb, aboutVerb

    Exception importing helpVerb, helpVerbVerb, aboutVerb

    things.py:consumeLightSourceDaemonFunc() imports some outdated or non-existent verbs.

    Exception ignored on calling ctypes callback function: <rubicon.objc.api.objc_method object at 0x110c46c10> Traceback (most recent call last): File "/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/rubicon/objc/api.py", line 275, in call result = self.py_method(py_self, *args) File "/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/toga_cocoa/widgets/textinput.py", line 43, in textDidEndEditing_ self.interface.on_lose_focus(self.interface) File "/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/toga/handlers.py", line 66, in _handler result = handler(interface, *args, **kwargs) File "/Users/jbassett/Projects/beeware/calebais/src/calebais/app.py", line 136, in textbox_lose_focus self.handle_input(widget, **kwargs) File "/Users/jbassett/Projects/beeware/calebais/src/calebais/app.py", line 117, in handle_input self.game.turnMain(input_text) File "/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/intficpy/ifp_game.py", line 176, in turnMain self.daemons.runAll(self) File "/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/intficpy/daemons.py", line 11, in runAll daemon.func(game) File "/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/intficpy/things.py", line 456, in consumeLightSourceDaemonFunc from .verb import helpVerb, helpVerbVerb, aboutVerb ImportError: cannot import name 'helpVerb' from 'intficpy.verb' (/Users/jbassett/Projects/beeware/bee-env/lib/python3.9/site-packages/intficpy/verb.py)

    I was able to fix this problem by just removing those verbs from the function altogether.

    opened by RathmoreChaos 0
Releases(v1.3)
  • v1.3(Apr 6, 2021)

    • add Events API to provide a better abstraction for the old newBox/printToGUI system of adding text to the game
    • move core functionality out of the Qt GUI app and into intficpy
    • create a terminal interface for IFP games to include with intficpy by default
    • move the Qt GUI into its own repo
    Source code(tar.gz)
    Source code(zip)
  • v1.2(Apr 6, 2021)

  • v1.1(Apr 6, 2021)

  • v1.0(Mar 26, 2020)

Owner
Rita Lester
Python developer based in Edmonton, AB.
Rita Lester
Dapp / Forge traces enhancer

traces-explorer Dapp / Forge traces enhancer Usage traces.py and pattern_* files should be in the same directory make test traces.txt py traces.

1 Feb 02, 2022
An-7 tool for python

***An-7 tool - Anonime-X Team*** An-x Menu : SPAM Android web malware interpreter Spam Tools : scampages letters mailers smtpcrack wpbrute shell Andro

Hamza Anonime 8 Nov 18, 2021
GUI for the Gammu library.

Wammu GUI for the Gammu library. Homepage https://wammu.eu/ License GNU GPL version 3 or later. First start On first start you will be asked for set

Gammu 60 Dec 14, 2022
Project Interface For nextcord-ext

Project Interface For nextcord-ext

nextcord-ext 1 Nov 13, 2021
A very basic ciphering/deciphering tool

ckrett-python-library This is an useful python library for people who care about privacy, this library is useful to cipher and decipher text using 4 s

SasiVatsal 8 Oct 18, 2022
Cairo-integer-types - A library for bitwise integer types (e.g. int64 or uint32) in Cairo, with a test suite

The Cairo bitwise integer library (cairo-bitwise-int v0.1.1) The Cairo smart tes

27 Sep 23, 2022
Learn the basics of Python. These tutorials are for Python beginners. so even if you have no prior knowledge of Python, you won’t face any difficulty understanding these tutorials.

01_Python_Introduction Introduction 👋 Python is a modern, robust, high level programming language. It is very easy to pick up even if you are complet

Milaan Parmar / Милан пармар / _米兰 帕尔马 245 Dec 30, 2022
Calibre Libgen Non-fiction / Sci-tech store plugin

CalibreLibgenSci A Libgen Non-Fiction/Sci-tech store plugin for Calibre Installation Download the latest zip file release from here Open Calibre Navig

IDDQD 9 Dec 27, 2022
Powering up Apache JMeter with Streamlit and opening the door for machine learning.

Powering up Apache JMeter with Streamlit Overview Apache JMeter is an open source load testing tool written in 100% pure Java. JMeter supports umpteen

NaveenKumar Namachivayam ⚡ 16 Aug 24, 2022
validation for pre-commit.ci configuration

pre-commit-ci-config validation for pre-commit.ci configuration installation pip install pre-commit-ci-config api pre_commit_ci_config.SCHEMA a cfgv s

pre-commit.ci 17 Jul 11, 2022
A replacement of qsreplace, accepts URLs as standard input, replaces all query string values with user-supplied values and stdout.

Bhedak A replacement of qsreplace, accepts URLs as standard input, replaces all query string values with user-supplied values and stdout. Works on eve

Eshan Singh 84 Dec 31, 2022
Hashcrack - A non-object oriented open source, Software for Windows/Linux made in Python 3

Multi Force This project is a non-object oriented open source, Software for Wind

Radiationbolt 3 Jan 02, 2023
Small tool to use hero .json files created with Optolith for The Dark Eye/ Das Schwarze Auge 5 to perform talent probes.

DSA5-ProbeMaker A little tool for The Dark Eye 5th Edition (Das Schwarze Auge 5) to load .json from Optolith character generation and easily perform t

2 Jan 06, 2022
Trackthis - This library can be used to track USPS and UPS shipments.

Trackthis - This library can be used to track USPS and UPS shipments. It has the option of returning the raw API response, or optionally, it can be used to standardize the USPS and UPS responses so t

Aaron Guzman 0 Mar 29, 2022
Sample python script for monitoring Rocketchat database and get statistics of users.

rocketchat-DB-monitoring Sample python script for monitoring Rocketchat database and get statistics of users. 1. Update python: yum check-update && yu

Mojtaba Taleghani 1 Apr 12, 2022
Anki Addon idea by gbrl.sc to see previous ratings of a card in the reviewer

Card History At A Glance Stop having to press card browser and ctrl+i for every card and then WINCING to see it's history of reviews FEATURES Visualiz

Jerry Zhou 11 Dec 19, 2022
A wrapper around the python Tkinter library for customizable and modern ui-elements in Tkinter

CustomTkinter With CustomTkinter you can create modern looking user interfaces in python with tkinter. CustomTkinter is a tkinter extension which prov

4.9k Jan 02, 2023
WinBoost: Boost your windows system.

Winboost runs a complete checkup of your entire system locating junk files, speed-reducing issues and causes of any system or application glitches or crashes. Through a lot of research and testing, w

Smit Parmar 4 Oct 01, 2021
Personal Assistant Tessa

Personal Assistant Tessa Introducing our all new personal assistant Tessa..... An intelligent virtual assistant (IVA) or intelligent personal assistan

Anusha Joseph 4 Mar 08, 2022
Writeup and scripts for the 2021 malwarebytes crackme

Malwarebytes Crackme 2021 Tools and environment setup We will be doing this analysis in a Windows 10 VM with the flare-vm tools installed. Most of the

Jerome Leow 9 Dec 02, 2022