Difference between revisions of "Slow Motion Bug"

From Custom Mario Kart
Jump to navigation Jump to search
m
 
(83 intermediate revisions by 18 users not shown)
Line 1: Line 1:
==Overview==
+
{{Bugs}}
Like a PC, the Wii is a computer system with a set amount of memory (''RAM''), processing (''CPU'') power, and graphics (''GPU'') power. When it does not have enough CPU or GPU power to calculate what is rendered on screen, the action on screen (the frames per second or ''FPS'') can slow down dramatically. While this technically isn't a bug in the traditional sense, it is a symptom of poor optimization and can indicate that the track author did not test the level thoroughly before release.
+
== Overview ==
 +
Like a PC, the [[Wii]] is a computer system with a set amount of memory (''RAM''), processing (''CPU'') power and graphics (''GPU'') power. When it does not have enough CPU or GPU power to calculate what is rendered on screen, the action on screen (the frames per second or ''FPS'') can slow down dramatically. While this is technically not a bug in the traditional sense, it is a symptom of poor optimization and can indicate that a track author did not test the track thoroughly before release.
  
{{youtube-box|bug|x7auiQJ6QtI|Six King Labyrinth Slow Motion Bug}}
+
{{youtube-box|bug|x7auiQJ6QtI|[[Six King Labyrinth]] Slow Motion Bug}}
  
==Types of Slowdown==
+
== Performance Monitor ==
 +
[[File:Performance Monitor Preview.png|thumb|right|Extended Performance Monitor by [[stebler]]]]
 +
