Slow Motion Bug

From Custom Mario Kart
Jump to navigation Jump to search

Description

Like a PC, the Wii is a computer system with a set amount of memory (RAM) and CPU power. When it does not have enough RAM/CPU power to calculate what is rendered on screen, the action on screen (the frames per second or FPS) can slow down dramatically. The "Slow Motion Bug" can be caused many factors including model complexity, the number of objects rendered on screen, hi-res textures or a large quantity of textures. It really isn't a bug in the traditional sense, but a symptom of poor optimization and can indicate that the track author did not test the level thoroughly before release.

The slow down will be most noticeable when playing split-screen modes with computer drivers (bots) enabled on 150 CC mode. The effects are lessened if:

  • The computer drivers are disabled.
  • Playing 50 or 100 CCs.
  • Playing Single Player mode.
  • Playing online (no bots)
  • Playing 2 players online (no bots and FPS are set lower in this mode.)
  • Playing 2 player split-screen instead of 3 or 4 player mode.
Example Video
Slow Motion Bug

Fixing the Problem

There are three major things that may slow down a Custom Track. The first and most common problem is a model that is too complex. Here are some ways a model can be overly complex:

  • Model Has Many Lines
  • Model Has Many Faces
  • Model Is Too Large
  • Model Contains Too Many Textures

You can find problem areas by looking at your model in SZS Modifier with the wire frame view option enabled. To optimize your model, delete as many unnecessary lines/faces/textures in your model as you can. Simplify curves on your model by deleting intermediate lines on the curved surface. If you are using SketchUp to create your model, explode all components and curves. Components will cause duplicated textures to appear in your model's brres file, increasing its memory footprint. Likewise, check the mtl file for "#Distorted Textures." These are twisted or skewed copies of textures used in your level, usually used on a single face of the model. Reset the alignment of these textures on your model and re-export to eliminate the distorted duplicates. You can find the locations of these textures on your model by replacing the distorted texture with a brightly colored texture, such as lime green or neon orange, then loading the model in-game or in the BRRES Editor.

Reducing the resolution of textures can also help. For example, the area of a single 1024*1024 texture is equal to the area of 16 256x256 textures. The difference in-game between a hi-res texture and a low-res texture is often small enough to not be noticeable.

Additionally, creating a simplified collision model can help improve frame rates by reducing the number of calculations the CPU needs to make when players interact with the track.

If these steps only partially solve your problem, than your level might have too many items.

This may be caused by:

  • Too Many Items in the SZS
  • Too Many Items In Game
  • Unused items that are still rendered
  • Items with animations set to display in all game modes

The easy solution would be to remove all unnecessary items. This can be done with easily The KMP Modifier.

A dirty SZS can also contribute to slow FPS. This means is that the SZS has unnecessary files that are not being used in the level. These files are still loaded in memory even if they don't appear in-game.

To fix this, open up the SZS CTools, right click unnecessary items, and press "Delete".

Some items should only appear in single player mode, such as animated characters like piantas, flowers, and shy guy groups. In SZS Modifier's KMP Editor the final box will have a value like 0000003F. 3F means that object will appear in all game modes. Change it to 00000009 to disable those objects in split screen modes.

Reducing the number of faces

More faces than needed

Most custom tracks define faces from both sides. But for nearly all of the drivable faces (road, offroad, boost, water and some more) only face up triangles are needed. So the first possibility to reduce the number of faces is to remove all drivable face down triangles. In the the example on the right this may save 41 of the 82 triangles (90 triangles total).

Using face down roads has also another negative effect: If jumping down to the road the player touches sometimes the face down triangle and the vehicle will drive head down for a moment into a complete wrong direction. So it is a obligation to remove the face down triangles of drivable KCL types. Not only roads, but also walls are candidate for removing triangles.

The general rules are
  • Remove triangles (faces) that can never be seen. Do this for the visual model and also for the KCL.
  • Remove triangles from the KCL that can never reached.


Much less triangles

You can save much more triangles if you think 3D. See the the 3 picture at the right: green is grass, blue the road, yellow are boost and brown a small hill. In the first picture you see, that 49 triangles are used. It's because the developer thinks only in 2D an lays all triangles side by side.

And now let's take a look, how Nintendo did it for the newer tracks. They think 3D and define the grass level with only 2 triangles. Then they place a street 2-4 units higher and use again only a view triangles. And in a third level they place the boost parts. And the hill is also placed in the grass and may go below the grass.


A 3D view

In the third picture you see a 3D view of the second one. In picture 49 face up triangles are used and in the two others pictures only 19; this saves 61% triangles in this example. Nintendo raises the above levels about 2-4 units.


Known Tracks with Slow Down

Major problems
Minimal problems