Ultima IV (PC)
File Types
.CON
: combat? (not explored yet).DNG
: dungeons (not explored yet).EGA
: graphics files, some have been extracted not all yet.TLK
: talk data.ULT
: town (and castle) data including map(s) but not talk data
Shapes
SHAPES.EGA
contains the tiles used by WORLD.MAP
and the *.ULT
town maps.
There are 256 tiles and each is 16 x 16 4-bit nibbles (i.e. 16 x 8 bytes)
The 16 possible colours from 4-bits represent the EGA palette.
See shapes.py for Python code to read SHAPES.EGA
.
World Map
The world map is 256 x 256 tiles but they aren't store that way on disk. Instead there are 8 x 8 1024-byte chunks each of 32 x 32 tiles.
The byte at offset (8 * chunk_row + chunk_col) * 1024 + (32 * row + col)
tells you the tile.
See world_map.py for Python code to read WORLD.MAP
.
(this is a 4096 x 4096 image)
Town Maps
There are 17 .ULT
files representing "towns" (which includes villages, castles and the two levels of Lord British's castle in separate files).
The first 1024 bytes of each of these files is the map. It is 32 x 32 bytes, each byte representing the tile from SHAPES.EGA
to use.
See Extracted Town Maps for extracted examples for the town of Britain.
See town_maps.py for Python code to read the map parts of these files and produce PNGs.
Talk Data
The .TLK
files contain the NPC conversation data for each location.
There are up to 16 talking NPCs in each location and each takes 288 bytes.
After the first three bytes (which I don't yet understand) are 12 zero-terminated strings.
Only the first 4 characters of a keyword matter.
- name
- pronoun
- response to LOOK
- response to JOB
- response to HEAL[TH]
- response to custom keyword 1
- response to custom keyword 2
- custom question they can ask you
- response if you say YES
- response if you say NO
- custom keyword 1
- custom keyword 2
See Extracted Talk Data for extracted examples for the town of Britain.
See town_talk.py for Python code to extract the talk information.
Other Town Data
The data after the first 1024 bytes in the .ULT
seems to describe the NPCs, their tiles, locations, and movement.
There seem to be up to 32 NPCs each described by 8 bytes:
tile1
, x_pos1
, y_pos1
, tile2
, x_pos2
, y_pos2
, move
, char_id
Other EGA Files
See ega.py for Python code to convert some of the RLE-encoded .EGA
files to PNGs.