Wiki

Clone wiki

ultima-exodus / U3_Shapes_File_Format

There are several categories of shapes files in Ultima 3: map shapes, character sets, and moon icons.

Map Shapes

There are three files containing map tiles, two of which have been added by the U3 Upgrade.

  • SHAPES.ULT - CGA shapes
  • SHAPES.EGA - EGA shapes (U3 Upgrade)
  • SHAPES.VGA - VGA shapes (U3 Upgrade)

cga-shapes ega-shapes vga-shapes

There are 80 tiles in the file and each tile is 16x16 pixels. The only difference between each shapes file is the length of a pixel:

  • CGA - 2 bits (4 pixels per byte)
  • EGA - 4 bits (2 pixels per byte)
  • VGA - 8 bits (1 pixel per byte)

Each row of a tile is stored sequentially. For example, if we indexed each pixel in the file, it would be organized in the following pattern:

tile 0, row 0 - 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
tile 0, row 1 - 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
tile 0, row 2 - 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
tile 0, row 3 - 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
tile 0, row 4 - 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
tile 0, row 5 - 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
tile 0, row 6 - 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
tile 0, row 7 - 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
tile 1, row 0 - 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
tile 1, row 1 - 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
...

And so on. Since VGA has 1 pixel per byte, this is also the byte index into a VGA shapes file. The data is compacted in CGA and EGA because the size of each pixel is smaller.

The tiles and their description are as follows:

Index Description Animation
0 water Vertical scroll
1 grass
2 brush
3 forest
4 mountain
5 dungeon
6 town
7 castle
8 brick path
9 chest
10 horse
11 frigate
12 whirlpool Swap with tile 79
13 sea serpent
14 octopus
15 pirate frigate
16 merchant Tile index +48
17 jester Tile index +48
18 guard Tile index +48
19 lord british Tile index +48
20 fighter Tile index +48
21 cleric Tile index +48
22 mage Tile index +48
23 thief Tile index +48
24 orc Tile index +48
25 skeleton Tile index +48
26 ogre Tile index +48
27 demon Tile index +48
28 gazer Tile index +48
29 dragon Tile index +48
30 balrog Tile index +48
31 exodus
32 force field Vertical scroll
33 lava Vertical scroll
34 moongate CGA/EGA: Vertical scroll; VGA: color cycling
35 brick wall
36 black
37 space
38 A
39 B
40 C
41 D
42 E
43 F
44 G
45 H
46 I
47 V
48 Y
49 L
50 M
51 N
52 O
53 P
54 W
55 R
56 S
57 T
58-59 Great Earth Serpent
60 Magic Bolt
61 Damage
62 Shrine
63 Party Icon
64-78 Animation of tiles 16-30 Tile index -48
79 Animation of whirlpool Swap with tile 12

Character Sets

There are three files containing character sets, two of which have been added by the U3 Upgrade.

  • CHARSET.ULT - CGA character set
  • CHARSET.EGA - EGA character set (U3 Upgrade)
  • CHARSET.VGA - VGA character set (U3 Upgrade)

cga-charset ega-charset vga-charset

There are 128 tiles in the file and each tile is 8x8 pixels. Otherwise, the byte organization is largely the same as the map shapes files. (see above)

Each row of a tile is stored sequentially. For example, if we indexed each pixel in the file, it would be organized in the following pattern:

tile 0, row 0 - 00 01 02 03 04 05 06 07
tile 0, row 1 - 08 09 0A 0B 0C 0D 0E 0F
tile 0, row 2 - 10 11 12 13 14 15 16 17
tile 0, row 3 - 18 19 1A 1B 1C 1D 1E 1F
tile 0, row 4 - 20 21 22 23 24 25 26 27
tile 0, row 5 - 28 29 2A 2B 2C 2D 2E 2F
tile 0, row 6 - 30 31 32 33 34 35 36 37
tile 0, row 7 - 38 39 3A 3B 3C 3D 3E 3F
tile 1, row 0 - 40 41 42 43 44 45 46 47
tile 1, row 1 - 48 49 4A 4B 4C 4D 4E 4F
...

And so on.

Each tile index corresponds mostly to an MS-DOS character code with some exceptions as follows:

Index Description
0-6 dungeon tiles in the "peer gem" view
7-31,127 MS-DOS special characters
13-15 CHARSET.VGA only: replaced with a horizontal/vertical bars and a junction box for the enhanced blue game border
32-126 standard ASCII numbers, letters, and symbols

Moon Icons

There are three files containing moon icons, all of which have been added by the U3 Upgrade.

  • MOONS.ULT - CGA moon icons (U3 Upgrade)
  • MOONS.EGA - EGA moon icons (U3 Upgrade)
  • MOONS.VGA - VGA moon icons (U3 Upgrade)

cga-moons ega-moons vga-moons

There are 8 tiles in the file and each tile is 8x8 pixels. Otherwise, the byte organization is exactly the same as the charset files. (see above)

The U3 Upgrade added the MOONS.* files to store the moon phases that appear above the game window. Without the upgrade or with this feature disabled, the game uses characters 0-7 from the CHARSET.* files to display the moon phases.

Index Description Moon Number
0 Crescent waxing 1
1 1st quarter 2
2 Gibbous waxing 3
3 Full moon 4
4 Gibbous waning 5
5 3rd quarter 6
6 Crescent waning 7
7 New moon 0

Updated