UI File

A UI file is a document that implements a single, specific ruleset API for a single, specific client type. For example, one UI file might allow text-based clients (such as Friv to play rock, paper, scissors, while another lets SVG clients (like Gamut) play chess.

Clients locate and download UI files through the UI finder.

UI file logic is generally written in ECMAScript according to the ECMAScript API.

File Formats

Volity does not formally prescribe any particular file format for UI files. Through the UI finder's URI-based client identification system, the world of Volity UI files can theoretically embrace any computer language or document type.

Current volity development efforts, however, are focused heavily on SVG UI files, perhaps supported with HTML files. See SVG UI file strategy, and Gamut.

A UI format which encompasses multiple files should be packed as a ZIP file. See SVG UI file strategy. (The principles listed will likely be adapted to multifile UIs other than SVG, if we ever invent any.)

Player UI customization

It is possible for a UI file to include external resources, chosen by the player. Canonical example: you create 52 pieces of art for a customized poker deck. You want to use this art in every Volity game that makes use of a poker deck. Ditto for Tarot decks, spiffy Icehouse pyramids, etc. You can also make a resource available for other people to use.

See pluggable resources for more information.

Original proposal follows...

The Volity notion to date is that the UI file is written by the game designer (who also writes the referee's game code). If the game is to have multiple UI files (different languages, text vs graphical, cellphone display vs large screen) the game designer has to write all of them. Or other people can collaborate with the designer, but it's still essentially one person in charge of the whole effort.

However, it would be a shame if the player couldn't specify some aspects of the UI -- beyond simply choosing from a menu of UI files. Canonical example: you create 52 pieces of art for a customized poker deck. You want to use this art in every Volity game that makes use of a poker deck. Ditto for Tarot decks, spiffy Icehouse pyramids, etc.

At the simplest, this occurs inside the client -- the referee and game server don't know or care about custom art. You see your custom art, but other players (even in the same game) do not.

(A more complex mechanism would let players share and publicize art across the Jabber network, so that everyone sees each other's custom pieces. I am not going to think about that right now, though.)

The obvious way to do this kind of customization is SVG external links. We'd need a well-defined SVG document structure for each kind of pluggable resource (poker deck, tarot deck, Icehouse stash, etc). The client would need some way to install or detect these resources on the player's computer.

It would also be nice if the main UI file could probe the SVG resource to see if it matched its needs. (A tarot deck can be used to play poker, but not vice versa. Not all cards have the same dimensions or aspect ratio. Pulling ideas at random here.) DOM reflection? Calling query scripts in the SVG resource? Not sure.