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
This is a simple SV calling package for diploid assemblies.

dipdiff This is a simple SV calling package for diploid assemblies. It uses a modified version of svim-asm. The package includes its own version minim

Mikhail Kolmogorov 11 Jan 05, 2023
Model Quantization Benchmark

MQBench Update V0.0.2 Fix academic prepare setting. More deployable prepare process. Fix setup.py. Fix deploy on SNPE. Fix convert_deploy bug. Add Qua

500 Jan 06, 2023
Бэкапалка таблиц mysql 8 через брокер сообщений nats

nats-mysql-tables-backup Бэкап таблиц mysql 8 через брокер сообщений nats (проверено и работает в ubuntu 20.04, при наличии python 3.8) ПРИМЕРЫ: Ниже

Constantine 1 Dec 13, 2021
OCR-ID-Card VietNamese (new id-card)

OCR-ID-Card VietNamese (new id-card) run project: download 2 file weights and pu

12 Jun 15, 2022
Web-based Sudoku solver built using Python. A demonstration of how backtracking works.

Sudoku Solver A web-based Sudoku solver built using Python and Python only The motivation is to demonstrate how Backtracking algorithm works. Some of

Jerry Ng 2 Dec 31, 2022
Here is my Senior Design Project that I implemented to graduate from Computer Engineering.

Here is my Senior Design Project that I implemented to graduate from Computer Engineering. It is a chatbot made in RASA and helps the user to plan their vacation in the Turkish language. In order to

Ezgi Subaşı 25 May 31, 2022
OntoSeer is a tool to help users build better quality ontologies

Ontoseer This document provides documentation for the first version of OntoSeer.OntoSeer is a tool that monitors the ontology development process andp

Knowledgeable Computing and Reasoning Lab 9 Aug 15, 2022
A good Tool to comment on xmw

A good Tool to comment on xmw

1 Feb 10, 2022
Open-source library for analyzing the results produced by ABINIT

Package Continuous Integration Documentation About AbiPy is a python library to analyze the results produced by Abinit, an open-source program for the

ABINIT 91 Dec 09, 2022
Lagrange Interpolation Method-Python

Lagrange Interpolation Method-Python The Lagrange interpolation formula is a way to find a polynomial, called Lagrange polynomial, that takes on certa

Motahare Soltani 2 Jul 05, 2022
poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions

poetry2nix poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions. It does so by parsing pyproject.t

Nix community projects 405 Dec 29, 2022
36 key ergo split keyboard, designed around the Seeeduino Xiao platform

Slice36 Minimalist Split Keyboard 36 key ergo split keyboard, designed around the Seeeduino Xiao platform. Inspired by the Corne, Ferris, Ben Vallack'

54 Dec 21, 2022
serological measurements from multiplexed ELISA assays

pysero pysero enables serological measurements with multiplexed and standard ELISA assays. The project automates estimation of antibody titers from da

Chan Zuckerberg Biohub 5 Aug 06, 2022
A python script made for personal use to monitor for sports card restocks on target.com since they are sold out often

TargetProductMonitor A python script made for personal use to monitor for sports card resocks on target.com since they are sold out often. When a rest

Bryan Lorden 2 Jul 31, 2022
A reproduction repo for a Scheduling bug in AirFlow 2.2.3

A reproduction repo for a Scheduling bug in AirFlow 2.2.3

Ilya Strelnikov 1 Feb 09, 2022
An extended, game oriented, turtle

Burtle A Better TURTLE. Makes making games easier. write less do more!! Documentation & guide: https://alannxq.github.io/burtle/ Installation pip inst

5 May 19, 2022
Custom component to calculate estimated power consumption of lights and other appliances

Custom component to calculate estimated power consumption of lights and other appliances. Provides easy configuration to get virtual power consumption sensors in Home Assistant for all your devices w

Bram Gerritsen 552 Dec 28, 2022
PORTSCANNING-IN-PYTHON - A python threaded portscanner to scan websites and ipaddresses

PORTSCANNING-IN-PYTHON This is a python threaded portscanner to scan websites an

1 Feb 16, 2022
A light library to build tiny websites

A light library to build tiny websites

BT.Q 1 Dec 23, 2021
Show Public IP Information In Linux Taskbar

IP Information In Linux Taskbar 📍 How Use IP Script? 🤔 Download ip.py script and save somewhere in your system. Add command applet in your taskbar a

HOP 2 Jan 25, 2022