Difference between revisions of "Solidity"

From Custom Mario Kart
Jump to navigation Jump to search
(New collision model section... will rewrite KCL Tutorial section next.)
(Rewriting the KCL Tutorial section)
Line 1: Line 1:
 
==General Info==
 
==General Info==
The [[KCL]] file contains all the solidity info, as well as event triggers that trigger when touched by a vehicle, item, or object. For example, driveable roads are stored within KCL files, as well as fall boundaries that cause you to respawn (which should be triggered by falling off the track or into a hazard). Cannon triggers are also found here. More simply put, the BRRES model is just for sights while all the info about being able to touch stuff in-game is stored in the KCL file.
+
The [[KCL]] file contains all the solidity info, as well as event triggers that trigger when touched by a vehicle, item, or object. For example, driveable roads are stored within KCL files, as well as fall boundaries that cause you to respawn (which should be triggered by falling off the track or into a hazard). Cannon triggers are also found here. More simply put, the [[BRRES]] model is just for sights while all the info about being able to touch stuff in-game is stored in the KCL file.
  
===Making a Collision Model===
+
==Making a Collision Model==
  
 
[[File:CollisionImage-RegularCourseModel.jpg|200px|thumb|A house on [[Rooster Island]].  This is the course_model version of the model, so the house is displayed in full detail.  The flower beds are raised, which would normally collide with the player.]]
 
[[File:CollisionImage-RegularCourseModel.jpg|200px|thumb|A house on [[Rooster Island]].  This is the course_model version of the model, so the house is displayed in full detail.  The flower beds are raised, which would normally collide with the player.]]
[[File:CollisionImage-OptimizedCollision.jpg|200px|thumb|This is the collision version of the model, so the house has been simplified. The upper windows and features have been deleted.  The lower windows and door now have the same 'wall' texture as the sides of the house.  A blue 'fall' texture has been applied to the to top; players will be respawned if they somehow get up there. The flowerbed has been lowered to the same level as the surrounding surfaces to allow driving through the flowerbed.]]
+
[[File:CollisionImage-OptimizedCollision.jpg|200px|thumb|The house has been simplified in the collision model. The chimney, trim and upper windows have been deleted.  The lower windows and door now have the same 'wall' texture as the sides of the house.  A blue 'fall' texture has been applied to the to top; players will be respawned if they somehow get up there. The flowerbed has been lowered to the same level as the surrounding surfaces to allow driving through the flowerbed.]]
  
 
A separate collision model provides several potential benefits.  
 
A separate collision model provides several potential benefits.  
  
 
*It can help prevent super short cuts and other glitches by putting in invisible walls and fall boundaries.
 
*It can help prevent super short cuts and other glitches by putting in invisible walls and fall boundaries.
*If your has any complex geometry that can't or seldom will be touched by karts, this geometry can be deleted or simplified providing a potential in-game frame rate increase.
+
*If your level has any complex geometry that can't or seldom will be touched by karts, this geometry can be deleted or simplified providing a potential in-game frame rate increase.
 
*You can use fewer textures when setting up your [[KCL]], saving time.
 
*You can use fewer textures when setting up your [[KCL]], saving time.
 
*It can reduce or prevent potential errors when creating your KCL.
 
*It can reduce or prevent potential errors when creating your KCL.
  
