Variable names

From Infinite Worlds
Jump to navigation Jump to search

The information in this article is quite esoteric - if you're new to editing Infinite Worlds worlds you can safely ignore this page!

When a player takes a turn, the Storytelling AI generates a number of different variables. Some of these are shown directly to the player, some are shown indirectly, and some are not visible.

It can be useful to know the names of these variables, as their generation can be influenced by giving specific instructions in the Main instructions section of the world editor.

Note that any of these variables may be subject to change without notice. The illustrClothesChanged and illustrAppearanceChanged variables are particularly likely to change, and other illustration-related variables may change when AIs become powerful enough to make it feasible to provide illustration information for multiple characters each turn.

AI-generated Variables[edit]

This is the full list of variables (JSON fields), in the order in which they are normally generated by the Storytelling AI, along with the instructions given to the Storytelling AI to generate them. Note that you may override these instructions. This is especially handy to use in the Storyteller prompt for per-turn tweaks to variables, such as wanting to see a specific illustrSubject (including the player themselves).

Outcome Variables[edit]

evaluation
Type: (string)
Content Instructions
This argument must ALWAYS be given first. An evaluation of the feasibility of the player character's action. Should conclude with DENIED, FAILURE or SUCCESS.
whereWhen
Type: (string)
Content Instructions
The current time and location, e.g. '8.05pm Tuesday, in Katrina's study', or '11am Friday, in the swamps outside the city'. Give a precise time even if the player character would not know the time. Base the time on time in previous turns, and how much time might have elapsed since then. Be extremely generous in estimating elapsed time - assume that much more time would have passed than you might think likely. Adapt as appropriate for fantasy/sci-fi settings.
outcomeDescription
Type: (string)
Content Instructions
A description of what happens next as a result of the player character's action. Should be written in the style of [author style].
secretInfo
Type: (string)
Contents
Information relevant to what is happening which should be stored for story progression, but which is not known to the player character. For example, the opinions or motivations of another character, or things happening out of sight of the player character. While this information is not known to the player character, it should be explained in full here.
optionN_text
Type: (string)
option1_text
A first option for what I can do next.
option2_text
A second option for what I can do next.
option3_text
A third option for what I can do next.
stateVariablesUpdates
Type: (string)
Contents
A dict in JSON format where the keys are the names of state variables to be updated, and the values are the new values of those variables. The definitions (the "description" and "update instructions" fields) accompanying each variable/field are precisely what the Storytelling AI is provided to guide it in writing to each field. The stateVariablesUpdates field is only processed by the Storytelling AI if the selected model is among those which handle tracked items.
triggerEvents
Type: (string)
Contents
The letters of any trigger events which have occurred.

Image Variables[edit]

illustrSubject
Type: (string)
Content Instructions
Recommended subject for illustration. Ideally a single word. Choose whichever subject best represents what's new in the story - this might be an object, some scenery, or perhaps a single character the player character is talking to or looking at. NEVER select the player character themselves, unless explicitly told to. Important: Never choose the player character themselves, always something they can see. If the player character is on their own, show scenery or an object. For characters, naming consistency is important — for reference, here are some previous values for characters already encountered: Mira Windmere.
illustrIsCharacter
Type: (boolean)
Content Instructions
True if illustrSubject is a character, False if it's an object or setting.
illustrAppearance
Type: (string)
Content Instructions
Description of appearance of illustrSubject, for an image generation AI prompt. Should be of form [age] [ancestry] [description] [hair_eyes_skin]. 'age' is how old they _appear_ (not how old they are); omit this for non-humanoid subjects. 'ancestry' is a real-world ancestry, e.g. Irish, Danish, to guide the illustration. Must always be a real-world ancestry even for a fantastic setting. 'description' is a concise description of what the subject is, e.g. 'a woman', 'a female fairy', 'a dog', 'a book', 'a male mercenary'. Not more than 5 words total. Always include gender. 'hair_eyes_skin' is a brief description of the eyes, skin and hair (always including hairstyle), of illustrSubject, e.g. 'blue eyes, pale skin, long blonde hair in cornrows', or 'hazel eyes, olive skin, short auburn hair in a bob cut'. Examples of the combined output: 'a 70 year old Italian male wizard with brown eyes, tanned skin, disheveled long white hair and a long white beard', or 'a 20 year old female elf with blue eyes and blonde hair in a pixie cut'. Be very concise - not more than 10 words total. If illustrSubject is not a character, instead give a detailed description of the subject in question.
illustrClothes
Type: (string)
Content Instructions
Description of the clothing of illustrSubject. If they are naked or topless, explicitly write 'naked' or 'topless'. For beings who wouldn't normally wear clothes (animals, monsters etc), simply write 'None'. Never include footwear.
illustrClothesChanged
Type: (boolean)
Content Instructions
Must be set to true (very important) if illustrSubject's clothing has changed recently. Otherwise ignore.
illustrAppearanceChanges
Type: (string)
Content Instructions
MUST be filled in (very important) if for some reason, the appearance (hair, eyes, skin, body etc, NOT clothes) of illustrSubject has changed. If so, give full details of the change here. Otherwise do not provide this argument.
illustrExpressionPosition
Type: (string)
Content Instructions
For the facial expression, give one of: calm, friendly, smiling, angry, scared, sad. If not standing, also give position, e.g. 'smiling, lying on bed', 'sad, kneeling'.
illustrSetting
Type: (string)
Content Instructions
Brief description of the setting of illustrSubject, e.g. 'in a forest with dappled sunlight at dusk', or 'in an austere modern boardroom at night'. Always state the time of day (e.g. 'daytime', 'at night', 'at dawn'). Always be very concise - no more than a few words, maximum 6 words.

User-generated Variables[edit]

The AI is sent LOTS of information every turn, including all the Main Instructions, a long-term summary of the story so far, and the full text of the last few turns (with turn numbers provided).

In a couple of cases, names are given to parts of this information to make it easier to refer to in Main Instructions.

Specifically:

  • playerAction - The action entered by the player.
  • state variables or tracked items - These are the current values of tracked items provided to the AI.
  • description - The player character's description from their character sheet
  • objective - The player character's objective from the objective field under Introducing The Story
  • background - The background event(s) that led to the current story

Calling Variables Within Instructions[edit]

There are a variety of default variables available to a world author that can be called upon in the text of the instructions (including playerAction and should happen) and resolved using this syntax:

<<variable_name>>

These variables are always entirely lowercase, and always replace spaces with underscores. Variables that can be called in this way include the player's name <<player_name>> (string), the names of each skill <<skill_[skill_name]>> (integer), and the names of any state variables <<item_name>> (string or number depending on the tracked item's assigned type). When variables are called using this syntax, the contents of the variable replace the calling text.

An example of calling a variable inside instructions:

 // Assume the current player_name is "John Smith".
 Whenever I look at a mirror, set illustrSubject to <<player_name>>
 // this resolves as:
 Whenever I look at a mirror, set illustrSubject to John Smith
NOTE: None of the AI-generated or user-generated variables in prior sections can be called using this syntax. Those variables can only be referenced by name, without enclosure by <<>>.