Difference between revisions of "Track Transformation"

From Custom Mario Kart
Jump to navigation Jump to search
Line 11: Line 11:
 
For a complete track transformation you must at least transformate the positions (vertices) of the [[KMP]] (routes, positions, sizes and more), the [[KCL]] (collision file), the model (visible stuff) and the minimap. Additionally the ''vrcorn'' and other [[BRRES]] and [[KCL]] files can be transformed. The easiest way is to manipulate the vertex lists of the files and for KMP the positions.
 
For a complete track transformation you must at least transformate the positions (vertices) of the [[KMP]] (routes, positions, sizes and more), the [[KCL]] (collision file), the model (visible stuff) and the minimap. Additionally the ''vrcorn'' and other [[BRRES]] and [[KCL]] files can be transformed. The easiest way is to manipulate the vertex lists of the files and for KMP the positions.
  
Since version 1.17, [[Wiimms SZS Tools]] allow allow scaling and shifting the whole track and more. The tools allow also scaling with different factors for the 3 dimensions and rotating around all 3 axis. Last not least it allows mirroring by using negative scale values, but this may have different issues because of the culling.
+
Since version 1.17, [[Wiimms SZS Tools]] allow scaling and shifting the whole track and more. The tools allow also scaling with different factors for the 3 dimensions and rotating around all 3 axis. Last not least it allows mirroring by using negative scale values, but this may have different issues because of the culling.
  
 
After a transformation you must verify the track, especially the [[KMP]]. In general, the KMP transformations works good. Some hints:
 
After a transformation you must verify the track, especially the [[KMP]]. In general, the KMP transformations works good. Some hints:

Revision as of 22:57, 23 April 2013

This article describes, how to transform a complete track including KMP, KCL, Model, Minimap and vrcorn. Transformation is any combination of scaling in 3 dimensions, rotating around 3 axis, translation (shift in to any direction).



Introduction

The main ideas of a track transformation is to scale it (mostly down, sometimes up), because the track is to large or to small. Another reason is to change the height of the track over the ground, because the track is to near or to far away.

For a complete track transformation you must at least transformate the positions (vertices) of the KMP (routes, positions, sizes and more), the KCL (collision file), the model (visible stuff) and the minimap. Additionally the vrcorn and other BRRES and KCL files can be transformed. The easiest way is to manipulate the vertex lists of the files and for KMP the positions.

Since version 1.17, Wiimms SZS Tools allow scaling and shifting the whole track and more. The tools allow also scaling with different factors for the 3 dimensions and rotating around all 3 axis. Last not least it allows mirroring by using negative scale values, but this may have different issues because of the culling.

After a transformation you must verify the track, especially the KMP. In general, the KMP transformations works good. Some hints:

  • The KMP section CKPT has only 2 dimensional points. If rotating vertically by --xrot or --zrot, the placement of the checkpoints may be wrong. Try to set a good temporary y value using --ypos.
  • Item and enemy routes are normally good. Problems are narrow turns if scaling down.
  • Cameras and Objects seems to be to fast if scaling down.
  • Objects are scaled by the scaling factors. If scaling with different factors for each dimension, objects are deformed too. Some objects like itemboxes can't be scaled.
  • Verify the start position and the the respawn points.

Example

Let's start with a video example. In this example you see 6 transformed Nintendo tracks. Some tracks are only scaled and some tracks are deformed using different scaling factors for the 3 axis. You see, that KMP (routes, objects and more), KCL, course model, minimap and vrcorn transformed in the same way. The tracks are still playable.

6 transformed Nintendo tracks
6 transformed tracks
Time Slot Track Name Scaling Options
0:00 1.1 Luigi Circuit 60% --scale 0.6 --hrot 45
0:44 1.1 Luigi Circuit 100%,200%,50% --scale 1,2,0.5 --hrot 45
1:46 1.2 Moo Moo Meadows 70% --scale 0.7
2:31 2.3 DK Summit 70%, 150% vertical --scale 0.7,1.5,0.7
3:46 2.4 Wario's Gold Mine 70%, 200% vertical --scale 0.7,2,0.7
4:57 4.2 Moonview Highway 60% --scale 0.6

All tracks have been scaled by:

wszst patch TRACK.szs --patch-file +vrcorn --minimap MOREOPTIONS
wszst[1]
Tool to call.
patch[2]
COmmand for tool wszst.
TRACK.szs
The track file to patch.
Option --patch-file +vrcorn[3]
Default is to patch only the main KCL, main KMP, course_model.brres and map_model.brres. +vrcorn enables also the patching of vrcorn_model.brres.
Option --minimap[4]
Adjust the minimap view area after transformation.
MOREOPTIONS
Track specific options, see table above.

Using Wiimms SZS Tools

First, Wiimms SZS Tools are command line[5] tools. SO be sure to understand that concept before using the tools and asking for support.

The transformation is done for complete tracks files in the formats SZS, U8, WU8 or WBZ. Decompression and compression (SZS and WBZ), decoding and encoding (WU8 and WBZ) are done automatically and transparently. The command to use is »wszst patch«[2].

If you have a track file named CIRCUIT.szs and want to scale it down to 85%, use the command:

wszst patch --scale 0.85 CIRCUIT.szs

That's all. If you enter 3 different scaling values as comma separated list, you define different scaling factors for each axis. The following example scales the track horizontal to 90%, but vertically to 100% (unmodified):

wszst patch --scale 0.9,1,0.9 CIRCUIT.szs

You can for example also raise the track a little bit. Use the --shift or --translate options. Both options are similar: --shift is executed before any rotation and --translate behind. Again, enter 1 value for all 3 axis or 3 values for different parameters:

wszst patch --scale 0.85 --shift 0,1000,0 CIRCUIT.szs

If you want to rotate the track, add one or more of the options --xrot, --yrot or --zrot. For a horizontal counter clockwise rotation of 45 degrees, add --yrot 45:

wszst patch --scale 0.85 --shift 0,1000,0 --yrot 45 CIRCUIT.szs

Another good option is --minimap to automatically adjust the minimap position:

wszst patch --scale 0.85 --shift 0,1000,0 --yrot 45 --minimap CIRCUIT.szs

All transformation options and more details are described here:

Web-Links

Videos
Discussion
Software
References
  1. Wiimms SZS Tools, tool wszst
  2. 2.0 2.1 Wiimms SZS Tools, command PATCH
  3. Wiimms SZS Tools, option --patch-file
  4. Wiimms SZS Tools, option --minimap
  5. Wiimms SZS Tools, Command Line