To create a collision model in SketchUp, first make a copy of your SketchUp file, making sure not to overwrite the old one.  Change the textures within the new Sketchup files so that each texture represents a different solidity type and variant.  Don't worry about the looks here as you will NOT be loading this file in-game, it will simply be used for KCL generation. If you have surfaces that will seldom or never be touched, replace them with a texture that will have similar properties in the KCL that is already in use, for example, a wall or solid fall.  (You can right click any surface and 'select all with same material' then use the paint bucket to replace the texture.) If your level has multiple drivable layers, make sure to make a group of all the walls and move their tops down just a tiny bit, to prevent against wall glitches in-game (which cause your vehicle to strike an invisible boundary on a road which has a wall below it.)  You can delete a lot of background geometry in your collision file, just set up simple polygons nearby with a texture you want to use for out-of-bounds or solid fall. Remember to explode all groups and components before exporting. It is also useful to delete any unseen faces.  Remember to delete any textures (in the texture browser, they will appear in the "In Model" section) that you have otherwise removed.  
+
To create a collision model in [[SketchUp|Google SketchUp]], first make a copy of your SketchUp file, making sure not to overwrite the old one.  Change the textures within the new SketchUp file so that each texture represents a different [[KCL flag|solidity type and variant]]. (You can right click any surface and 'select all with same material' then use the paint bucket to replace the texture.) Don't worry about the looks here as you will not be loading this file in-game, it will simply be used for KCL generation.  If your level has multiple drivable layers, make sure to make a group of all the walls and move their tops down just a tiny bit, to prevent against wall glitches in-game (which cause your vehicle to strike an invisible boundary on a road which has a wall below it.)  You can delete a lot of background geometry in your collision file, just set up simple polygons nearby with a texture you want to use for out-of-bounds or solid fall. Explode all groups and components before exporting. In the Materials browser, textures that are considered to be in use will appear in the "In Model" section.  Delete any textures that you have otherwise removed.
  
Remember that if you make a change to any solid part in your first SketchUp file, you will have to change the solidity Sketchup file too.  Select all the faces and edges that you've changed in the course_model, copy, open the collision model, then select 'Paste in Place' from the edit menu.  Remember to delete the old surfaces.
+
Remember that if you make a change to any solid part in your main model, you will need to make a corresponding change in your collision model too.  Select all the faces and edges that you've changed in the course model file, copy, open the collision model, then select 'Paste in Place' from the edit menu.  Don't forget to delete the old surfaces you are replacing.
  
If you are using 3DS Max you can rename polygons with ease, so it's recommended to name them to the value you want to give it, than you don't have to write it down/remember it. When using SketchUp, you should give textures descriptive names, similar to the solidity value you want to give them.  This step isn't completely necessary, but can help you avoid confusion. (To rename textures in SketchUp, open the texture browser and select the texture you want to change.  Above the list of textures it will show the file name.  Simply type in a new one.)
+
If you are using 3DS Max you can rename polygons with ease, so it's recommended to name them to the value you want to give it, than you don't have to write it down/remember it. When using SketchUp, you should give textures descriptive names, similar to the solidity value you want to give them.  This step isn't completely necessary, but can help you avoid confusion. (To rename textures in SketchUp, open the Materials browser and select the texture you want to change.  Above the list of textures it will show the file name.  Simply type in a new one.)
  