Using the [https://mariokartwii.com/showthread.php?tid=1874 Performance Monitor] code or with [[LE-CODE]], you can find out accurately which component is being bottleneck. The blue bar represents how much time the GPU spent, the green bar represents draw calls and the red bar represents total frame time. To know which component is being bottleneck, check which bar is filling up the most. If it is just the red bar, then the console is being CPU bottleneck; if the blue bar is at the same amount as the red bar, then it is GPU bottleneck; if the green bar is large, then there is too many draw calls.
 +
 
 +
== Types of Slowdown ==
 
There are several different types of slowdown that can occur in-game, depending on the component(s) being bottlenecked.
 
There are several different types of slowdown that can occur in-game, depending on the component(s) being bottlenecked.
  
===CPU Bottleneck===
+
=== CPU Bottleneck ===
 
Symptoms:
 
Symptoms:
* Game slows down in 12 player online rooms.
+
* The game slows down in 12 player online rooms.
  
 
Causes:
 
Causes:
* An infinite loop is occurring in a KMP route.
+
* An infinite loop is occurring in a [[KMP]] route.
 +
* There are too many collision calculations happening at once (too many triangles in the [[KCL]]).
 
* A model is using too many draw calls/materials.
 
* A model is using too many draw calls/materials.
 
* There are too many NodeTree or NodeMix definitions.
 
* There are too many NodeTree or NodeMix definitions.
 
* There are too many particle generator objects.
 
* There are too many particle generator objects.
  
===GPU Bottleneck===
+
=== GPU Bottleneck ===
 
Symptoms:
 
Symptoms:
* Game slows down in 2 player splitscreen.
+
* The game slows down in two player split-screen.
  
 
Causes:
 
Causes:
Line 26: Line 32:
 
* A model has improper texture coordinate scale.
 
* A model has improper texture coordinate scale.
 
* A model's shader is using too many stages.
 
* A model's shader is using too many stages.
* There are too many large textures onscreen at once.
+
* There are too many large textures on the screen at once.
 
* There are too many large texture formats (RGBA8).
 
* There are too many large texture formats (RGBA8).
  
==Troubleshooting==
+
== Troubleshooting ==
===Optimize Model Geometry===
+
=== Optimize Model Geometry ===
You can find problem areas by looking at your model in the [[SZS Modifier]] with the ''wireframe view'' option enabled. To optimize your model, delete as many unnecessary lines/faces/textures in your model as you can. To reduce the complexity of curves, explode curves on your model and delete intermediate lines on the curved surface. This is an important step if you are creating objects with the Follow Me tool as it can drastically reduce their complexity.
+
You can find problem areas by looking at your model in [[BrawlBox]] with the ''wireframe view'' option enabled. To optimize your model, delete as many unnecessary lines/faces/textures in your model as you can. To reduce the complexity of curves, explode curves on your model and delete intermediate lines on the curved surface. This is an important step if you are creating objects with the Follow Me tool as it can drastically reduce their complexity.  
  
Note that OBJ exporter plugins for SketchUp are not perfect; some may cause duplication of textures if components ''are not'' exploded, while others may create garbage polygons if they ''are'' exploded. You will need to experiment to get the best results. Some authors recommended using the 3ds Max .dae exporter and [[BrawlBox]] to import models. The [http://www.vgmp3.org/DLs/HSKP2UNR_v103-Sketchup_Plugin.zip The HardPCM plugin] is a good free option.
+
Note that OBJ exporter plugins for [[SketchUp]] are not perfect; some may cause duplication of textures if components ''are not'' exploded, while others may create garbage polygons if they ''are'' exploded. You will need to experiment to get the best results. Some authors recommended using the [[3ds Max]] DAE exporter and BrawlBox to import models. The [http://vgmp3.org/DLs/HSKP2UNR_v103-Sketchup_Plugin.zip HardPCM plugin] is a good free option.  
  
[[file:reduce-faces-1.png|thumb|right|'''Figure 1.''' Overlapped polygons.]]
+
[[File:reduce-faces-1.png|thumb|right|'''Figure 1.''' Overlapped polygons]]
[[file:reduce-faces-2.png|thumb|right|'''Figure 2.''' The same polygons on different planes.]]
+
[[File:reduce-faces-2.png|thumb|right|'''Figure 2.''' The same polygons on different planes]]
[[file:reduce-faces-3.png|thumb|right|'''Figure 3.''' The previous image from a different angle.]]
+
[[File:reduce-faces-3.png|thumb|right|'''Figure 3.''' The previous image from a different angle]]
  
Some custom tracks define faces from both sides. <!-- I believe this mainly happened in the mspaint era. --> 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).
+
Some [[custom tracks]] define faces from both sides. <!-- I believe this mainly happened in the mspaint era. --> But for nearly all of the drivable faces (road, off-road, boost, water, and some more), only face-up triangles are needed. The first possibility to reduce the number of faces is to remove all drivable face-down triangles. In 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.
+
Using face-down roads also has another negative effect: If jumping down to the road, the player sometimes touches the face-down triangle and the vehicle will drive head down for a moment into a completely wrong direction. It is an 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:
 
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 (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.
+
* Remove triangles from the KCL that can never be reached.
  
You can save much more triangles if you think 3D. See the the 3 pictures 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 and lays all triangles side by side.
+
You can save much more triangles if you think in 3D. See the three images on the right: green is grass, blue is road, yellow is boost, and brown is a small hill. In the first image, you see that 49 triangles are used. It is because the developer thinks only in 2D and 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 few 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.
+
Now take a look at how [[Nintendo]] did it for newer tracks. They think in 3D and define the grass level with only two triangles. Then, they place a street two to four units higher and use only a few triangles. In a third level, they place the boost parts. The hill is also placed in the grass and may go below the grass.
  
In the third picture you see a schematic 3D view of the second one. Watch out the black shadows. In the first 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 (100 units in this demonstration).
+
In the third image, you see a schematic 3D view of the second one. Watch out for the black shadows. In the first image, 49 face-up triangles are used and only 19 in the other two images; this saves 61% of triangles in this example. Nintendo raises the above levels about two to four units (100 units in this demonstration).
  
===Optimize Objects===
+
=== Optimize Objects ===
Your level might also have too many objects. This may be caused by:
+
Your track might also have too many objects. This may be caused by:
* Too many objects in the KMP.
+
* Too many objects in the [[KMP]].
 
* Unused objects that are still rendered.
 
* Unused objects that are still rendered.
 
* Objects with model animations set to display in all game modes.
 
* Objects with model animations set to display in all game modes.
  
The easy solution would be to remove all unnecessary items from the KMP. 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.
+
The easy solution would be to remove all unnecessary items from the KMP. Some decoration [[object]]s should only appear in single player mode, such as animated characters like Piantas, flowers and Shy Guy groups. See [[presence flag]]s for more details.
  
===Optimize Textures===
+
=== Optimize Textures ===
Be sure to check the SZS for duplicated textures before releasing. You can find them by [[Texturing|browsing through the textures]] in course_model.brres. Likewise, check the mtl file for "#Distorted Textures." These are twisted or skewed copies of textures used in your level, usually used on just a single face of the model. You can find the locations of these textures on your model by replacing the distorted texture with a texture that contrasts well with the rest of the textures in your level, such as lime green or neon orange, then loading the model in-game or in the BRRES Editor. Reset the alignment of these textures on your model and re-export to eliminate the distorted duplicates.  
+
Be sure to check the [[SZS]] for duplicated textures before releasing. You can find them by [[Texturing|browsing through the textures]] in course_model.brres. Likewise, check the MTL file for "#Distorted Textures". These are twisted or skewed copies of textures used in your track, usually used on just a single face of the model. You can find the locations of these textures in your model by replacing the distorted texture with a texture that contrasts well with the rest of the textures in your track, such as lime green or neon orange, then loading the model in-game or in the BRRES Editor. Reset the alignment of these textures on your model and re-export to eliminate the distorted duplicates.
  
Large resolutions textures like 1024x1024 are rarely necessary and it is best practice to avoid them. Reducing the resolution of textures may help, although the impact of a few hi-res textures usually won't be noticed unless there are other problems. Just like the images below, you should try to make your images as unique as possible. You should also use the best possible texture format. Very simple gray-scaled Textures should use I4. More complex ones should use I8. If a gray-scaled image requires an Alpha Channel, it should use IA4 or IA8. For basic colored textures, you should choose CMPR. CMPR can have a better quality in Brawlbox's Importer than RGB565, which does not support an Alpha Channel and creates bigger files. RGBA32 or RGBA8 should be only used if you need True Color images with opacity, due to this fileformat creating large files. If you also don't know how to enable mipmaps in the MDL0 or don't need/want them, you should not create them in the Texture importer.
+
Large resolution textures like 1024x1024 are rarely necessary and it is best practice to avoid them. Reducing the resolution of textures may help, although the impact of a few high-resolution textures will not usually be noticed unless there are other problems. Just like the images below, you should try to make your images as unique as possible. You should also use the best possible texture format. Very simple gray-scaled textures should use I4. More complex ones should use I8. If a gray-scaled image requires an Alpha Channel, it should use IA4 or IA8. For basic-colored textures, you should choose CMPR. CMPR can have a better quality in BrawlBox's importer than RGB565, which does not support an Alpha Channel and creates bigger files. RGBA32 or RGBA8 should be only used if you need True Color images with opacity, due to this file format creating large files. If you also do not know how to enable [[mipmap]]s in the MDL0 or do not need/want them, you should not create them in the Texture Importer.
  
 
<gallery>
 
<gallery>
File:GCN Sherbet Land Water2.png|'''Figure 4a.''' A redundantly tiled texture.
+
GCN Sherbet Land Water2.png|'''Figure 4a.''' A redundantly-tiled texture
File:GCN Sherbet Land Water.png|'''Figure 4b.''' The same texture tiled only once.
+
GCN Sherbet Land Water.png|'''Figure 4b.''' The same texture tiled only once
File:SNES Rainbow Road Tile2.png|'''Figure 5a.''' Another example of redundancy.
+
SNES Rainbow Road Tile2.png|'''Figure 5a.''' Another example of redundancy
File:SNES Rainbow Road Tile.png|'''Figure 5b.''' The same texture tiled only once.
+
SNES Rainbow Road Tile.png|'''Figure 5b.''' The same texture tiled only once
 
</gallery>
 
</gallery>
  
===Optimize KCL===
+
=== Optimize KCL ===
Between the time of the SZS Modifier's KCL Editor and Wiimm's KCL Tool, people used workarounds to generate a bigger KCL than the ones from original game files. After Chadderz send Tock a Beta version of his own KCL Editor, Tock was able to create a 3.29 MB sized KCL by importing the raw Model of GCN Sherbet Land twice. This has helped many people to create KCLs easier for their own Custom Tracks. Sadly, this means the SZS nowadays is blown up by much unused data. This can be fixed by simply decoding the KCL to a .obj file with Wiimms KCL Tool and re-encoding it to a KCL. The KCL files from Tock's old GCN Sherbet Land was reduced from 3.29 MB to 630 KB.   
+
Between the time of the SZS Modifier's KCL Editor and Wiimm's KCL Tool, people used workarounds to generate a bigger KCL than the ones from original game files. After [[Chadderz]] sent [[Tock]] a beta version of his own KCL Editor, Tock was able to create a 3.29 MB-sized KCL by importing the raw model of [[GCN Sherbet Land (Tock)|<small>GCN</small> Sherbet Land]] twice. This has helped many people to create KCL files easier for their own [[custom track]]s. Sadly, this means the SZS is blown up by much unused data. This can be fixed by simply decoding the KCL to an OBJ file with Wiimm's KCL Tool and re-encoding it to a KCL. The KCL files from Tock's old <small>GCN</small> Sherbet Land was reduced from 3.29 MB to 630 KB.  
 +
 
 +
Additionally, it is best to simplify collision not only to avoid getting snagged or stuck on parts of the track, but also so that the CPU makes fewer collision calculations as players move through the track, reducing slowdown. <!-- Collision can be huge, and shouldn't be underestimated. I recently fixed a UT2004 level that was unplayable during certain conditions by turning collision off on most of the small, decorative meshes in the map. Like night and day. - Jefe --> Creating a separate [[Solidity#Making a Collision Model|simplified collision model]] allows you to optimize collision in a way that does not impact the look of your track.
  
Additionally, it is best to simplify collision not only to avoid getting snagged or stuck on parts of the level, but also so that the CPU makes fewer collision calculations as players move through the level, reducing slowdown.  <!-- Collision can be huge, and shouldn't be underestimated.  I recently fixed a UT2004 level that was unplayable during certain conditions by turning collision off on most of the small, decorative meshes in the map.  Like night and day. - Jefe --> Creating a separate [[Solidity#Collision_Models|simplified collision model]] allows you to optimize collision in a way that does not impact the look of your level.
+
== Known Tracks with Slow Motion Bug ==
 +
* [[Acrobatic Airway]]
 +
* [[Bayside Boulevard]]
 +
* [[Beware of Bouldergeist]]
 +
* [[Big Nature City]]
 +
* [[Blood Moon Forest]]
 +
* [[Blooper's Aquarium]]
 +
* [[GBA Bowser Castle 4 (ChaosShadow23)|<small>GBA</small> Bowser Castle 4 (ChaosShadow23)]]
 +
* [[GCN Bowser's Castle (Baoulettes)|<small>GCN</small> Bowser's Castle (Baoulettes)]]
 +
* [[GCN Bowser's Castle (Tock)|<small>GCN</small> Bowser's Castle (Tock)]]
 +
* [[Bowser's Ghost Valley]]
 +
* [[Carefree Crossing]]
 +
* [[The Chamber]]
 +
* [[Cheap Route to the Magic Show]]
 +
* [[Christmas Wish (MKWLH1000)]]
 +
* [[Colin's Island]]
 +
* [[Concord Cape]]
 +
* [[Cottonplant Forest]]
 +
* [[CT Cemetery]]
 +
* [[Cyberstate]]
 +
* [[Daisy's Palace (Vulcanus2)]]
 +
* [[Dark Mole Abyss]]
 +
* [[Darky Cliff]]
 +
* [[Death Star]]
 +
* [[Delfino Village]]
 +
* [[Desert Resort]]
 +
* [[GP Diamond City (Atlas)|<small>GP</small> Diamond City (Atlas)]]
 +
* [[Dry Coast (Putinas)]]
 +
* [[Eagle Retreat]]
 +
* [[Eclipse Cove]]
 +
* [[Emotion Journey]]
 +
* [[Fantastical Fantasy Falls]]
 +
* [[Fiery Path]]
 +
* [[Fish]]
 +
* [[Forest Creek]]
 +
* [[N64 Frappe Snowland (AltairYoshi)|<small>N64</small> Frappe Snowland (AltairYoshi)]]
 +
* [[Frigid Boondocks]]
 +
* [[Frost Festival]]
 +
* [[Ghost Valley 6]]
 +
* [[Grease Beach]]
 +
* [[Helado Mountain]]
 +
* [[Icepeak Mountain]]
 +
* [[Incendia Castle]]
 +
* [[Item Fireland]]
 +
* [[Jetski Driving]]
 +
* [[Jetski Driving II]]
 +
* [[Jetski Driving III]]
 +
* [[N64 Kalimari Desert (Captain Kwark & Wiimm)|<small>N64</small> Kalimari Desert (Captain Kwark & Wiimm)]]
 +
* [[Lava Road (FireLuigi & Caron)]]
 +
* [[Luna City]]
 +
* [[Mario's Garden]]
 +
* [[Mars Paradise]]
 +
* [[Mirage Desert]]
 +
* [[Mount Morton]]
 +
* [[Mushroom Meadows]]
 +
* [[Wii U Mute City (TheGamingBram)|<small>Wii U</small> Mute City (TheGamingBram)]]
 +
* [[Perplexus]]
 +
* [[Pipeline Skyway]]
 +
* [[Poké Ball Island]]
 +
* [[Raceway Lakeside]]
 +
* [[Rainbow Bridge]]
 +
* [[SNES Rainbow Clouds|<small>SNES</small> Rainbow Clouds]]
 +
* [[3DS Rainbow Road (BigOto2)|<small>3DS</small> Rainbow Road (BigOto2)]]
 +
* [[GBA Rainbow Road (MKDasher & MrBean35000vr)|<small>GBA</small> Rainbow Road (MKDasher & MrBean35000vr)]]
 +
* [[Rainbow Road Revolution]]
 +
* [[River Bridge]]
 +
* [[River Plains]]
 +
* [[Rocky Islands]]
 +
* [[N64 Royal Raceway (Baoulettes & LuigiM)|<small>N64</small> Royal Raceway (Baoulettes & LuigiM)]]
 +
* [[Scary Cemetery]]
 +
* [[Sherbet Circle (Luigi Story)]]
 +
* [[Sky Beach]]
 +
* [[Slammer Park]]
 +
* [[A Small Course]]
 +
* [[Snowy Drive]]
 +
* [[Sprinkle Circuit]]
 +
* [[Sunset Ridge]]
 +
* [[Temple Elemental]]
 +
* [[3DS Toad Circuit (Marianne8559)|<small>3DS</small> Toad Circuit (Marianne8559)]]
 +
* [[Toad Valley]]
 +
* [[Wii Toad's Factory (Mystora)|<small>Wii</small> Toad's Factory (Mystora)]]
 +
* [[Toadette Circuit (Toadette Hack Fan)]]
 +
* [[Toxic Labs]]
 +
* [[SNES Troopa Ridge 3|<small>SNES</small> Troopa Ridge 3]]
 +
* [[varemi's Circle Arena]]
 +
* [[Volador Castle]]
 +
* [[Wacky Rooftop Run]]
 +
* [[Wacky Waterworks]]
 +
* [[Wario's Gold Mine: Tour]]
 +
* [[Windmill Isle]]
 +
* [[3DS Wuhu Loop (Rukasudo90)|<small>3DS</small> Wuhu Loop (Rukasudo90)]]
 +
* [[Yoshi Mountain]]
  
==Known Tracks with Slow Motion Bug==
+
== Known Arenas with Slow Motion Bug ==
; Major problems:
+
* [[LMDM Ballroom|<small>LMDM</small> Ballroom]]
* [[Bowser's Lava Road]] ~42.000 facepoints.
+
* [[SNES Hacker Course 1|<small>SNES</small> Hacker Course 1]]
* [[Daisy's Palace]] RC2: ~'''80.000''' Facepoints, RC3: ~46.000 Facepoints.
+
* [[SMB1 Midsummer Jungle Square|<small>SMB1</small> Midsummer Jungle Square]]
* [[Dry Coast]] ~40.000 facepoints.
+
* [[Sunny Beach]]
* [[GBA Ribbon Road]] Singleplayer: ~'''102.000''' facepoints, Multiplayer: ~'''72.000''' facepoints.
 
* [[GCN Wario Colosseum]] ~'''98.000''' facepoints.
 
* [[GP Mario Beach]] RC2 ~'''90.000''' facepoints.
 
* [[Nightmare to Dream World]] ~'''83.000''' facepoints.
 
* [[Six King Labyrinth]]
 
* [[Peach's Beach Party]] v1.5-beta ~'''101.500''' facepoints, v1.6 ~45.000 facepoints.
 
  
; Minimal problems:
+
== Known Track Edits with Slow Motion Bug ==
* [[SNES Bowser Castle 2]]
+
* [[Delfino Pier (Race) (Delfino Pier Edit) (Krummers)|Delfino Pier (Race) (Krummers)]]
* [[Yoshi Mountain]]
+
* [[Peach Gardens: Cursed Edition (DS Peach Gardens Edit)|Peach Gardens: Cursed Edition]]
  
; More tracks ([[:Category:Slow Motion Bug|Category ''Slow Motion Bug'']])
+
== Known Tracks and Arenas with Slow Motion Bug at ct.wiimm.de ==
<categorytree mode=pages hideroot=on showcount=on>Slow Motion Bug</categorytree>
+
[https://ct.wiimm.de/?s=lag#list This link] starts a search on [[ct.wiimm.de]] for all tracks with slow motion effects.
 +
* Attribute '''[https://ct.wiimm.de/?s=:lag#list lag]''' indicates small slow-motion effects that are acceptable.
 +
* Attribute  '''[https://ct.wiimm.de/?s=:lag#list lag+]''' denotes slow-motion effects that are distracting.
 +
* Attribute  '''[https://ct.wiimm.de/?s=:lag#list lag++]''' marks slow-motion effects that make the track unusable.
 +
[[Wiimm]] made the ratings, which are therefore subjective. In addition, slow-motion effects are highly dependent on the game mode and the number of players.
  
 
[[Category:Bug]]
 
[[Category:Bug]]
 
[[Category:Optimization]]
 
[[Category:Optimization]]

Latest revision as of 15:14, 13 April 2024

Overview

Like a PC, the Wii is a computer system with a set amount of memory (RAM), processing (CPU) power and graphics (GPU) power. When it does not have enough CPU or GPU power to calculate what is rendered on screen, the action on screen (the frames per second or FPS) can slow down dramatically. While this is technically not a bug in the traditional sense, it is a symptom of poor optimization and can indicate that a track author did not test the track thoroughly before release.

Six King Labyrinth Slow Motion Bug

Performance Monitor

Extended Performance Monitor by stebler

Using the Performance Monitor code or with LE-CODE, you can find out accurately which component is being bottleneck. The blue bar represents how much time the GPU spent, the green bar represents draw calls and the red bar represents total frame time. To know which component is being bottleneck, check which bar is filling up the most. If it is just the red bar, then the console is being CPU bottleneck; if the blue bar is at the same amount as the red bar, then it is GPU bottleneck; if the green bar is large, then there is too many draw calls.

Types of Slowdown

There are several different types of slowdown that can occur in-game, depending on the component(s) being bottlenecked.

CPU Bottleneck

Symptoms:

  • The game slows down in 12 player online rooms.

Causes:

  • An infinite loop is occurring in a KMP route.
  • There are too many collision calculations happening at once (too many triangles in the KCL).
  • A model is using too many draw calls/materials.
  • There are too many NodeTree or NodeMix definitions.
  • There are too many particle generator objects.

GPU Bottleneck

Symptoms:

  • The game slows down in two player split-screen.

Causes:

  • Culling is being used improperly (no culling at all times).
  • A model is too geometrically complex.
  • A model has improper texture coordinate scale.
  • A model's shader is using too many stages.
  • There are too many large textures on the screen at once.
  • There are too many large texture formats (RGBA8).

Troubleshooting

Optimize Model Geometry

You can find problem areas by looking at your model in BrawlBox with the wireframe view option enabled. To optimize your model, delete as many unnecessary lines/faces/textures in your model as you can. To reduce the complexity of curves, explode curves on your model and delete intermediate lines on the curved surface. This is an important step if you are creating objects with the Follow Me tool as it can drastically reduce their complexity.

Note that OBJ exporter plugins for SketchUp are not perfect; some may cause duplication of textures if components are not exploded, while others may create garbage polygons if they are exploded. You will need to experiment to get the best results. Some authors recommended using the 3ds Max DAE exporter and BrawlBox to import models. The HardPCM plugin is a good free option.

Figure 1. Overlapped polygons
Figure 2. The same polygons on different planes
Figure 3. The previous image from a different angle

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

Using face-down roads also has another negative effect: If jumping down to the road, the player sometimes touches the face-down triangle and the vehicle will drive head down for a moment into a completely wrong direction. It is an 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 be reached.

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

Now take a look at how Nintendo did it for newer tracks. They think in 3D and define the grass level with only two triangles. Then, they place a street two to four units higher and use only a few triangles. In a third level, they place the boost parts. The hill is also placed in the grass and may go below the grass.

In the third image, you see a schematic 3D view of the second one. Watch out for the black shadows. In the first image, 49 face-up triangles are used and only 19 in the other two images; this saves 61% of triangles in this example. Nintendo raises the above levels about two to four units (100 units in this demonstration).

Optimize Objects

Your track might also have too many objects. This may be caused by:

  • Too many objects in the KMP.
  • Unused objects that are still rendered.
  • Objects with model animations set to display in all game modes.

The easy solution would be to remove all unnecessary items from the KMP. Some decoration objects should only appear in single player mode, such as animated characters like Piantas, flowers and Shy Guy groups. See presence flags for more details.

Optimize Textures

Be sure to check the SZS for duplicated textures before releasing. You can find them by browsing through the textures in course_model.brres. Likewise, check the MTL file for "#Distorted Textures". These are twisted or skewed copies of textures used in your track, usually used on just a single face of the model. You can find the locations of these textures in your model by replacing the distorted texture with a texture that contrasts well with the rest of the textures in your track, such as lime green or neon orange, then loading the model in-game or in the BRRES Editor. Reset the alignment of these textures on your model and re-export to eliminate the distorted duplicates.

Large resolution textures like 1024x1024 are rarely necessary and it is best practice to avoid them. Reducing the resolution of textures may help, although the impact of a few high-resolution textures will not usually be noticed unless there are other problems. Just like the images below, you should try to make your images as unique as possible. You should also use the best possible texture format. Very simple gray-scaled textures should use I4. More complex ones should use I8. If a gray-scaled image requires an Alpha Channel, it should use IA4 or IA8. For basic-colored textures, you should choose CMPR. CMPR can have a better quality in BrawlBox's importer than RGB565, which does not support an Alpha Channel and creates bigger files. RGBA32 or RGBA8 should be only used if you need True Color images with opacity, due to this file format creating large files. If you also do not know how to enable mipmaps in the MDL0 or do not need/want them, you should not create them in the Texture Importer.

Optimize KCL

Between the time of the SZS Modifier's KCL Editor and Wiimm's KCL Tool, people used workarounds to generate a bigger KCL than the ones from original game files. After Chadderz sent Tock a beta version of his own KCL Editor, Tock was able to create a 3.29 MB-sized KCL by importing the raw model of GCN Sherbet Land twice. This has helped many people to create KCL files easier for their own custom tracks. Sadly, this means the SZS is blown up by much unused data. This can be fixed by simply decoding the KCL to an OBJ file with Wiimm's KCL Tool and re-encoding it to a KCL. The KCL files from Tock's old GCN Sherbet Land was reduced from 3.29 MB to 630 KB.

Additionally, it is best to simplify collision not only to avoid getting snagged or stuck on parts of the track, but also so that the CPU makes fewer collision calculations as players move through the track, reducing slowdown. Creating a separate simplified collision model allows you to optimize collision in a way that does not impact the look of your track.

Known Tracks with Slow Motion Bug

Known Arenas with Slow Motion Bug

Known Track Edits with Slow Motion Bug

Known Tracks and Arenas with Slow Motion Bug at ct.wiimm.de

This link starts a search on ct.wiimm.de for all tracks with slow motion effects.

  • Attribute lag indicates small slow-motion effects that are acceptable.
  • Attribute lag+ denotes slow-motion effects that are distracting.
  • Attribute lag++ marks slow-motion effects that make the track unusable.

Wiimm made the ratings, which are therefore subjective. In addition, slow-motion effects are highly dependent on the game mode and the number of players.