Nouns
In addition to handling game logic flow, Narramancer provides a general-purpose table of the 'things' in your game. The various things in your game may include characters, equipment, items, or areas.
The Narramancer system makes no assumptions about what your things are and refers to them simply as Nouns.
These things may or may not be associated with GameObjects, but the aspects of a noun are remembered even when scenes are unloaded and GameObjects are destroyed.
Nouns are simply named containers with no inherent value until they are attached with developer-defined adjectives.
Structuring the characters and items in your game as Narramancer Nouns has two distinct advantages:
- Nouns and anything attached to them automatically get saved and loaded as part of the game state.
- Nouns are easy to query and manipulate within Verbs through various noun-specific nodes.
Nouns and adjectives are defined using ScriptableObjects.
Creating New Nouns
Method 1
Use the Narramancer Window; open it to the Editor -> Nouns tab, and use the plus button.
A demonstration of creating a new noun using the Narramancer Window.
This will open a save prompt, allowing you to choose a location and a name for the new Noun asset.
This will also add the Noun asset to Narramancer's global list of Nouns. Nouns that Narramancer does NOT know about will not get created at runtime.
Method 2
Nouns can also be created from the Asset Creation Menu by right-clicking somewhere in the project, and then choosing Create -> Narramancer -> Noun from the context menu. This will create a Noun Asset at the given location but will NOT automatically add the Noun to Narramancer's global list of Nouns.
Method 3
Nouns do not necessarily need to be associated with an asset (ie: NounScriptableObject).
You can create nouns at runtime using ActionVerbs and the CreateInstanceNode. Nouns created this way are automatically registered with the Narramancer table.
Method 4
You can create nouns using GameObjects through the CreateNounForGameObject component. Nouns created this way are automatically registered with the Narramancer table AND coupled with their given GameObject.
Instances
An important distinction to make is between a NounScriptableObject and a NounInstance.
A NounScriptableObject exists as an asset prior to the game starting and is used to create a NounInstance. The values of a NounScriptableObject represent the Noun's starting values and qualities, but changes made to the NounInstance during runtime are not applied to the NounScriptableObject and vice-versa.
A NounInstance represents a mutable Noun object and exists only while the game is running. It may have been created from a NounScriptableObject (ie: if it was created using Methods 1 or 2) but not necessarily (as is the case if it was created using Method 3 or 4).
That being said, NounScriptableObjects can be used to find their corresponding NounInstance by using a GetInstanceNode.
Within verbs and nodes, Nouns and NounInstances are typically referred to as just Instances.
Adjectives
Nouns gain their value by the adjectives attached to them. In Narramancer, we use the term 'adjective' to describe components or pieces that can be added to a Noun.
It is up to you to define the various adjectives in your game by creating the various assets/ScriptableObjects associated with them.
The three types of adjectives are: Properties, Stats, and Relationships.
Similar to nouns, adjectives are defined using ScriptableObjects, then instances of each adjective are created during runtime.
Properties
A Property is a named quality that can be attached to a Noun and used to identify that noun as being part of a group or flag a noun as having a certain quality or being treated in a certain way.
Stats
Stats are number values that can be attached to a noun, then modified over the course of the game. You can use stats to represent a noun's health, mana, strength, or even as a running count of how many battles this noun has been in.
A screenshot of a StatScriptableObject Inspector window.
Each stat can have an optional min value, max value, or starting value that will affect its behavior over the course of the game.
Relationships
Relationships are unidirectional connections between two nouns. They can be added or removed over the course of the game, and are useful ways to represent things like how characters are related (eg: siblings), what has happened in the history between two characters, or how two areas are connected to each other.
Relationships are decidedly unidirectional, meaning the relationship only applies one way. We designate this by saying that one entity is the source of the relationship and one entity is the destination. This becomes important when using queries to find nouns based on these relationships.
Creating Adjectives
Method 1
Use the Narramancer Window; open it to the Editor -> Adjective tab, and use the "Create new" button, then choose one of the types.
A demonstration of creating a new adjective using the Narramancer Window.
This will open a save prompt, allowing you to choose a location and a name for the new Adjective asset.
Method 2
Adjectives can also be created from the Asset Creation Menu by right-clicking somewhere in the project, and then choosing Create -> Narramancer -> Property/Stat/or Relationship from the context menu. This will create the given adjective asset at the given location.
Attaching Starting Adjectives to Nouns
In order to attach properties, stats, or relationships to a noun, simply select the NounScriptableObject and add the adjective to its corresponding list.
A screenshot of a noun and its inspector window, with starting adjectives added.
Properties, stats, and relationships added this way will be automatically initialized on the given noun on game start.
For stats, be sure to assign a starting value.
For relationships, be sure to assign the other noun in the relationship, and determine whether this noun is the source of the relationship or the destination.
Example Scene: Creating and Destroying Nouns
We have provided an example scene demonstrating basic noun creation as well as destruction during runtime using ActionVerbs.
A screenshot of where to find the Noun Creation and Destruction Scene asset.
Opening and playing this scene will present the player with a series of looping choices, allowing them to continuously create and destroy nouns.
Open the associated ActionVerb (Noun Creation and Destruction Verb.asset) in the Verb Editor to see the entire flow of logic.
The nodes of note are the CreateInstanceNode and the DestroyInstanceNode.
Example Scene: Adding and Removing Properties
To see an example of adding and removing properties during runtime please see the 'Adding and Removing Properties' Example Scene.
A screenshot of where to find the Adding and Removing Properties Scene asset.
This example will create a handful of nouns and automatically add a property to them. The player then is presented with a looping sequence of choices which allows them to see nouns that have the property vs nouns that do not, as well as add or remove that property.
The nodes of note are the AddPropertiesNode and the RemovePropertiesNode.
Additional nodes of interest are the GetInstancesNode, the ListForEachNode, and the SequenceOfNodesNode.