Once you are done editing your collision model, export the OBJ as normal.  Open the BRRES editor and import the file with the course_model option selected.  Save the file with a name like course_model_solidity.brres.  Import the the BRRES into your SZS with SZS Explorer and save (you do not have to overwrite course_model.)  Open the SZS file in the SZS Modifier and follow the rest of this tutorial.  
+
Once you are done editing your collision model, export the OBJ as normal.  Open the BRRES editor and import the file with the course_model option selected.  Save the file with a name like course_model_solidity.brres.  Import the BRRES into your SZS with [[CTools_Pack#SZS_Explorer|SZS Explorer]] and save (you do not have to overwrite the normal course_model.)  Open the SZS file in the SZS Modifier and follow the rest of this tutorial. Delete the collision model from your SZS after you're done generating the KCL.
  
==KCL Tutorial==
+
==Generating a KCL==
Currently, KCL files created with the CTools KCL Creator are unusable, the road will be very bouncy if you use them. MrBean35000vr believes this is caused because the grid generated is way too small. You can use the CTools KCL generator to create expanded KCL files, but you can't create a new KCL from scratch here; you will need to use the SZS Modifier's KCL creator (which really only patches an existing file with proper solidity).
 
  
First of all, export the course.kcl file from Maple Treeway (treehouse_course) or take one that you generated with CTools as these are very big and are less likely to encounter a too complex error (But use a bigger model than your actual kcl needs because 99% ot the time SZS Modifier makes a bigger kcl) and replace the kcl in your own szs (if present)
+
====CT Tools====
[[File:Soliditykh.png|800px|none]]
+
Currently, KCL files created with the [[CTools_Pack#KCL_editor|CTools KCL Editor]] are unusable as the road will be very bouncy if you use them, or the tool will otherwise fail in the creation process. MrBean35000vr believes the bounciness issue is caused by the grid generated being too small. You can use the CTools KCL Editor to create expanded KCL files, but you can't create a new KCL from scratch here; you will need to use the SZS Modifier's KCL Editor to patch an existing file with proper solidity.  To access this editor, right click on your course.kcl in SZS Explorer, and choose "Open with" > "KCL Editor." You will need to import an OBJ file of your level (your collision model, for example) to use this editor.
  
 +
====SZS Modifier====
  
Now, open your course_model.brres with SZS Modifier. Make sure that you're not opening the course.kcl in SZS Modifier, just the actual course_model.brres.<br/>
+
[[File:Soliditykh.png|200px|thumb|Replacing course.kcl]]
Now, select "Create KCL" under the Tools menu, and choose the solidity types you want for each texture. A list of solidity types and what they all do can be found at the [[KCL flag]]s article.<br/>
 
The same process can be used for the CTools KCL generator, except you need to import the OBJ file that you want to create solidity for.
 
[[File:Solidity2kh.png|800px|none]]
 
  
 +
[[File:Solidity2kh.png|200px|thumb|Generating a new course.kcl in SZS Modifier's KCL Editor]]
  
 +
First you will need to import a large KCL file into your SZS.  You can export the course.kcl from Maple Treeway (treehouse_course), take one that you generated with CTools, or use one from another custom track.  Large KCL files are less likely to encounter a 'too complex' error.  If you are using CTools to generate the initial KCL, add some extra geometry (a few components, for example) to your model since SZS Modifier will typically generate a slightly larger KCL than CTools but cannot expand the KCL. Replace the KCL in your own SZS (if present) with this larger KCL.
 +
 +
Next, open your course_model.brres with SZS Modifier. If you have made a separate collision model, open that BRRES file instead. Make sure that you're not opening the course.kcl in SZS Modifier, just the actual BRRES.
 +
 +
Select "Create KCL" under the Tools menu, and choose the solidity types you want for each texture. A list of solidity types and what they all do can be found in the [[KCL flag]]s article. 
 +
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 +
<br>
 
{{Custom Track Tutorial}}
 
{{Custom Track Tutorial}}
 
[[category:Tutorials]][[category:Custom Track Tutorial]]
 
[[category:Tutorials]][[category:Custom Track Tutorial]]

Revision as of 16:56, 9 October 2011

General Info

The KCL file contains all the solidity info, as well as event triggers that trigger when touched by a vehicle, item, or object. For example, driveable roads are stored within KCL files, as well as fall boundaries that cause you to respawn (which should be triggered by falling off the track or into a hazard). Cannon triggers are also found here. More simply put, the BRRES model is just for sights while all the info about being able to touch stuff in-game is stored in the KCL file.

Making a Collision Model

File:CollisionImage-RegularCourseModel.jpg
A house on Rooster Island. This is the course_model version of the model, so the house is displayed in full detail. The flower beds are raised, which would normally collide with the player.
The house has been simplified in the collision model. The chimney, trim and upper windows have been deleted. The lower windows and door now have the same 'wall' texture as the sides of the house. A blue 'fall' texture has been applied to the to top; players will be respawned if they somehow get up there. The flowerbed has been lowered to the same level as the surrounding surfaces to allow driving through the flowerbed.

A separate collision model provides several potential benefits.

  • It can help prevent super short cuts and other glitches by putting in invisible walls and fall boundaries.
  • If your level has any complex geometry that can't or seldom will be touched by karts, this geometry can be deleted or simplified providing a potential in-game frame rate increase.
  • You can use fewer textures when setting up your KCL, saving time.
  • It can reduce or prevent potential errors when creating your KCL.

To create a collision model in Google SketchUp, first make a copy of your SketchUp file, making sure not to overwrite the old one. Change the textures within the new SketchUp file so that each texture represents a different solidity type and variant. (You can right click any surface and 'select all with same material' then use the paint bucket to replace the texture.) Don't worry about the looks here as you will not be loading this file in-game, it will simply be used for KCL generation. If your level has multiple drivable layers, make sure to make a group of all the walls and move their tops down just a tiny bit, to prevent against wall glitches in-game (which cause your vehicle to strike an invisible boundary on a road which has a wall below it.) You can delete a lot of background geometry in your collision file, just set up simple polygons nearby with a texture you want to use for out-of-bounds or solid fall. Explode all groups and components before exporting. In the Materials browser, textures that are considered to be in use will appear in the "In Model" section. Delete any textures that you have otherwise removed.

Remember that if you make a change to any solid part in your main model, you will need to make a corresponding change in your collision model too. Select all the faces and edges that you've changed in the course model file, copy, open the collision model, then select 'Paste in Place' from the edit menu. Don't forget to delete the old surfaces you are replacing.

If you are using 3DS Max you can rename polygons with ease, so it's recommended to name them to the value you want to give it, than you don't have to write it down/remember it. When using SketchUp, you should give textures descriptive names, similar to the solidity value you want to give them. This step isn't completely necessary, but can help you avoid confusion. (To rename textures in SketchUp, open the Materials browser and select the texture you want to change. Above the list of textures it will show the file name. Simply type in a new one.)

Once you are done editing your collision model, export the OBJ as normal. Open the BRRES editor and import the file with the course_model option selected. Save the file with a name like course_model_solidity.brres. Import the BRRES into your SZS with SZS Explorer and save (you do not have to overwrite the normal course_model.) Open the SZS file in the SZS Modifier and follow the rest of this tutorial. Delete the collision model from your SZS after you're done generating the KCL.

Generating a KCL

CT Tools

Currently, KCL files created with the CTools KCL Editor are unusable as the road will be very bouncy if you use them, or the tool will otherwise fail in the creation process. MrBean35000vr believes the bounciness issue is caused by the grid generated being too small. You can use the CTools KCL Editor to create expanded KCL files, but you can't create a new KCL from scratch here; you will need to use the SZS Modifier's KCL Editor to patch an existing file with proper solidity. To access this editor, right click on your course.kcl in SZS Explorer, and choose "Open with" > "KCL Editor." You will need to import an OBJ file of your level (your collision model, for example) to use this editor.

SZS Modifier

File:Soliditykh.png
Replacing course.kcl
File:Solidity2kh.png
Generating a new course.kcl in SZS Modifier's KCL Editor

First you will need to import a large KCL file into your SZS. You can export the course.kcl from Maple Treeway (treehouse_course), take one that you generated with CTools, or use one from another custom track. Large KCL files are less likely to encounter a 'too complex' error. If you are using CTools to generate the initial KCL, add some extra geometry (a few components, for example) to your model since SZS Modifier will typically generate a slightly larger KCL than CTools but cannot expand the KCL. Replace the KCL in your own SZS (if present) with this larger KCL.

Next, open your course_model.brres with SZS Modifier. If you have made a separate collision model, open that BRRES file instead. Make sure that you're not opening the course.kcl in SZS Modifier, just the actual BRRES.

Select "Create KCL" under the Tools menu, and choose the solidity types you want for each texture. A list of solidity types and what they all do can be found in the KCL flags article.