asylum | nobrainer

nobrainer v0.06

nobrainer is a utility for extracting/storing !Asylum game data files. Usage:

nobrainer [<options>] [<infile>] [<outfile>]


  • -h , --help Output this help text and exit
  • -l Convert to/from Asylum level file (default) (H)
  • -b Convert to/from Asylum tiled background sprite (H)
  • -s Convert to/from FastSpr files (H)
  • -e Convert to/from compressed border files
  • -m Convert to/from a hammer file
  • -t Convert to the Asylum format
  • -f Convert from the Asylum format

If infile or outfile are '-', or not specified, standard input/output will be used. This may not work on Windows. On RISC OS, use C-type redirection and not the OS redirection (i.e. < foo instead of { < foo }). If you don't know what redirection is, don't worry - just don't use it ;)

Under RISC OS, -t / -f can be ommitted in order to automatically identify the conversion direction - if the input file is data then it will be assumed to be an Asylum file. Current output formats are sprite files (when converting from Asylum) and fastspr/data files (when converting to Asylum). Options marked (H) support automatic de-Hammering when converting from Asylum. At the moment hammer files can only be read, not generated. This isn't a problem though, as Asylum 2 accepts both compressed and uncompressed files. Only FSP1 format fast spr files can be read/written, but again this shouldn't be a problem as this is the only format Asylum uses.

Source code has been included for you to disect at will. Although this release has only been tested in RISC OS, and compiled under RISC OS GCC, it should work fine on other platforms should you need to use it. It is also 32bit compatible

In the docs directory you'll find some rough docs about the file formats Asylum uses. I made them while writing nobrainer, and that's all they were intended to be for. I thought I might as well release them, despite their untidy layouts.

Files you can fiddle with:

The below refers to the full versions of Asylum only - the file names will be different in the demos. I'll be making references to Asylum 1 and 2 - Asylum 2 is not the sequel to Asylum 1, it's just version number 2. To check for version 2, look at the bottom of the instructions file accessable from the iconbar menu (Or on more recent version 2's, the number in the info window).

Asylum level files:

Each level has its own main level file, 'Brain', and 8 sub levels to make up the neurons (Neurons.cell1 to Neurons.cell8). In Asylum 1, there is also the level !Asylum.Resources.Boardfile, which has been removed in version 2 since it doesn't do anything in game. The colours in the palette match up with the block numbers detailed in the 'blocks' file. The maximum level size used by Asylum is 256x256, but if you edit the wimpslot then you may be able to go higher. Levels themselves must have a width which is a multiple of 4.

Asylum background sprites:

These are the background images that make up the tiled background in game, and have a fixed size of 48x32 pixels. Each level has it's own main background file, 'backfile', and neuron backfile, Neurons.backfile. There is also an extra background file, !Asylum.Resources.Backfile, for Asylum 1 users - again, this doesn't do anything in game, so isn't there in Asylum 2.

Asylum aliens/blocks/bloke/chars/explo sprite files:

These are the Fast Sprite files that make up most of the ingame graphics. There is !Asylum.Resources.FSPBloke for player and miscellaneous sprites, !Asylum.Resources.FSPChars for the ingame fonts, and !Asylum.Resources.FSPExplo for the explosion sprites. Each level has its own set of sprites: FSPAliens for the creepy crawlies you'll come across, and FSPBlocks for the blocks the levels are made out of. When converted to Sprite files, they are named with the following convention - <number>_<x centre><y centre> where <number> is the sprite number, and <x centre> and <y centre> is the hex location of the centre of the sprite for use when plotting. The centre coordinates are specified using 2 digit hex, and 0,0 is the top-left corner of the sprite. The maximum size for the images is 256x256, and for Asylum they must be in mode 13 in order to work correctly in Asylum.

Asylum compressed background/edge sprite/border files:

There are only two of these - !Asylum.Resources.chatscreen for the border image used in the ingame menus, and !Asylum.Resources.GameScreen for the border image used in game, with the playing area 'frame', health bar, etc.

nobrainer notes:

  • Backup any files before modifying them - I provide no warranty!
  • No/few checks are made on the files, so don't try anything too strange, and as I say above, make a backup!
  • The obey files 'extract' and 'store' will extract and store all currently editable files to/from asylum (Apart from the extra files in Asylum 1). Stick them in a directory with a copy of nobrainer and click away!
  • The hammer code should cope OK with file overruns, but will produce extra output on underruns, which may cause problems with some of the converters. The ID cell7 supplied with Aslum 2 actually produces an overrun - I'm not sure if this will crash Asylum or not.
  • I've actually checked that the extracting and storing fully works this time - extracted all the files from Asylum 2, then stored them back, and the game worked fine (well, the Ego and Psyche levels did. Didn't try Id, or the neurons)
  • As of v0.05, the supplied executable is now 32bit compatible. The source code has also been tweaked to make it more likely to compile correctly on non-RISC OS machines (i.e. all 'ints' have been changed to 'longs' to ensure they are 32 bits long)
  • New stuff for v0.06 is code in C instead of C++ (since it was really just C anyway), better error messages, and fixes to the headers of the sprite files generated by the level & backfile converters (Although !Paint could load them fine, some programs couldn't).

Coming soon to nobrainer... (Honest!)

  • Hammer output
  • A few options to make it easier to use (i.e. appending to sprite files and only using the specified sprite from a file)
  • Perhaps a scoreboard file editor, should one be needed
  • Config file editor?
  • Music file editor?

Jeffrey Lee, 28/09/04

Asylum is © Andy Southgate 1993

Don't expect to get any nobrainer support from him, as he has nothing to do with it. If you get stuck then contact me and I'll see if I can help.

Valid XHTML 1.0! Valid CSS! Best viewed with any browser Rendered on RISC OS