Zerk Zone

Pages for the Creations of Ryan Armstrong

Xargon Mapper and Resource Extractor

Posted on December 11th, 2012 @ 7:55 pm by Zerker

About and Dependencies

This is a series of Python scripts to generate maps of Xargon, as well as extract most of the Xargon image resources. These scripts require the Python Imaging Library (PIL) and Python 2.x (tested with Python 2.7.3). PIL unfortunately does not yet support Python 3, which prevents these scripts from being forward-compatible at this time.

Windows users should be able to download Python and PIL from the above links. Most Linux/Unix varients should be able to install Python and PIL via your package manager of choice; Ubuntu users can install the python and python-imaging libraries. OSX users should already have Python, but you may need to compile PIL yourself via the source download at the PIL website.

The scripts also obviously require Xargon, either the shareware or full versions. The full version has been released as Freeware, so it should be easy for you to get what you need.

A full development log for this tool is available on the VGMaps Forums.
This tool was developed without the use of the Xargon source code by manually
decoding the game resources, so some of the techniques may be useful for decoding other games.

Please note the palimage#.png image files are used to obtain
the assorted Xargon colour paletted variations, and are required for
this tool to work.

Usage

There are two scripts included in the package that are intended to be executed directly.
xargonmapper.py is the main map generation script,
xargongraphics.py is a script to extract the contents of a Xargon GRAPHICS resource file. In addition to the three scripts above, several supplimentary scripts can be run to gather debug outputs of one form or another, and are listed under the Other Scripts heading.

The genep1.sh, genep2.sh and genep3.sh are pre-made shell scripts to generate map images for each episode of the game. You can edit these files to change the path to Xargon for alternate configurations. Sorry, no .BAT files are provided for Windows users, but the .sh files and the below instructions should get you going.

xargonmapper.py

Usage: python xargonmapper.py [Graphics File] [Tiles File] [Map File(s)…]

Generates map images for every Xargon map file indicated. Requires the
corresponding GRAPHICS file for the images to use, and the TILES file
for the map tile to graphics resource mapping. All files should be from
the same Episode of Xargon.

xargongraphics.py

Usage: python xargongraphics.py [Graphics File]

Extracts all graphics resources from the specified GRAPHICS file from
Xargon. Output is stored in the Episode#Images and
Episode#OriginalImages folders, where # is the episode number of the
input file. The OriginalImages folder contains the original 256-colour
images without any additional processing, while the Images folder
contains 32-bit RGBA images after colour index 0 has been set
transparent.

Other Scripts
xargonmap.py

Usage: python xargonmap.py [Map File(s)]

Generates the following debug information for each specified Xargon map
file:

[mapname]_flat.png
A false-colour image of the map, where each tile
value is represented as a different colour.
[mapname].csv
A simple CSV containing each tile value
[mapname]_info.csv
Auxiliary information about a map from the footer.
Contains all the unknown header-type information,
as well as the strings.
[mapname]_objs.csv
A full listing of all objects in the specified map,
and all their associated fields.
[mapname]_strings.csv
A listing of all the strings in the map, as well
as the guessed mapping to object reference
values.
xargontiles.py

Usage: python xargontiles.py [Tiles File]

Generates a debug CSV file for the mapping specified in the given
TILES file from Xargon. Output is written to tiles.csv.

xargonfontgen.py

Usage: python xargongraphics.py [Graphics File]

Generates BDF font files for the two identified fonts stored in the
Xargon GRAPHICS file. The BDF files can then be converted to .pil files
for use in the main mapper via the pilfont.py script. The BDF files can
also be used in any software that supports BDF.

Download

xargonmapper.tar.gz (194.2 kB)
xargonmapper.zip (212.6 kB)

Comments (2)

Filed under: Maps,Xargon |

2 Comments »

  1. Thank you Ryan for doing this. I appreciate all of the hard work you put into mapping my game.

    Comment by Allen Pilgrim — May 15, 2015 @ 12:18 am

  2. You’re welcome. It was my pleasure.

    Comment by Zerker — May 15, 2015 @ 3:55 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment