prevnext   » SZS: Wiimms SZS Toolset » wszst: Wiimms SZS Tool » wszst minimap

wszst minimap

Print minimap data (more exact: the visual field of the minimap) of a SZS, U8, BRRES or MDL file. If patching options are used, modify the data and write back the file using its original file format. Only the translation vector is modified and new translation and inverse matrices are calculated. Wildcards and pipe characters are parsed.

Contents

1.   Syntax

wszst MINIMAP [source]...

2.   Options

Options
Option Param Description
--no-wildcards Disable wildcard parsing and use each filename exactly as specified.
--in-order Process the input files in order of the command line and don't delete duplicates.
-i --ignore Ignore non existing source files without warning.
-l --long If set, print the matrices too. If set twice, print minimum and maximum values too.
-r --remove-dest Remove already existing files before creating it. If set, --overwrite is ignored. --rm-dest is a short cut.
-p --preserve Preserve file times (atime+mtime) while converting or copying files.
-C --compr level Define a compression level between 0..9: 0 (or NOCHUNKS) disables finding chunks, 1 (or FAST) for the fastest standard compression and 9 (or BEST) for the best (=default) compression. 10 (or ULTRA) and 100-150 are special time-consuming compression modes. They are dedicated to competitions with size limitations. The special value UNCOMPRESSED acts like option --no-compress.

Because of many repeated data, the best bz-compression mode varies. Therefor the levels TRY2..TRY5 (or short T2..T5) are defined to find the best compression mode with testing the first N modes of 9, 1, 8, 2, 5. TRY2 is used for normalizing. For non bz-compression, TRY* are the same as BEST.

Do not use compression level >6 for LZMA if the file is intended for Mario Kart Wii, as too much memory is required for decoding.

Option --norm takes precedence over --compr and sets the compression level for bzip2 to TRY2 (BEST) and for LZMA to 6.

For more modes and details type wszst -C list. To force colorized output type wszst -C clist.

