This document describes, key by key, the overall syntax of XCI configuration files. There are six kinds of configuration files, as described in the main documentation:
For each key, the value format will be described by a set of argument names. Arguments surrounded by brackets can vary in number of instances per key, for example the set of frame indices for a sprite_frames key. Then, each argument is described in terms of type, range and meaning. Finally, the set of file types in which this key may appear is listed.
This document is intended to be a concise guide to the language and not a comprehensive programmer's guide. For that, please see the main documentation and the example game appendix.
For development, the recommended IDE is Atom with the language-xci package installed. There is also vim syntax support with the vim-xci syntax plugin.
There are five basic types for arguments:
- Integer: Simple decimal number value, with no decimal point. May be negative, depending on range.
- String: Literal characters and escape codes. String values are whitespace-delimited. Keys that take a variable number of strings, like text, may be reconstituting a concatenated string, using single spaces between the string tokens. Certain characters require escape codes, mainly the pound/hash (as
\#
) and the backslash (as\\
). Quotes are not required around string arguments, so they will be part of the value sent to the engine as literal quote characters. At this time, only standard ASCII printable characters are supported, namely exclamation point (x21, '!') through tilde (x7E, '~'). - Tile: Positive integer from 0 to 719. May be followed immediately (no spaces in between) by an
H
, aV
or both. The letters indicated how the tile is to be flipped. Examples:1
is tile 1 with no flipping;2H
is tile 2 flipped horizontally;3V
is tile 3 flipped vertically;4HV
is tile 4 flipped both horizontally and vertically. - Sprite: Like a Tile, but is based on sprite frame indices, which range from 0 to 511. May also be suffixed with
H
and/orV
for flipping. - Identifier: String (with no whitespace) that identifies an entity in the game, such as a menu, tool, inventory item or state variable. May contain letters, numbers and special characters other than pound/hash (
#
).
The pound/hash (#
) character is used to mark comments. Any text after this character will be ignored, unless it appears as an escaped character in a string value (as \#
).
Examples:
Line | Effect |
---|---|
#text 1 Never to be seen |
Nothing -- effectively a blank line |
text 1 Hello, World!# comment |
Will print Hello, World! |
text 1 So \#relatable # being trendy |
Will print So #relatable |
Skip to Main File keys:
title | author | palette |
---|---|---|
tiles_hex | sprites_hex | menu_xci |
title_screen | init_cursor | zone |
Skip to Menu File keys:
Skip to Title Screen File keys:
duration | bitmap | music |
---|---|---|
sprite_frames | sprite | tiles |
wait | sprite_move | sprite_hide |
Skip to Inventory File keys:
inv_dim | inv_item_dim | inv_empty | inv_left_margin |
---|---|---|---|
inv_right_margin | inv_quant | inv_quant_margin | inv_scroll |
inv_scroll_margin | inv_item |
Skip to Zone File key:
level | tiles_hex | sprites_hex |
---|
Skip to Level File keys:
Defines the title of the game. Should contain version number or something to uniquely identify revision of the configuration to ensure that only compatible saved games are loaded.
Usage:
title [text]
Argument | Type | Range | Meaning |
---|---|---|---|
text | String | 1-255 characters, including spaces after concatenation | Title of game |
Found in:
Defines the author of the game. Like title, is used to verify compatibility of saved game files.
Usage:
author [text]
Argument | Type | Range | Meaning |
---|---|---|---|
text | String | 1-255 characters, including spaces after concatenation | Author of game |
Found in:
Defines the filename for the Palette Hex File.
Usage:
palette filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-991 characters | Filename for palette hex file |
Found in:
Defines the filename for the Tiles Hex File.
Usage:
tiles_hex filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-989 characters | Filename for tiles hex file |
Found in:
Defines the filename for the Sprites Hex File.
Usage:
sprites_hex filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-988 characters | Filename for sprites hex file |
Found in:
Defines the filename for the Menu File.
Usage:
menu_xci filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-991 characters | Filename for menu file |
Found in:
Defines the filename for the Title Screen File.
Usage:
title_screen filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-987 characters | Filename for title screen file |
Found in:
Defines the sprite frame index for the initial and default mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
init_cursor index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-511 | Sprite frame index for mouse cursor |
Found in:
Defines the filename of a Zone File. Each zone will be indexed (starting with zero) based on the order in which the zones are defined.
Usage:
zone filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-995 characters | Filename for a zone file |
Found in:
Defines the default palette index to use for the menu character background color.
Usage:
menu_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the default palette index to use for the menu character foreground color.
Usage:
menu_fg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the tile to use for the left corner of the menu bar. It will use the default palette.
Usage:
menu_lc tile
Argument | Type | Range | Meaning |
---|---|---|---|
tile | Tile | Any [1] | Tile for left corner of the menu bar |
Found in:
Defines the tile to use for blank spaces in the menu. It will use the default palette.
Usage:
menu_sp tile
Argument | Type | Range | Meaning |
---|---|---|---|
tile | Tile | Any [1] | Tile for blank spaces in the menu. |
Found in:
Defines the tile to use for the right corner of the menu bar. It will use the default palette.
Usage:
menu_rc tile
Argument | Type | Range | Meaning |
---|---|---|---|
tile | Tile | Any [1] | Tile for right corner of the menu bar |
Found in:
Defines the tile to use for dividers in the menu. It will use the default palette.
Usage:
menu_div tile
Argument | Type | Range | Meaning |
---|---|---|---|
tile | Tile | Any [1] | Tile for dividers in the menu. |
Found in:
Defines the tile to use for checked checkboxes in the menu. It will use the default palette.
Usage:
menu_check tile
Argument | Type | Range | Meaning |
---|---|---|---|
tile | Tile | Any [1] | Tile for checked checkboxes in the menu. |
Found in:
Defines the tile to use for unchecked checkboxes in the menu. It will use the default palette.
Usage:
menu_uncheck tile
Argument | Type | Range | Meaning |
---|---|---|---|
tile | Tile | Any [1] | Tile for unchecked checkboxes in the menu. |
Found in:
Defines a menu header string.
Usage:
menu header
Argument | Type | Range | Meaning |
---|---|---|---|
header | String | 1-16 characters | Menu header string |
Found in:
Places a menu item in a menu.
Usage:
menu_item name
Argument | Type | Range | Meaning |
---|---|---|---|
name | Identifier | new , load , save , saveas , exit , music , sfx , controls , about , div |
Name of item to be placed in menu. |
Found in:
Defines the filename for the Controls File.
Usage:
controls filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-987 characters | Filename for controls file |
Found in:
Defines the filename for the About File.
Usage:
about filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-987 characters | Filename for about file |
Found in:
Defines the background color of text style 1, based on the default palette.
Usage:
text1_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the foreground color of text style 1, based on the default palette.
Usage:
text1_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the background color of text style 2, based on the default palette.
Usage:
text2_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the foreground color of text style 2, based on the default palette.
Usage:
text2_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the background color of text style 3, based on the default palette.
Usage:
text3_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the foreground color of text style 3, based on the default palette.
Usage:
text3_bg index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-15 | Palette index |
Found in:
Defines the dimensions of the toolbar, measured in tiles.
Usage:
tb_dim width height
Argument | Type | Range | Meaning |
---|---|---|---|
width | Integer | 1-40 | Width of toolbar, in tiles |
height | Integer | 1-4 | Height of toolbar, in tiles |
Found in:
Places a tool in the toolbar.
Usage:
tool name
Argument | Type | Range | Meaning |
---|---|---|---|
name | Identifier | inventory , walk , run , look , use , talk , strike , pin |
Name of tool to be placed in toolbar. |
Found in:
Defines the tiles for a button in the toolbar. Number of tiles defined must be evenly divisible by toolbar height.
Usage:
tool_tiles [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
tiles | Tile | 1-160 tiles[1] | Tile map for toolbar button |
Found in:
Defines the filename for the Inventory File.
Usage:
inventory filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-987 characters | Filename for inventory file |
Found in:
Defines the sprite frame index for the "walk" mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
walk index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-255[1] | Sprite frame index for mouse cursor |
Found in:
Defines the sprite frame index for the "run" mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
run index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-255[1] | Sprite frame index for mouse cursor |
Found in:
Defines the sprite frame index for the "look" mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
look index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-255[1] | Sprite frame index for mouse cursor |
Found in:
Defines the sprite frame index for the "use" mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
use index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-255[1] | Sprite frame index for mouse cursor |
Found in:
Defines the sprite frame index for the "talk" mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
talk index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-255[1] | Sprite frame index for mouse cursor |
Found in:
Defines the sprite frame index for the "strike" mouse cursor. Note: mouse cursor sprites cannot be flipped.
Usage:
strike index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 0-255[1] | Sprite frame index for mouse cursor |
Found in:
Defines the duration of the title screen animation.
Usage:
duration time
Argument | Type | Range | Meaning |
---|---|---|---|
time | Integer | 0-65535 | Duration of title screen, in jiffys (60 jiffys = 1 second) |
Found in:
Defines the filename of the raw data bitmap file to convert for loading into the background layer.
Usage:
bitmap filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-993 characters | Filename for bitmap file |
Found in:
Defines the filename of the VGM file to convert for playing background music.
Usage:
music filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-993 characters | Filename for bitmap file |
Found in:
Defines the sequence of frames that a sprite lopos through while moving.
Usage:
sprite_frames index offset [frames]
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 1-127 | Sprite index |
offset | Integer | 0-15 | Color palette offset |
frames | Sprite | 1-31 sprite frames | Sprite frame sequence |
Found in:
Displays a sprite at a specified position.
Usage:
sprite index x y
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 1-127 | Sprite index |
x | Integer | 0-319 | Screen position x-coordinate, in pixels |
y | Integer | Title Screen: 0-239; Level: 8-207 | Screen position y-coordinate, in pixels |
Found in:
Displays a row of tiles at a specified position.
Usage:
tiles offset x y [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
offset | Integer | 0-15 | Color palette offset |
x | Integer | 0-39 | Screen position x-coordinate, in tiles |
y | Integer | Title Screen: 0-29; Level: 1-25 | Screen position y-coordinate, in tiles |
tiles | Tile | 1-40 tiles | Tiles to display, from left to right |
Found in:
Delays execution of the next animation instruction until the specified time has elapsed.
Usage:
wait time
Argument | Type | Range | Meaning |
---|---|---|---|
time | Integer | 0-255 | Duration of delay, in jiffys (60 jiffys = 1 second) |
Found in:
Moves sprite from current position.
Usage:
sprite_move index delay steps x y
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 1-127 | Sprite index |
delay | Integer | 1-255 | Delay between steps, in jiffys (60 jiffys = 1 second) |
steps | Integer | 1-255 | Number of steps to move |
x | Integer | -128-127 | Number of pixels to move to the right (or left, if negative) for each step |
y | Integer | -128-127 | Number of pixels to move down (or up, if negative) for each step |
Found in:
Defines the dimensions of the inventory control, measured in tiles.
Usage:
inv_dim width height
Argument | Type | Range | Meaning |
---|---|---|---|
width | Integer | 1-40 | Width of inventory control, in tiles |
height | Integer | 1-4 | Height of inventory control, in tiles |
Found in:
Defines the dimensions of an inventory item button, measured in tiles.
Usage:
inv_item_dim width height
Argument | Type | Range | Meaning |
---|---|---|---|
width | Integer | 1-39 | Width of inventory item button, in tiles |
height | Integer | 1-4 | Height of inventory item button, in tiles |
Found in:
Defines the tilemap for an empty inventory item button.
Usage:
inv_empty [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
tiles | Tile | Number of tiles specified by inv_item_dim[1] | Tilemap for empty item button, rows going down |
Found in:
Defines a row of tiles to display to the left of each inventory item button.
Usage:
inv_empty [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
tiles | Tile | 1-38[1] | Tiles to display, from left to right |
Found in:
Defines a row of tiles to display to the right of each inventory item button.
Usage:
inv_empty [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
tiles | Tile | 1-38 tiles[1] | Tiles to display, from left to right |
Found in:
Defines the appearance of inventory item quantities.
Usage:
inv_quant style width
Argument | Type | Range | Meaning |
---|---|---|---|
style | Integer | 0-3 | Text style for quantity display (0 = menu style) |
width | Integer | 1-5 | Width of quantity display in digits/tiles |
Found in:
Defines the tiles to display above the inventory item quantity box if the item button is taller than 1 tile. May be a single tile or sequence that repeats for the width of the quantity display.
Usage:
inv_quant_margin [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
tiles | Tile | 1-5 tiles[1] | Tiles to display, from left to right |
Found in:
Defines the inventory scrollbar tiles.
Usage:
inv_scroll up middle down
Argument | Type | Range | Meaning |
---|---|---|---|
up | Tile | Any [1] | Tile for scroll-up button |
middle | Tile | Any [1] | Tile to fill in column between scroll buttons |
down | Tile | Any [1] | Tile for scroll-down button |
Found in:
Defines the tiles to display to the left of the inventory scrollbar.
Usage:
inv_scroll_margin [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
tiles | Tile | 1-38 tiles[1] | Tiles to display, from left to right |
Found in:
Defines an inventory item, its initial and potential quantity, its mouse cursor frame (cannot be flipped) and its button tile map.
Usage:
inv_item name init max cursor [tiles]
Argument | Type | Range | Meaning |
---|---|---|---|
name | Identifier | Unique item name | Name of item to be used in item_trigger and get_item arguments |
init | Integer | 0-65535 | Initial quantity of item |
max | Integer | 1-65535 | Maximum quantity of item |
cursor | Integer | 0-255[1] | Item cursor frame |
tiles | Tile | Number of tiles specified by inv_item_dim[1] | Tilemap for item button, rows going down |
Found in:
Defines the filename for a Level File. Each level will be indexed (starting with zero) based on the order in which the levels are defined.
Usage:
level filename
Argument | Type | Range | Meaning |
---|---|---|---|
filename | String | 1-995 characters | Filename for a level file |
Found in:
Marks the end of an animation sequence that began with init, first, tool_trigger or item_trigger.
Usage:
end_anim
No arguments.
Found in:
Stops displaying a sprite.
Usage:
sprite_hide index
Argument | Type | Range | Meaning |
---|---|---|---|
index | Integer | 1-127 | Sprite index |
Found in:
Marks the beginning of an animation sequence that will always be played first when a level is loaded.
Usage:
init
No arguments.
Found in:
Marks the beginning of an animation sequence that will only be played when a level is loaded for the first time. Will be played immediately after the init sequence, if defined, otherwise is played first upon loading.
Usage:
first
No arguments.
Found in:
Prints a line of text to the text area at the current line. Scrolls the text area up one line before printing if the current line is past the bottom.
Usage:
text style [line]
Argument | Type | Range | Meaning |
---|---|---|---|
style | Integer | 0-3 | Text style for this line (0 = menu style) |
line | String | 1-38 characters, including spaces after concatenation | Line to print |
Found in:
Scrolls the text area up by the specified number of lines.
Usage:
scroll lines
Argument | Type | Range | Meaning |
---|---|---|---|
lines | Integer | 1-4 | Number of text area lines to scroll up |
Found in:
Skips a line in the text area, moving the current line down to the next line. Scrolls the text area up one line if the current line is past the bottom.
Usage:
line
No arguments.
Found in:
Clears the text area and resets the current line to the top.
Usage:
clear
No arguments.
Found in:
Loads a new level.
Usage:
go_level zone level
Argument | Type | Range | Meaning |
---|---|---|---|
zone | Integer | 0-255 | Zone index |
level | Integer | 0-9 | Level index |
Found in:
Begins an animation sequence triggered by applying a tool to a location within a rectangle of tile squares.
Usage:
tool_trigger tool x1 y1 x2 y2
Argument | Type | Range | Meaning |
---|---|---|---|
tool | Identifier | walk , run , look , use , talk , strike |
Tool that triggers the sequence |
x1 | Integer | 0-39 | Minimum tile square x-coordinate |
y1 | Integer | 1-25 | Minimum tile square y-coordinate |
x2 | Integer | 0-39 | Maximum tile square x-coordinate |
y2 | Integer | 1-25 | Maximum tile square y-coordinate |
Found in:
Begins an animation sequence triggered by applying an inventory item to a location within a rectangle of tile squares.
Usage:
item_trigger item requirement cost x1 y1 x2 y2
Argument | Type | Range | Meaning |
---|---|---|---|
item | Identifier | Any name defined by an inv_item key in the Inventory File | Item that triggers the sequence |
requirement | Integer | 1-65535 | Quantity of item required to trigger sequence |
cost | Integer | 0-65535, must be no greater than requirement | Quantity of item to be debited from inventory after sequence |
x1 | Integer | 0-39 | Minimum tile square x-coordinate |
y1 | Integer | 1-25 | Minimum tile square y-coordinate |
x2 | Integer | 0-39 | Maximum tile square x-coordinate |
y2 | Integer | 1-25 | Maximum tile square y-coordinate |
Found in:
Begins a sub-sequence that will only be executed if the specified state is true.
Usage:
if state
Argument | Type | Range | Meaning |
---|---|---|---|
state | Identifier | Any | State to test for true. If not previously defined, will be initialized to false and sub-sequence will not be executed |
Found in:
Begins a sub-sequence that will only be executed if the specified state is false.
Usage:
if state
Argument | Type | Range | Meaning |
---|---|---|---|
state | Identifier | Any | State to test for false. If not previously defined, will be initialized to false and sub-sequence will be executed |
Found in:
Ends a sub-sequence that began with if or if_not.
Usage:
end_if
No arguments.
Found in:
Sets a state to true.
Usage:
set_state state
Argument | Type | Range | Meaning |
---|---|---|---|
state | Identifier | Any | State to set to true |
Found in:
Sets a state to false.
Usage:
clear_state state
Argument | Type | Range | Meaning |
---|---|---|---|
state | Identifier | Any | State to set to false |
Found in:
Adds a quantity of an item to the inventory.
Usage:
get_item item quantity
Argument | Type | Range | Meaning |
---|---|---|---|
item | Identifier | Any name defined by an inv_item key in the Inventory File | Item to add to inventory |
quantity | Integer | 1-65535 | Quantity of item to add |
Found in:
Defines an indentifier for a sound effect file to be used in play instructions.
Usage:
sound id filename
Argument | Type | Range | Meaning |
---|---|---|---|
id | Identifier | Unique sound effect ID for the level | ID to be used in play instructions |
filename | String | Valid filename | Filename of 4578 Hz 8-bit PCM mono sound effect |
Found in:
Plays a sound effect.
Usage:
play id
Argument | Type | Range | Meaning |
---|---|---|---|
id | Identifier | Sound effect ID defined for the level with a sound instruction | ID of sound effect to play |
Found in:
Tile and sprite indices higher than 255 are not guaranteed to be the same in every zone, so it is strongly recommended to use only indices 0 to 255 for any of these values. However, higher indices may be used (up to 703 for tiles or 498 for sprites) if the elements are interchangeable between zones, either by being identical or cleanly replaced (perhaps defining a user interface "theme" for a zone).