2024-05-10 04:45:22 +00:00
|
|
|
|
# TaleWeave AI Engine
|
|
|
|
|
|
|
|
|
|
## Contents
|
|
|
|
|
|
|
|
|
|
- [TaleWeave AI Engine](#taleweave-ai-engine)
|
|
|
|
|
- [Contents](#contents)
|
2024-05-13 04:33:47 +00:00
|
|
|
|
- [Concepts](#concepts)
|
|
|
|
|
- [What is a system?](#what-is-a-system)
|
|
|
|
|
- [What kinds of entities exist in the world?](#what-kinds-of-entities-exist-in-the-world)
|
|
|
|
|
- [What are actions?](#what-are-actions)
|
|
|
|
|
- [What are attributes?](#what-are-attributes)
|
|
|
|
|
- [What are rules?](#what-are-rules)
|
|
|
|
|
- [What are triggers?](#what-are-triggers)
|
|
|
|
|
- [What are events?](#what-are-events)
|
|
|
|
|
- [Threads](#threads)
|
|
|
|
|
- [Discord Bot Threads](#discord-bot-threads)
|
|
|
|
|
- [Render Thread](#render-thread)
|
|
|
|
|
- [Websocket Server Thread](#websocket-server-thread)
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
## Concepts
|
|
|
|
|
|
|
|
|
|
### What is a system?
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
|
|
|
|
In TaleWeave AI, a system refers to a predefined logical process that governs the interaction and behavior of entities
|
|
|
|
|
within the game world. These systems are essential for modifying the attributes of entities based on the actions taken
|
|
|
|
|
and the rules applied during gameplay. By integrating systems, TaleWeave AI facilitates dynamic and responsive
|
|
|
|
|
environments where each action has a potential impact, reflecting changes in the game's state and influencing subsequent
|
|
|
|
|
player decisions. Systems are designed to be modular and scalable, allowing developers to customize or extend the game
|
|
|
|
|
mechanics to suit different types of adventures and narrative styles.
|
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
### What kinds of entities exist in the world?
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
2024-05-27 01:32:03 +00:00
|
|
|
|
In the immersive world of TaleWeave AI, entities are categorized into Rooms, Characters, and Items, each playing a vital
|
2024-05-10 04:45:22 +00:00
|
|
|
|
role in crafting the narrative and gameplay experience. Rooms serve as the fundamental spatial units where the story
|
2024-05-27 01:32:03 +00:00
|
|
|
|
unfolds, each containing various Characters and potentially multiple Items. Characters, representing characters in the game,
|
|
|
|
|
possess inventories that hold Items, which are objects that can be interacted with or utilized by the Characters. Currently,
|
2024-05-10 04:45:22 +00:00
|
|
|
|
TaleWeave AI does not support Containers—Items that can hold other Items—but the structure is designed to support
|
|
|
|
|
complex interactions within and between these entity types, laying the groundwork for a deeply interactive environment.
|
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
### What are actions?
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
|
|
|
|
Actions in TaleWeave AI are defined as Python functions that enable both human players and AI-driven characters to
|
|
|
|
|
interact with the game world. These actions, which include behaviors like taking an item or moving between rooms, are
|
2024-05-27 01:32:03 +00:00
|
|
|
|
integral to advancing the gameplay and affecting the state of the world. Each character is permitted one action per round,
|
|
|
|
|
which can significantly alter the attributes of entities, reposition entities between rooms or characters, or modify the
|
2024-05-10 04:45:22 +00:00
|
|
|
|
game world by adding or removing entities. This framework ensures that every turn is meaningful and that players'
|
|
|
|
|
decisions have direct consequences on the game's progression and outcome.
|
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
### What are attributes?
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
|
|
|
|
Attributes in TaleWeave AI are key-value pairs that define the properties of an entity. These attributes can be of
|
2024-05-27 01:32:03 +00:00
|
|
|
|
various types—boolean, number, or string—such as a character's mood being "happy," their health being quantified as 10, or
|
2024-05-10 04:45:22 +00:00
|
|
|
|
an item's quality described as "broken" or quantified with a remaining usage of 3. Attributes play a crucial role in the
|
|
|
|
|
game's logic system by influencing how entities react under different conditions. They are actively used to trigger
|
|
|
|
|
specific rules within the game, and their labels are included in prompts to guide language model players in making
|
|
|
|
|
decisions that are contextually appropriate and aligned with their character's current state.
|
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
### What are rules?
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
|
|
|
|
Rules in TaleWeave AI are defined mechanisms within the logic system that facilitate the updating of the game world
|
|
|
|
|
based on specific criteria. Each rule describes a transition from one state of an attribute to another—for instance, an
|
|
|
|
|
entity might transition from being "full" to "hungry" or from "happy" to "sad." These rules can employ set logic or use
|
|
|
|
|
a rule engine to execute simple predicates, allowing for sophisticated control over how and when attribute states
|
|
|
|
|
change. This structured approach ensures that the game world remains dynamic and responsive, with entities exhibiting
|
|
|
|
|
behaviors that reflect their evolving conditions.
|
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
### What are triggers?
|
2024-05-10 04:45:22 +00:00
|
|
|
|
|
|
|
|
|
Triggers in TaleWeave AI act as the logical counterpart to actions. While actions are initiated by players (either human
|
|
|
|
|
or AI) to interact with the game world, triggers are automated responses invoked by the game’s logic system based on
|
|
|
|
|
specific conditions or rules. When a particular condition is met, the corresponding trigger function is executed, which
|
|
|
|
|
can alter the attributes of an entity significantly. These triggered functions are powerful tools within the logic
|
|
|
|
|
system, enabling the game to automate complex behaviors and interactions, thereby enriching the player’s experience with
|
|
|
|
|
a more lifelike and engaging narrative environment.
|
|
|
|
|
|
2024-05-13 04:33:47 +00:00
|
|
|
|
### What are events?
|
|
|
|
|
|
|
|
|
|
TODO
|
|
|
|
|
|
|
|
|
|
## Threads
|
|
|
|
|
|
|
|
|
|
The TaleWeave AI engine is multi-threaded. Each bot or server has at least one thread to manage the connections.
|
|
|
|
|
|
|
|
|
|
### Discord Bot Threads
|
|
|
|
|
|
|
|
|
|
- bot thread
|
|
|
|
|
- feeder thread
|
|
|
|
|
|
|
|
|
|
### Render Thread
|
|
|
|
|
|
|
|
|
|
- render thread
|
|
|
|
|
- feeder queue
|
|
|
|
|
|
|
|
|
|
### Websocket Server Thread
|
|
|
|
|
|
|
|
|
|
- server thread
|
|
|
|
|
- feeder queue
|