From a hardware standpoint, a game created with HeroEngine is broken down into structures called Universes, which can run in different physical locations around the world. This page attempts to give a basic overview of how a Universe's servers and processes are inter-related.
Each game is composed of various Areas, each of which usually runs on a dynamic process known as an Area Server process. For a large Area, it might be handled by multiple Area Server processes, which might be running on multiple hardware servers within a Server Group.
All of the hardware which runs the Area Servers for a particular instance of the game will be located in the same geographical location, which is known as a Universe. Each Universe is completely separate -- though it's possible for a player or developer to teleport from one Area to another within the same Universe, they cannot access an Area in a different Universe unless they disconnect from their current Universe, and then connect to a different one.
Each universe runs on several linked processes that can span multiple computers, which talk to each other via a communication layer known as FireStorm. A Universe is the conceptual idea behind a group of hardware servers in one physical location. The group of servers contains all of the worlds that can be run from that location.
For example, when a developer connects to the game, they are using a client called HeroBlade. That client connects to a World, initially connecting to a process called the Dude Server, before being passed to one of the other server processes. Most commonly, a player or GameMaster will eventually be connected via the World Server process to an Area Server process. During the player's game session, the most common method of communication will be from their computer (the Client) to the particular Area Server process that the client is connected to at that time. As a player moves through the game, from area to area, they will probably be passed between multiple Area Server processes, each controlling a different geographical section of the game. All of these Area Server processes will be part of a single World, and that World will be part of a Universe of hardware servers which are in a single location (such as the West Coast or East Coast of the U.S.)
For each Universe, there is one Master Control process. There is also a Master Control Console, which is a GUI window that can be used to view and modify information related to the servers and processes at that location. Please see the section on the Master Control for more information.
Though servers and processes are essential to the proper functioning of the engine, a detailed understanding of most of the servers is not necessary.
For a complete list of basic processes, see Processes.
It is worth discussing how the different parts of the engine talk to each other.
Typically, a player logs into the game via their client. Some parts of HeroEngine have similar but separate counterparts on both the client and the various server processes. For example, the client has its own script engine on the user's computer, and there is a separate script engine on the server side.
The client talks to various server processes via communication channels. The Area Server can also send commands back to the Client via the same channel. Commands are handled by the $COMMANDHANDLER system node. For more information, please see the section below on Script Entry Points.
Another commonly-used communications pathway is between the Area Server processes and the World Server process. See below for more information.
Pre-Defined Scripts and Data
Though most elements of the DOM and scripting engine are to be created by GameMasters, in order to allow for smooth functioning of the engine, some elements needed to be pre-defined. For example, in order for the data structures of the DOM to work, there are some initial pieces of data that needed to be in place before other more elaborate structures could be defined (sort of a chicken and the egg problem). There are also certain scripts that are designated as entry points into the scripting engine, meaning that they're the scripts that first get passed the information from a particular server, so that that information can then be processed by the scripts.
For example, when a GameMaster types a command, that text is sent from the client to its current Area Server, where it is handed to a function in the CommandHandler script. The CommandHandler script on the Area Server will then examine what it has been passed and either:
- Decide that the command needs to be processed by the World Server, in which case the Area Server sends the data via an exposed function to the World Server, and then it is handled by the CommandHandler script on the World Server.
- Pass the information on to another script that is running on the same Area Server
- Perform a requested action
- Send information back to the client
Script Entry Points
- See also: Category:Script entry points
The Area and World Servers make calls (known as callbacks) to well-known script functions in response to some events that need to be handled by script logic. The server expects these well-known functions to be defined in well-known scripts. If the script or function is missing, the servers will not run. If the arguments to the functions do not match what the server expects, an error will be generated when the script event is processed.
These events generally occur in response to incoming data from players, or are triggered by a timer. Timer callbacks are described separately.
To see the individual functions, check the appropriate Pre-Defined Scripts below.
Another class of entry point on the server side are calls to the function UpgradeClass.
The pre-defined scripts (of the clean HeroEngine) are the class method scripts of the System Nodes, such as $WORLD, $AREA, $ACCOUNT, $EDIT and $COMMANDHANDLER. Each system node is intended to be overridden and extended via the mechanism of "GLOMming" a class specific to your game onto the system node.
- $WORLD - Handles the mechanics of area spin-up/down including the world itself, provides access to selected information about players (current area, account name etc) and areas (which areas are currently running).
- $AREA - Handles the processing of events that happen at the area server level, such as the area itself spinning up.
- $ACCOUNT - Handles events corresponding to a player, such as when a player logs on/off, enters/leaves an area, etc.
- $EDIT - Handles the editing events produced by editing clients such as HeroBlade, as they modify areas.
- $COMMANDHANDLER - This script runs on and is used by each of the Servers. It contains functions which are used by Area Servers and also by the World Server. Common uses of it are to handle the processing of commands, such as those typed into the chat panel.
- HeroEngine Setup Phases
- Adapting Clean Engine
- Data storage options
- Client to Server, Server to Server and Server to Client Communication: The Wonderful World of Asynchronous Programming
- Hardware recommendations
- Connection Logic
- Structure of an Account (server-side)
- Structure of an Area (server-side)
- Master Control
- Area architecture
- Managing servers and processes