-n --norm The uncompressed data will be normalized. See command NORMALIZE for more details.
--align-u8 size Define an align value for the sub files in U8 archives. The value must be a power of 2 and the default value is 32 (0x20) This value is only relevant if creating or normalizing U8 archives.
--align-lta size Define an align value for the sub files in LTA archives. The value must be a power of 2 and the default value is 32 (0x20) This value is only relevant if creating LTA archives.
--align-pack size Define an align value for the sub files in PACK archives. The value must be a power of 2 and the default value is 32 (0x20) This value is only relevant if creating or normalizing OACK archives.
--align-brres size Define an align value for the sub files in BRRES archives. The value must be a power of 2 and the default value is 4 This value is only relevant if creating or normalizing BRRES archives.
--align-breff size Define an align value for the sub files in BREFF archives. The value must be a power of 2 and the default value is 4 This value is only relevant if creating or normalizing BREFF archives.
--align-breft size Define an align value for the sub files in BREFT archives. The value must be a power of 2 and the default value is 0x20 This value is only relevant if creating or normalizing BREFT archives.
--align size Define an align value for the sub files in all archives. This is a short cut for --align-u8=size {--align-lta=size --align-pack=size --align-brres=size --align-breff=size --align-breft=size.
--pt-dir [=mode] Set one of the `point directory' modes REMOVE (=0), FORCE (=1) or AUTO (default). If --pt-dir is used without parameter, then FORCE is assumed.

This option is only relevant if creating an U8 archive. It decides, if a special directory with name '.' will be added as base for all other files.

--rm-aiparam Remove the directory AIParam and all files from the archive. This option has only impact, if creating a new archive or normalizing an existing archive. --rmai is a short cut.
--auto-add Analyze the KMP (if exist) and add missing BRRES, BREFF, BREFT, BRASD and KCL files automatically, if the tool can find the files in any sub directory named 'auto-add'. This sub directory is searched in all directories of 'SEARCH_PATH'; use command wszst AUTOADD to view them. Command wszst AUTOADD may also create an auto-add database. --aadd is a short cut.
--fast Short cut for --compr=fast: Set the fastest real compression. It also overrides compression rates set by --norm or --compr.
-c --const list Define constant values, that are used by the internal encoders and by the numeric options as predefined global variables. This option allows a conditional encoding of text files. It can be used multiple times for multiple definitions.

The parameter is a comma separated list of terms and a term is 'name=expression'. The expression is calculated by the text parser.

--touch Mark the minimap as modified to force a new calculation of the translation and inverse matrices.
--auto Calculate the minimap translations automatically by using the minimum and maximum vertex coordinates. The 'scale' and 'rotation' fields are reset. This is done as first action before the SET, CENTER and the other transformations.
--set-flags flag Define the flag values (default 0x31f) of the minimap.
--set-scale vector Define the scale values (default 1.0) of the minimap. The parameter is either a vector expression or a comma separated list of coordinates ('x,z' or 'x,y,z').
--set-rot vector Define the rotation values (default 0.0) of the minimap. The parameter is either a vector expression or a comma separated list of coordinates ('x,z' or 'x,y,z').
--set-x v1[,v2] Define 2 values and sort them to define the minimum and maximum x-coordinates of the minimap. If 'v2' is not entered, '-v1' is used as second value.
--set-y v1[,v2] Define 2 values and sort them to define the minimum and maximum y-coordinates of the minimap. If 'v2' is not entered, '-v1' is used as second value.
--set-z v1[,v2] Define 2 values and sort them to define the minimum and maximum z-coordinates of the minimap. If 'v2' is not entered, '-v1' is used as second value.
--xcenter Center the minimap in x-direction. This is done after AUTO and SET, but before SCALE and SHIFT.
--ycenter Center the minimap in y-direction. This is done after AUTO and SET, but before SCALE and SHIFT.
--zcenter Center the minimap in z-direction. This is done after AUTO and SET, but before SCALE and SHIFT.
--center Center the minimap in all 3 directions. This is a short cut for --xcenter --ycenter --zcenter.
--scale vector[@origin] Transform the data: Scale all coordinates and size values by 'vector' relative to the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Negative values mirror the coordinates. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.

--shift vector Transform the data: Add 'vector' to all coordinates. It's simlar to --translate, but the addition is done before rotation. The parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.

--xss x1old,x1new,x2old,x2new --xss (x-scale-shift) calculates the X values of --scale and --shift, so that old values are transformed to the new values. The parameters are numbers or expression.
--yss y1old,y1new,y2old,y2new --yss (y-scale-shift) calculates the Y values of --scale and --shift, so that old values are transformed to the new values. The parameters are numbers or expression.
--zss z1old,z1new,z2old,z2new --zss (z-scale-shift) calculates the Z values of --scale and --shift, so that old values are transformed to the new values. The parameters are numbers or expression.
--rot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' (is a vector) around the 3 axes. All 3 axes goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,y,z').

Option --rot is an alternative for --xrot, --yrot and --zrot to define all 3 rotations in one step. Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--xrot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the x-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('y,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--yrot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the x-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead. This is a horizontal counterclockwise rotation and the old option name --hrot can also used.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--zrot degree[@origin] Transform the data: Rotate all coordinates and rotation values by the angle 'degree' around the z-axis, that goes through the point 'origin'. If the origin is not set, 0,0,0 is used instead.

Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,y' or 'x,y,z').

Transformations are calculated in the order SCALE, SHIFT, X-ROTATE, Y-ROTATE, Z-ROTATE, TRANSLATE.

--ypos pos This option defines an Y position for KMP:CKPT transformations. It has only impact to X and Z rotations (Options --xrot and --zrot). If not set, the mean y of the active rotation origins are used.
--translate vector Transform the data: Add 'vector' to all coordinates. It's simlar to --shift, but the addition is done after rotation. The parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). --trans is a short cut.

Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.

--null Create a neutral transformation without affecting the coordinates. The only influence is, that the dependent values (like maximum) are re-calculated as if a transformation has taken place.
--next Close the current transformation step with all scaling, shifting, rotation and translation options and open a new step with cleared options. On transformation each step is logical done one by one. In real, one total transformation matrix is calculated and used for fast transformations.

If option --next is used, the ability for modifying the scale and rotation vectors (not the positions) of different KMP sections is nearly always lost. A warning is printed if this occurs.

--ascale factor@dir Transform the data and do an axis scale: Close the current transformation step like --next and scale the data by 'factor' into the direction given by the vector 'dir'. Store the resulting matrix as single transformation step and open a new one.

This kind of transformation is EXPERIMENTAL!

--arot degree[@pos1]@pos2 Transform the data and do an axis rotation: Close the current transformation step like --next and rotate the data by 'degree' around the axis defined by the 2 points. If 'pos1' is not set, use 0,0,0 instead. Store the resulting matrix as single transformation step and open a new one.

This kind of transformation is EXPERIMENTAL!

--tform-script script Load the script and execute it by the text parser.

Then for each coordinate (2D and 3D), call the macro TRANSFORM after all other transformations. Call it without parameters and set variable $I with a zero based index of all vertices, variable $D to the dimension (2 or 3) and the variable $P to the vector of the current vertex. If the macro returns a vector, it is the new position.

For each file, macro BEGIN is called at the beginning and END after processing all points, but only, if the macros are defined. For END, variable $I is set to the number of processed vertices in the current file.

Before each macro call, the private and local variables are cleared and only global parameters are permanent. The zero based index is cleared for each new source. The parameters of the macro calls are defined in the local name space.

3.   Description

3.1   General usage

The minimap command views and manipulates the vectors of the MDL objects posLD and posRU. The general syntax is:
  wszst minimap [options] <FILE>..
If FILE is a MDL, posLD and posRU searched, viewed and modified. If FILE is a BRRES, a MDL named map is searched and used. If FILE is a SZS or U8 archive, a BRRES named map_model.brres is searched. So the more specific syntax is:
  wszst minimap [options] map.mdl
  wszst minimap [options] map_model.brres
  wszst minimap [options] track.szs

The options (see above) decide, which data is printed and how, if ever, the data is manipulated. If using the option --test (-t), the command tells only, what it would do.

Remember allways: The data defines the view region of the minimap. So larger values make the minimap smaller.

3.2   --auto

Calculate the minimap translations automatically by using the minimum and maximum vertex coordinates. The 'scale' and 'rotation' fields are reset. This is done as first action before the SET, CENTER and the other transformations.
The most important option of the minimap command is --auto. It analyses the vertex section of the MDL to find the minimum and maxium values of each coordinate. It ignores a vector completly, if it contains an illegal number or if any absolute coordinate is greater than 107, because these values seems to be really bad. The automatic adjusting is only possible, if all absolute minimum and maximum values are smaller than 106; usually all values are smaller than 105. This prohibits the automatic modification of unclear data.

If option --auto is set and possible, the following algorithm is used:

  1. The rotation, minimal and maxmial vectors of posLD and posRU (these are fields in the MDL data structure and not the calcualted values) are set to 0.0. The scale vectors are set to 1.0.
  2. The flags records of posLD and posRU are set to the value 0x31f.
  3. The Y coordinates of the translation vectors are set to 0.0. If the highest vertex is higher than 49000.0, than the Y coordinates are increased, so that the highest vertex is really visible.
  4. The minimum and maximum values of the X and Z coordinates are used as horizontal borders for the viewing region.
  5. The viewing region is enlarged first by 4% in both horizontal directions and then by absolute 100 points at all 4 horizontal borders. This is helpful to avoid cutting of the minimap.
  6. The X and Z coordinates of the translation vector of posLD and posRU are set to the calculated borders.
  7. All 3 coordinates are printed as »recommendation« in the command output.
  8. If at least one of the options (--set-scale --set-rot --set-x --set-y --set-z) is set, the related vectors are overwritten with the entered values.
  9. The other options (--center --scale --shift --xss ...) may modify the translation vector (but not the scale or rotation vectors) in the usual way. Remember, that the view region of the minimap is changed, not the minimap itself. So a scale factor of 1.25 will enlarge the view region to 125% with the effect, that the minimap is reduced to 80% (1/1.25=0.8).
  10. The transformation and the inverse matrices are calculated.

The general syntax using the auto option is:

  wszst minimap --auto  map.mdl
  wszst minimap --auto  map_model.brres
  wszst minimap --auto  track.szs
The last command is the easiest way to fix the minimap of a ready track.

3.3   --scale vector[@origin]

Transform the data: Scale all coordinates and size values by 'vector' relative to the point 'origin'. If the origin is not set, 0,0,0 is used instead. Negative values mirror the coordinates. Each parameter is either a vector expression or a comma separated expression list of coordinates ('x,z' or 'x,y,z'). Transformations are calculated in the order SCALE, SHIFT, ROTATE, TRANSLATE.
It is also possible, to scale down the minimap image, if it is to large. Use the option --scale factor to enlarge the view region.

Example:
The minimap should be 20% smaller. Therefor the view region must be enlarged by about 25% (see below). You can do this, by adding the option --scale 1.25:

  wszst minimap --auto --scale 1.25  map.mdl
  wszst minimap --auto --scale 1.25  map_model.brres
  wszst minimap --auto --scale 1.25  track.szs

Some mathematics: The scale factor 1.25 grows the view region by 25%. The visual effect is, thats the minimap is reduced to 1/1.25 = 0.8 = 80%. In general: If a minimap should be reduced to (and not about) N%, the exact scale factor is 100.0/N.

The option --scale is able to calculate expressions by itself:

  wszst minimap --auto --scale 100.0/N   track.szs  # general
  wszst minimap --auto --scale 100.0/80  track.szs  # 80%
Don't forget the .0 behind the 100 to force a floating point calculation. If writing 100/80, an integer calculation with 2 integer operands is done and the result is the integer 1.