-
Notifications
You must be signed in to change notification settings - Fork 1
GameData Format
Bitsy saves its gamedata in a text format. Usually this is stored in a <script>
tag inside your game's html
The file content is divided into objects, separated by blank lines.
The first line of the file is the opening dialog, it follows the rules for dialog data. If your opening dialog is complex, then the first line may be a triple quote """
and the dialog will be on multiple lines terminating with another triple quote. This is standard for complex dialog data.
Lines that begin with a hash (#
) are comments and normally ignored, but bitsy will expect to find a specific version comment after the opening dialog.
Write your game's title here.
# BITSY VERSION 8.0
Lines that begin with an exclamation are flags and are used to specify the format of the file. This can allow a newer bitsy engine to understand older gamedata formats
! VER_MAJ 8
! VER_MIN 0
! ROOM_FORMAT 1
! DLG_COMPAT 0
! TXT_MODE 0
DEFAULT_FONT
is an optional setting to indicate the name of the default font for dialogs. It will not normally be needed in the file if the game uses the standard ascii font
TEXT_DIRECTION
is an optional setting to indicate that dialog should be rendered from right to left
DEFAULT_FONT arabic
TEXT_DIRECTION RTL
Each palette in the game begins with a line that starts with PAL
. The palette data includes the colors that make up the palette and it's name.
PAL 0
0,82,204
128,159,255
255,255,255
NAME blueprint
Each room in the game begins with a line that starts with ROOM
. The room data includes which tiles are used for the room, the name of the room. Any items in the room. All the exits and endings in the room. The palette to use for the room. And since Bitsy 8, any alternative avatar to use in the room and any tune associated with the room.
ROOM 0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,a,a,a,a,a,a,a,a,a,a,a,a,a,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,b,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0
0,a,a,a,a,a,a,a,a,a,a,a,a,a,a,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
NAME example room
EXT 2,2 1 13,13
PAL 0
TUNE 1
Each tile begins with a line that starts with TIL
. The tile data includes the bitmap for the tile, possibly more than one if the tile is animated, the tile's name, the foreground and background colors, and whether or not this tile represents a wall.
TIL a
11111111
10000001
10000001
10011001
10011001
10000001
10000001
11111111
NAME block
Each sprite begins with a line that starts with SPR
. The sprite data includes the bitmap for the sprite, possibly more than one if the tile is animated; the sprite's name; the foreground and background colors; which room the sprite is in, and where in that room; any dialog and whether or not to play a blip.
The game will always contain a sprite with the id A
. This is the default avatar. The avatar's initial inventory is also stored in the sprite data.
SPR A
00011000
00011000
00011000
00111100
01111110
10111101
00100100
00100100
POS 0 4,4
Each item begins with a line that starts with ITM
. The item data includes the bitmap for the item, possibly more than one if the item is animated; the item's name; the foreground and background colors; any dialog and whether or not to play a blip.
ITM 0
00000000
00000000
00000000
00111100
01100100
00100100
00011000
00000000
NAME tea
DLG 1
Each dialog begins with a line that starts with DLG
. The dialog data contains the text and code of the dialog and a name.
DLG 0
I'm a cat
NAME cat dialog
Each variable begins with a line that starts with VAR
. The variable data includes the initial value for the variable.
VAR a
42
Each tune begins with a line that starts with TUNE
. The tune data contains the name of the tune, along with it's notes, instruments and tempo.
TUNE 1
0,l,0,l,0,0,l,0,0,l,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
KEY C,D,D#,F,G,G#,A# d,r,m,s,l
TMP FST
SQR P8 P4
ARP UP
Each blip begins with a line that starts with BLIP
. The blip data contains the name of the blip, along with it's note, volume profile instrument and speed.
BLIP 1
C#,E,G#
NAME pick up 1
ENV 112 100 4 123 101
BEAT 45 0
SQR P2
Each font begins with a line that starts with FONT
. The font data contains all of the characters of the font, and it's default size. Fonts may be stored in the gamedata itself, but they are more commonly stored in a separate <script>
tag.