tapestry

package module
v0.24.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Premise

Modern game engines -- while providing amazing support for graphics and game play -- don't have great tools for building stories. Game scripting is integrated deeply into the engine, and story development, while quick at the start, becomes time consuming and error prone the more assets are added to the game.

Developers should be able to work on the logic of their games separate from the visual elements whenever possible. This enables quick iteration for commonplace tasks such as creating dialog, puzzles, and quests.

Tapestry provides a way to build and test stories independent from the game engine; independent of graphics.

Relation to interactive fiction

The ability to play and test a game without graphics is, to my mind, a lot like the original text adventure games.

Tapestry is therefore inspired by the world of interactive fiction and owes a lot in particular to Inform 7. For that reason, the default game world for Tapestry attempts to provide a similar set of game rules as Inform. And, Tapestry tries to provide a similar ( if less extensive ) way to model a game world using English-like sentences.

It is not a goal to attempt to match Inform's amazing natural language programming environment. ( Nor is it a goal to run on z-machines. ) It is however a goal to be able to play some "Inform-like" stories with similar results. Tapestry hopes to extend interactive fiction development into any game genre.

Working Example

This is part of "Cloak of Darkness" story ( ported from the Inform7 version of Robert Firth's original ):

The Foyer of the Opera House is a room. You are in the foyer. The description of the Foyer is "You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and east."

The entrance is a door in the foyer. North from the foyer is the entrance. Through the entrance is the Street. Instead of traveling through the entrance:
   - Say: "You've only just arrived and besides the weather outside is terrible."

Building this with Tapestry produces a playable story and a SQLite database consisting of all of the objects in the game, their interactions, and the game rules.

Status

Tapestry is a work in progress. You could use it to create some simple text based games, but you will encounter bugs and missing features.

The flow of development with Tapestry is:

  1. Use tap new to create a new story file.
  2. Edit using your favorite text editor ( or Tapestry's experimental Blockly editor. )
  3. Optionally, use Tapestry's game database to bind to, and validate, graphical assets.
  4. Embed the story engine into the game engine of your choice.
  5. Iterate using the built-in game console. Use the runtime database to track progression, inspect the game world, run unit tests, etc.

Games are currently playable at the command line, and there is a bare bones version running inside the Godot game engine. A list of various to-dos is here.

Near term goals include:

  • Add features to allow for more complex stories.
  • Improve the underlying modeling and scripting syntax.
  • Improve integration with godot.
  • Documentation.

Version History

Tapestry started as a rework of the Sashimi engine which was used for "Alice and the Galactic Traveler" - a point-and-click adventure game. I've used similar techniques on other projects over the last 20 years, but Tapestry is its own creation.

v0.24.5:

  • Implements save/load. The model db is treated as read-only, a separate in-memory "rt" database is mounted and then serialized to/from disk.
  • Simplifies object and kind creation. ( As part of save/load support for serializing records. )
  • Merges package generic into package rt. ( Required for the simplified creation. )
  • Updates to go1.22. ( Required for rand/v2, which is needed for save. )
  • Small changes to make staticcheck happier.

v0.24.4:

  • Story files now support mixed plain-text and structured-command sections. For example: The Empty Space is a room. You are in the space. is now a valid .tell file.
  • Jess now handles english-like rules ( Instead of examining the message: )
  • Added new tap tool commands: "tap new" to create new stories. "tap version" to report the latest git tag ( only works if using tap install. ) Also changed tap to be more "go" like ( ex. "tap check cloak", instead of "tap check -scene cloak" )
  • Story files and shared library scripts now sit side-by-side in the source tree content folder. For the user local document folder: if there is no "shared" folder, tap will use a built-in copy. And if there is no "stories" folder, tap will create it.
  • Added two very simple "sample" stories.
  • Known Issues: blockly is (probably) broken because of the .tell changes; that's fine for now.

v0.23.3: Expanded english-like parsing (aka 'jess'.) Handles directions and room creation. Verbs replace the experimental macro system (ex. 'carrying', 'wearing'.) Improved scheduling during weave so command statements and jess statements can work better with each other.

v0.23.2: English-like parsing in the style of Inform. ( "The bottle is a transparent, open, container.", "Understand "jean" and "genie" as the bottle.", "The bottle has the description "still needs some polish.", etc. ) More phrase parsing still to come.

v0.23.1: Serialization revamp. Stories now use tell (aka. yaml) instead of json. Encoding and decoding use reflection and autogenerated typeinfo rather than autogenerated marshaling ( significantly reduces code size, and improves code readability; debugging. )

Licenses

Tapestry is open source, and all original source code is provided under a BSD-3 license.

Go and its libraries use their own BSD style license. All existing third party Go language dependencies use the MIT license. Tapestry uses SQLite for data storage, and SQLite is public domain. Tapestry's "Mosaic" editor and web console use Blockly and Vue.js which are licensed under the Apache 2.0 and MIT licenses respectively. Development of the editor and web console require Node.js and a variety of modules each of which use their own open source licenses. Godot is used for demonstrating 3D party engine integration. It uses an MIT license.

Please see the Tapestry LICENSE file for details.

Code of Conduct

Black lives matter, and queer and trans lives matter. In that spirit, if you are interested in contributing to the project, please refer to the CODE OF CONDUCT.

Contributor Covenant

Documentation

Overview

package tapestry is a reimplmentation of the sashimi interactive fiction engine with some lessons learned.

Index

Constants

This section is empty.

Variables

View Source
var AllSignatures = []map[uint64]typeinfo.Instance{
	assign.Z_Types.Signatures,
	core.Z_Types.Signatures,
	debug.Z_Types.Signatures,
	grammar.Z_Types.Signatures,
	literal.Z_Types.Signatures,
	list.Z_Types.Signatures,
	prim.Z_Types.Signatures,
	rel.Z_Types.Signatures,
	render.Z_Types.Signatures,
	game.Z_Types.Signatures,
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package affine - names for all of Tapestry's built-in data types: primitives, structured types, and arrays thereof.
Package affine - names for all of Tapestry's built-in data types: primitives, structured types, and arrays thereof.
blockly
bconst
common configuration and constants for tapestry's use of blockly
common configuration and constants for tapestry's use of blockly
block
package block transforms story files into blockly workspace files ( languageVersion: 0 ) see: https://developers.google.com/blockly/guides/configure/web/serialization
package block transforms story files into blockly workspace files ( languageVersion: 0 ) see: https://developers.google.com/blockly/guides/configure/web/serialization
box
Package box generates blockly toolbox(s) in JSON format.
Package box generates blockly toolbox(s) in JSON format.
shape
Package shape generates blockly custom blocks in its JSON format.
Package shape generates blockly custom blocks in its JSON format.
unblock
Package unblock decodes blockly style story files into tapestry commands.
Package unblock decodes blockly style story files into tapestry commands.
cmd
atlas/internal
Package main for atlas.
Package main for atlas.
chart
Package main for 'chart'.
Package main for 'chart'.
serve
Runs external applications, and pipes http input to stdin; stdout to http output.
Runs external applications, and pipes http input to stdin; stdout to http output.
tap Module
Package content - this go package exists so that tools can embed the standard lib.
Package content - this go package exists so that tools can embed the standard lib.
dl
Package dl groups together the various data language packages.
Package dl groups together the various data language packages.
assign
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
core
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
debug
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
frame
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
game
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
grammar
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
jess
Package jess helps to turn english like sentences into story fragments destined for a story db.
Package jess helps to turn english like sentences into story fragments destined for a story db.
list
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
literal
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
play
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
prim
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
rel
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
render
Package render exposes commands used by package express to render templates.
Package render exposes commands used by package express to render templates.
rtti
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
story
Code generated by Tapestry; edit at your own risk.
Code generated by Tapestry; edit at your own risk.
testdl
Package testdl contains various autogenerated types the intention is to decouple some of the "test autogenerated utils" from the tapestry language itself.
Package testdl contains various autogenerated types the intention is to decouple some of the "test autogenerated utils" from the tapestry language itself.
Package express converts a postfix template expression into tapestry commands.
Package express converts a postfix template expression into tapestry commands.
lang
inspect
Package inspect provides depth first iteration a tapestry command or slice of commands.
Package inspect provides depth first iteration a tapestry command or slice of commands.
typeinfo
Package typeinfo describes tapestry autogenerated structures.
Package typeinfo describes tapestry autogenerated structures.
Package parser
Package parser
qna
Package qna provides an implementation of rt.Runtime.
Package qna provides an implementation of rt.Runtime.
decode
Package decode unpacks stored programs and values from byte slices
Package decode unpacks stored programs and values from byte slices
qdb
Package qdb asks specific questions of the play.db for the package qna runtime.
Package qdb asks specific questions of the play.db for the package qna runtime.
rt
Package rt defines the runtime interfaces used to interact with the game world.
Package rt defines the runtime interfaces used to interact with the game world.
kindsOf
package kindsOf defines a handful of built-in base types for tapestry kinds.
package kindsOf defines a handful of built-in base types for tapestry kinds.
meta
Package meta provides string constants for rt.Runtime Get/SetField.
Package meta provides string constants for rt.Runtime Get/SetField.
pattern
Package pattern provides tools for creating and executing functions with guards.
Package pattern provides tools for creating and executing functions with guards.
print
Package print provides low level routines for styling output.
Package print provides low level routines for styling output.
support
files
Package files: a grab bag of functions for reading and writing files.
Package files: a grab bag of functions for reading and writing files.
flex
Package flex reads tell files that are sectioned into alternating blocks of structured and plain text sections.
Package flex reads tell files that are sectioned into alternating blocks of structured and plain text sections.
inflect
Package inflect provides (some) english language string transformation utilities.
Package inflect provides (some) english language string transformation utilities.
jessdb
Package jessdb provides an implementation of jess.Query for use with the tapestry db.
Package jessdb provides an implementation of jess.Query for use with the tapestry db.
jesstest
Package jesstest exercises implementations of jess.Query to ensure they produce good results.
Package jesstest exercises implementations of jess.Query to ensure they produce good results.
shuttle
Package shuttle turns json based requests into game play.
Package shuttle turns json based requests into game play.
tag
Package tables - utilities for working with the Tapestry sqlite tables.
Package tables - utilities for working with the Tapestry sqlite tables.
idl
Package template converts strings to postfix expressions.
Package template converts strings to postfix expressions.
postfix
Package postfix translates streams of infix functions into postfix expressions.
Package postfix translates streams of infix functions into postfix expressions.
eph
pacakge eph provides helpers for testing
pacakge eph provides helpers for testing
mdl
Package mdl provides an api for building the database used by the tapestry runtime.
Package mdl provides an api for building the database used by the tapestry runtime.
web
Package web provides utilities for working with go's net/http package.
Package web provides utilities for working with go's net/http package.
js
Package js provides some simple json utilities: MapSlice, for preserving map key order when unmarshaling, and Builder for writing json-like data without marshaling.
Package js provides some simple json utilities: MapSlice, for preserving map key order when unmarshaling, and Builder for writing json-like data without marshaling.
markup
Package markup converts an custom html-like markup into markdown-like text.
Package markup converts an custom html-like markup into markdown-like text.
useraction
Package useraction: handle long running actions initiated from the browser.
Package useraction: handle long running actions initiated from the browser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL