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 the respective class files and build up the various resources used in Escoria. See the API-docs folder for details.
The Escoria autoload scene holds various nodes that provide vital parts of the engine.
The ESC logging framework is responsible to log various game events throughout the engine.
Some smaller utilities used on 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 compiler compiles files in the ESC language into a list of events that can be run by the ESC event manager.
The ESC event manager is used for queuing and scheduling events and handles the 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 and especially by ESC scripts are required to register to 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 just for their games.
To optimize performance on platforms that support a larger memory footprint, resource 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 data node is responsible for storing and loading savegames and the game settings.
The scene, that Godot loads when starting a game (the main scene) is set to addons/escoria-core/game/main_scene.tscn
and basically instantiates the configured main menu scene and starts it.
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 would open the coin and let the player select the respective verb.
The game interface will ultimatively call escoria.do
, which is a plumbing method, that handles core functions like walking, clicking on items or visiting areas. This method will then take care of the different actions, for example moving the player to the 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 event has an event :use
, the event manager
will run that specific event.