Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.
Samuel Nicholas edited this page Feb 8, 2016 · 11 revisions

Justifications

Working with huge images eg 10kx10k upwards is pretty painful, so being able to process these piecemeal is handy.

The spring engine internally works with patches of diffuse texture 1024x1024 pixels in size.

The engine can practically handle map sizes of upto 32x32(16384x16384 px) and theoretically any size AFAIK.

These image sizes are awkward to work with, most of the time applications aren't built to deal with images this size and attempt to put the whole thing in RAM, not to mention make copies for undo levels, effects etc. With an RGBA8 image(32 bits per pixel), a 1024x1024 image is 4MB, a 32x32 map image is 1 gig, a 64x64 map is 4 gig, for just 4 channels, rendering apps have so many more passes they can output, so it quickly uses up all the RAM available.

smf_info

Is used primarily to test whether an smf file is valid, and to output information about the file.

USAGE: smf_info <smf file> 
  eg. 'smf_info myfile.smf'

  -h,  --help   Print usage and exit.
  -q,  --quiet  Supress output, except warnings and errors

smf_cc

smf_cc generates an smf file given the input parameters. its pretty simple really. Hopefully in the future it will be completely unnecessary.

USAGE: smf_cc [options] [smt1 ... smtn]

eg. $ smf_cc -v -o mymap.smf --mapsize 8x8 --height height.tif \ 
    > --mini minimap.jpeg --metal metalmap.png --grass grass.png mymap.smt 

GENERAL OPTIONS:
  -h,  --help             Print usage and exit.
  -v,  --verbose          Print extra information.
  -q,  --quiet            Supress output.
  -o,  --output=mymap.smf File to operate on, will create if it doesnt exist
  -f,  --force            Overwrite existing output files
       --mapsize=XxZ      Width and length of map, in spring map units eg.
                          '--mapsize=4x4',must be multiples of two.
       --tilesize=X       Size of tiles, in pixels eg. '--tilesize=32',must be
                          multiples of 4.
  -y,  --floor=1.0f       Minimum height of the map.
  -Y,  --ceiling=1.0f     Maximum height of the map.
       --height=height.tif(x*64+1)x(y*64+1):1 UINT16 Image to use for heightmap.
       --type=type.tif    (x*32)x(y*32):1 UINT8 Image to use for typemap.
       --tilemap=map.tif  (x*16)x(y*16):1 UINT32 Image or CSV to use for
                          tilemap.
       --mini=mini.tif    (1024)x(1024):4 UINT8 Image to use for minimap.
       --metal=metal.tif  (x*32)x(y*32):1 UINT8 Image to use for metalmap.
       --features=list.csvList of features with format:
                          NAME,X,Y,Z,R,S
       --grass=grass.tif  (x*16)x(y*16):1 UINT8 Image to use for grassmap.

smf_decc

Extracts all the information from the file into human readable, or application editable files.

USAGE: smf_decc <smf file>
  eg. 'smf_decc myfile.smf'

  -h,  --help     Print usage and exit.
  -v,  --verbose  MOAR output.
  -q,  --quiet    Supress Output.

smt_info

Is used primarily to test whether an smt file is valid, and to output information about the file.

USAGE: smtinfo <smt file> 
  eg. 'smtinfo myfile.smt'

  -h,  --help   Print usage and exit.
  -q,  --quiet  Supress output, except warnings and errors

smt_convert

smt_convert takes a 'set of images'+'a map'(how to arrange the images), and converts it into a 'set of images'+'a map'. wait.. what?

In practical terms

The input image sources can be either smt files or anything that OpenImageIO can handle, and the export can be an smt file or tif images.

The input may be:

  • a single image, and the map implicitly refers only to the single image.
  • images which make up a large image and the map implicit in that they are arranged consecutively
  • a set of image tiles, and the map a specifying how to arrange them.

the output may be:

  • a single image
  • a set of images, and a map with consecutive numbering
  • a set of images, and a map specifying how to arrange them

The process in-between basically looks at what area of the source reconstructed image to export, copies the data from the relevant input images into a new image, scales it to the appropriate size, and then exports it.

Practical usage scenario's

  • I have a large rendered image I want to turn into an smt for use with smf
  • I have a series of images I want to turn into an smt for use with smf
  • I have an existing smf+smt map and I want to scale it up/down in size
  • I have a tile based map generated from a program like Tiled and I want to turn it into an smf+smt
USAGE: smt_convert [options] <source1> [source2...sourceN]> 
  eg. 'smt_convert -o myfile.smt tilesource1.smt tilesource2.jpg'

OPTIONS:
  -h,  --help                         Print usage and exit.
  -v   --verbose                      Print extra information.
  -q   --quiet                        Suppress print output.
  -o   --output <filename>            Filename to save as, default is output.smt
  -f   --force                        Overwrite files with the same output name
  -f   --filter=1,2-n                 Filter input tile sources to only these
                                      values, filter syntax is in the form
                                      1,2,3,n and 1-5,n-n and can be mixed,
                                      1-300,350,400-900
  -t   --tilemap=[.csv,.smf]          Reconstruction tilemap.
       --imagesize=XxY                Scale the constructed image to this size
                                      before splitting.
  -s   --tilesize=XxY                 Split the constructed image into tiles of
                                      this size.
       --overlap=0                    consider that pixel values overlap by this
                                      amount.
       --smt                          Save tiles to smt file
       --img                          Save tiles as images
  -d   --dupli=[None,Exact,Perceptual]default=Exact, whether to detect and omit
                                      duplcates.
       --type=[DXT1,RGBA8,USHORT]     default=DXT1, what format to put into the
                                      smt

smt_repair

I cant remember what this does :|

USAGE: smt_cc [options] [source files] 
  eg. 'smt_cc -v -f mysmt.smt *.jpg'

GENERAL OPTIONS:
  -h,  --help               Print usage and exit.
  -v,  --verbose            Print extra information.
  -q,  --quiet              Supress output.
  -f,  --force              overwrite existing files.
  -f,  --file=filename.smt  file to operate on, will be created if it doesnt
                            exist.

EXAMPLES:
  smt_cc 

Clone this wiki locally