What is MAST
MAST (Multiple Agent Story Telling) is a programming language used in Artemis: Cosmos to create Game Mastered and Story driven Missions.
MAST provides a new simple programming language that enables:
- Language that flows more like a narrative or film script
- Easy and rich GUIs for the pause scene and the Artemis: Cosmos consoles
- A Task/State driven system managing multiple tasks in parallel e.g. a quest with side quests
- Complex AI
- Interactive choices and dialog
- Similar capabilities to Visual Novel systems, such as RenPy, Inkle Ink, and Choice script
Multiple Agent Story Telling
Multiple Agents
The multiple agents of a MAST story (players, non-player characters, etc.) each have their own story and those stories can have multiple side plots.
In MAST for Artemis: Cosmos, the multiple agents are the player consoles, the ships, various characters that can be on ships, etc. Artemis: Cosmos has the ability to add many more characters to the game. For example there can be multiple characters on a space station that you may interact with. The Damage Control teams can have richer stories and each can be unique.
Storytelling
Stories have a forward moving flow; there is a beginning, a middle and an end. MAST's programming flow keeps the story moving forward. MAST also facilitates an interactive narrative which allows for choice and branching of the story, revisiting aspects of the story etc. while still flowing the story on a single path.
Multiple stories
An Artemis: Cosmos mission is not just one story about one thing; it is many.
Artemis: Spaceship Bridge Simulator may be familiar with the <event>
.
Artemis: Cosmos has the concept of Task.
Tasks run a single script. From beginning to end.
Tasks run in (pseudo) parallel. Unlike the Artemis: SBS events, Task can be scheduled, canceled, and can end.
Tasks are described in detail in the MAST Language
Why a language other than python?
Artemis: Cosmos engine allows for scripting missions using Python. Python is a productive and easy to learn programming language. To help script writers, the sbs_utils library was created. This is a powerful and viable option to create Artemis: Cosmos scripts.
While working with several script writers familiar with the Artemis: Spaceship Bridge Simulator XML mission scripting some found the python daunting and far less productive. Many of these script writers are authors, educators and are not full time programmers.
Markup language vs. programming language
MAST is a hybrid of a markup language and a programming language.
Markup languages provide a simple text document that simplifies a more complex system.
Inspiration for MAST are languages like Inkle Ink, choice script, renPy.
Reuse and add-ons
The MAST system makes it easy to extend things and package these extensions to be shared by other missions.
For example, Artemis: Cosmos ships with the Secret Meeting and Walk the Line missions. They appear very small, but they use code from Legendary Missions that are packaged as mastlib add-ons (found in the __lib__ folder)
As more scripts are written it should be easy to create a side mission as an add on and allow it to be dropped into many other missions to share.
Hierarchical flow vs. Sequential flow
Early programming languages like BASIC were more approachable to hobbyists and non-programmers. They would run in a sequential flow from beginning to end in a simple script that was easier to follow. However, reusing and reorganizing code was difficult to manage as projects grew larger and more complex.
Python and other object oriented languages tend to have a complicated interconnected execution flow, where the hierarchy of which functions are calling other functions isn’t always clear.
State and State machine
Games in general tend to manage the state of items in the world and respond to changes to change the state.
Programmers often create a pattern called a State Machine to deal with this.
The Artemis: Spaceship Bridge Simulator XML language was a simplified markup 'language' that ran a series of state machines, where each <event>
tag was its own state machine. The state conditions are checked in order, and if the conditions are met the event runs.
The Artemis: Spaceship Bridge Simulator XML language is inefficient in that all events always run every tick, and it had no concept of reuse. Script writers copy and pasted events to 'reuse' them.
Even in other programming languages State Machines require boiler plate code to add new states and transitions. This also requires copy and pasting code.
MAST is intended to enabling creating state driven programming that is:
- More efficient because only needed things are executed
- script writers do not write state machine and management code