Architecture of Escoria
The plugin script, autoload and classes
According to the concept of Godot plugins, Escoria initializes itself in the plugin script addons/escoria-core/plugin.gd. This script is mostly used to initialize the Escoria configuration items and initialize (and later remove) the autoload scene escoria.
This scene binds together all required objects and interfaces in a central place.
In addition to this, various classes are defined in their respective class files which build up the various resources used in Escoria. See the API-docs section for details.
Nodes and objects of the Escoria autoload scene
The Escoria autoload scene holds various nodes that provide vital parts of the engine.
The ESC logging framework is responsible for logging various game events throughout the engine.
Some smaller utilities used in various places in the engine.
The inventory manager is responsible for storing inventory items the player carries around.
The action manager is used when the player triggers a verb or uses items.
The ESC event manager is used for queueing and scheduling events and handles event execution.
The globals manager stores and handles global flags as described in the ESC reference.
The object manager handles the state of the objects used in the game (active/interactive/states). All objects that should be handled by the engine - especially by ESC scripts - are required to register with the object manager and have a unique global ID.
The command registry stores references to available ESC commands. By adding additional command directories via the settings, developers can enrich the ESC language for their specific needs.
To optimize performance on platforms that support a larger memory footprint, resources can be cached in the resource cache using the queue_resource ESC command.
The dialog player is used for handling dialogs and the say command.
escoria.main is the main scene manager used in Escoria that allows for switching scenes with transitions
The inputs manager is the central component in Escoria to receive, handle, and deliver input events.
The save manager is responsible for storing and loading savegames as well as the game settings.
The Godot main scene of Escoria
The interactivity workflow of Escoria
When the player clicks on an ESCItem, the input manager is used to check and distribute the click to the currently running game interface. The game interface is then responsible for taking the respective action based on its workflow. This way, different user interfaces can be implemented. For a coin interface, for example, a right click could open the coin and let the player select the respective verb.
The game interface will ultimately call
escoria.do, a plumbing that handles
core functions like walking, clicking on items, and visiting areas. This method
will then take care of the different actions; for example, moving the player to
an object (or its
interact_position) and then running the appropriate
event. The event is based on the
current_action set in the
actions manager (the verb) and the
current_tool (the selected item). If the current verb is
use and the
ESC script has an event
event manager will run that specific event.
Game start sequence
This is an overview of the steps that happen between when the player runs your game on their computer to when they can start playing it.