User:Flying Jester/TurboSphere Plugin Roadmap

From Spherical
Jump to: navigation, search

This page describes the plans for the standard distribution TurboSphere plugins. It includes the breakdown of which functions belong in which plugins, the interaction of certain plugins, and the categorization of the plugins.

Forward

The TurboSphere game engine is composed of the engine binary (turbosphere or turbosphere.exe), several support libraries (graphicalg.dll, graphiccommon.dll, configmanager.dll t5.dll, or libgraphicalg.so, libgraphiccommon.so, libconfigmanager.so, libt5.so), and a set of plugins, which are shared libraries.

The engine opens games. The supporting libraries provide functionality to the engine and plugins. The plugins provide script-side functionality, and implementation-specific functionality to other plugins for use by script.

The engine contains functionality to parse command line parameters to open a game folder, sgm, or tsgm file, the functionality to enumerate, load, and close plugins, and sets up the standard V8 JS environment.

The component libraries contain functionality and definitions useful for both the engine and plugins. graphiccommon contains the definition of a color object (represented as a TS_Color in the TurboSphere source, and a Color in script). graphicalg contains basic algorithmic structures (TS_Point, TS_Segment) that are used to pass basic information from the engine to a plugin or from a plugin to a plugin in a standard way. This library may one day also hold A* pathfinding, functions for linear approximation of circles, etc., that should be standardized between plugins. configmanager holds the functions and structures to set and get a games configuration, list of default directories, and the functions to open and execute a script.

T5 is a separate, though first-party, project from TurboSphere. T5 reads in ini-style files (with the addition of support for sections), and provides an api for reading and writing said files. It also contains cross-platform functions for determining if a path is a file or folder, and cross-platform functions to read in any file and return a standard C string that holds the files contents. T5 is the recommended way to read or write any config files for a plugin or the engine, as this provides a unified format (including any quirks that may not have been found yet) for TurboSphere configuration files.

Summary of Standard Plugins

There are currently (September 8, 2013; TS version 0.3.2rc) 10 standard plugins. They are:

  • audioBASS
  • bmpfontGL
  • getkeystring
  • graphicSDL_GL_threaded
  • inputSDL
  • mapengineGL
  • networkTS
  • scriptfsT5
  • ttffontGL
  • windowstyleGL

They are categorized as follows:

audioBASS

Contains Audio functions.

Adds support for the following file types:

  • wav
  • ogg
  • mp1
  • mp2
  • mp3
  • aiff
  • flac
  • midi
  • mod
  • xm
  • it
  • s3m
  • mtm
  • sf2

Audio Support is provided by the BASS shared library. Midi and SF2 is added by BASSmidi shared library, a BASS plugin. AudioBASS is designed for sound file opening, seeking, playback, and soundfont selection.

Any soundchip emulation is beyond the scope of this plugin.

Sound recording and sound file modification is beyond the scope of this plugin.

bmpfontGL

Contains functions to open Sphere rfn fonts, modify and save rfn fonts, and draw string using rfn fonts to the screen. Graphics interface is through OpenGL, font opening and manipulation is provided by SDL.

Adds support for the following file types:

  • rfn

Any support for TTF Fonts, other formats of bitmap-style fonts, and the conversion between any rfn and any other format of font, is beyond the scope of this plugin.

This plugin relies on a graphics plugin that is OpenGL compatible being used.

This plugin requires that whichever plugin supplies the Surface JS object type to script also export through C-linkage the function TS_SDL_GL_MakeV8SurfaceHandleFromPixels. This plugin requires that whichever plugin supplies the Image JS object type to script also export through C-linkage the function TS_SDL_GL_MakeV8ImageHandleFromGLTexture.

In the future, this plugin may export through C-linkage a facility to draw arbitrary text to the screen at given coordinates (i.e., for an as-of-yet unimplemented error reporting plugin).

getkeystring

Contains the function GetKeyString, which converts a keycode to a string. This plugin is a test plugin, especially for new plugin API changes.

Adds support for no file types.

Any function except for GetKeyString is beyond the scope of this plugin.

graphicSDL_GL_threaded

Contains functions for controlling the screen or game window, opening, modifying, and saving images, creating surfaces, creating and modifying colors, drawing graphics primitives.

Adds support for the following file types:

  • bmp
  • png
  • tiff
  • tga
  • gif
  • jpeg
  • pcx
  • pbm
  • lbm
  • pnm
  • xcf
  • xpm
  • xv

inputSDL

Contains functions for getting input from keyboard, mouse (including mousewheel), and gamepad/joystick.

Adds support for no file types.

Functions for low level access to any hardware, networking, and filesystem access is beyond the scope of this plugin.

mapengineGL

Contains functions for loading rmp maps, rts tilesets, and rss spritesets, running and controlling a Sphere-compatible map engine, creating modifying and deleting persons, entities, zones, and also saving maps, tilesets, spritesets, obstruction handling, and all other functions relating to the original Sphere map engine.

Adds support for the following file types:

  • rss
  • rts
  • rmp

Pathfinding is beyond the scope of this plugin.

networkTS

Contains functions for connecting to or hosting connections over a network via IPv4, IPv6, and IPX, sending and receiving data over a network, and getting the local machine's address and hostname.

Adds support for no file types.

Non-OSI networking and networking using other protocol stacks including AppleTalk is beyond the scope of this plugin.

scriptfsT5

Contains functions for accessing, modifying, saving, listing, and deleting INI-style files and rawfiles, and supplying MD5 hashes of files, strings, and ByteArrays. Provides structures for INI-style files, ByteArrays, and raw binary files.

Adds support for opening and saving any file, which are represented as binary data.

ttffontGL

Contains functions for opening and drawing text to the screen using TrueType, OpenType, and Type-1 fonts.

Adds support for the following file types:

  • ttf
  • otf
  • pfb
  • pfm
  • afm
  • pfa
  • ofm

Modifying or saving any of the supported file types is beyond the scope of this plugin.

windowstyleGL

Contains functions for opening and displaying rws windowstyles.

Support for modifying and saving rws windowstyles is planned, but currently not implemented.

Adds support for the following file types:

  • rws

What Belongs in a Standard Plugin

The standard set of plugins are designed to, when used all together, provide a Sphere 1.5-like set of functions for use in script. Several features exists already extending this functionality, including TTF font support. Generally, all standard plugins should supply a collection of Sphere 1.5 or 1.6 functions, all falling into a logical category.

Which Plugins are High Priority

Beyond this, all TurboSphere plugins can be categorized as atomic or extensive. Atomic plugins have functionality that could not be recreated given a Sphere 1.5-like environment if they were missing. The atomic plugins are scriptfsT5, networkTS, audioBASS, graphicSDL_GL_threaded, and inputSDL. Although some functions in these plugins could be emulated in script, many can not. On the other hand, given both scriptfsT5 and graphicSDL_GL_threaded one could write scripts to open rfn fonts, rws windowstyles, theoretically ttf fonts, the entire map engine, and getkeystring.

The plugins which are highest priority are these atomic plugins. Within this, all functions that cannot be recreated in script within these plugins are a higher priority than other functions.