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
A python package that adds "docs" command to disnake

About This extension's purpose is of adding a "docs" command, its purpose is to help documenting in chat. How To Load It from disnake.ext import comma

7 Jan 03, 2023
Generate PNG filles from NFO files.

Installation git clone https://github.com/pcroland/nfopng cd nfopng pip install -r requirements.txt Usage ❯ ./nfopng.py usage: nfopng.py [-h] [-v] [-i

4 Jun 26, 2022
tg-nearby Trilateration of nearby Telegram users as described in my corresponding article.

tg-nearby Trilateration of nearby Telegram users as described in my corresponding article. Setup If you want to toy with the code in this repository

Maximilian Jugl 75 Dec 26, 2022
A Powerful Tool For Making Combo List(All possible modes)

ComboMaker A Powerful Tool For Making Combo List Introduction Check out all possible Combo list build modes with this tool =) How to Install Open the

MasterBurnt 7 Jan 07, 2023
This repository containing cross-section cut and fill calculations using Python programming language.

cross-section This repository is containing cut and fill calculations for cross-section using Python programming language. This codes is made to calcu

3 Jun 15, 2022
A basic interpreted programming language written in python

shin A basic interpreted programming language written in python. extension You can use our own extension ".shin". Example: main.shin How to start Clon

12 Nov 04, 2022
Graphsignal Logger

Graphsignal Logger Overview Graphsignal is an observability platform for monitoring and troubleshooting production machine learning applications. It h

Graphsignal 143 Dec 05, 2022
Bionic is Python Framework for crafting beautiful, fast user experiences for web and is free and open source.

Bionic is Python Framework for crafting beautiful, fast user experiences for web and is free and open source. Getting Started This is an example of ho

14 Apr 10, 2022
A collection of daily usage utility scripts in python. Helps in automation of day to day repetitive tasks.

Kush's Utils Tool is my personal collection of scripts which is used to automated daily tasks. It is a evergrowing collection of scripts and will continue to evolve till the day I program. This is al

Kushagra 10 Jan 16, 2022
GDIT: Geometry Dash Info Tool

GDIT: Geometry Dash Info Tool This is the first large script that allows you to quickly get information from the Geometry Dash server

dezz0xY 2 Jan 09, 2022
Final project in KAIST AI class

mmodal_mixer MLP-Mixer based Multi-modal image-text retrieval Image: Original image is cropped with 16 x 16 patch size without overlap. Then, it is re

SuperSuperMoon 5 May 30, 2022
This repo is related to Google Coding Challenge, given to Bright Network Internship Experience 2021.

BrightNetworkUK-GCC-2021 This repo is related to Google Coding Challenge, given to Bright Network Internship Experience 2021. Language used here is py

Dareer Ahmad Mufti 28 May 23, 2022
A subleq VM/interpreter created by me for no reason

What is Dumbleq? Dumbleq is a dumb Subleq VM/interpreter implementation created by me for absolutely no reason at all. What is Subleq? If you haven't

Phu Minh 2 Nov 13, 2022
Always fill your package requirements without the user having to do anything! Simple and easy!

WSL Should now work always-fill-reqs-python3 Always fill your package requirements without the user having to do anything! Simple and easy! Supported

Hashm 7 Jan 19, 2022
An easy-to-learn, dynamic, interpreted, procedural programming language

Gen Programming Language WARNING!! THIS LANGUAGE IS IN DEVELOPMENT. ANYTHING CAN CHANGE AT ANY MOMENT. Gen is a dynamic, interpreted, procedural progr

Gen Programming Language 7 Oct 17, 2022
A simple PID tuner and simulator.

PIDtuner-V0.1 PlantPy PID tuner version 0.1 Features Supports first order and ramp process models. Supports Proportional action on PV or error or a sp

3 Jun 23, 2022
Hospitality app for ERPNext to manage hotels & restaurants.

Hospitality ERPNext Hospitality module is designed to handle workflows for Hotels and Restaurants. Manage Restaurants The Restaurant module in ERPNext

Frappe 19 Dec 26, 2022
K2HASH Python library - NoSQL Key Value Store(KVS) library

k2hash_python Overview k2hash_python is an official python driver for k2hash. Install Firstly you must install the k2hash shared library: curl -o- htt

Yahoo! JAPAN 3 Oct 19, 2022
A Python3 script to decode an encoded VBScript file, often seen with a .vbe file extension

vbe-decoder.py Decode one or multiple encoded VBScript files, often seen with a .vbe file extension. Usage usage: vbe-decoder.py [-h] [-o output] file

John Hammond 147 Nov 15, 2022
A pomodoro app written in Python

Pomodoro It's a pomodoro app written in Python. You can minimize it while you're working if you want to, it'll pop up on your screen when the timer is

Yiğit 1 Dec 20, 2021