Difference between revisions of "Solidity"

From Custom Mario Kart
Jump to navigation Jump to search
m
(New collision model section... will rewrite KCL Tutorial section next.)
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 ingame 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===
 +
 
 +
[[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.]]
 +
 
 +
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 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 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.
 +
 
 +
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.
 +
 
 +
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.)
 +
 
 +
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.  
  
 
==KCL Tutorial==
 
==KCL Tutorial==
Line 13: Line 33:
 
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.
 
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|800px|none]]
 
===Tip===
 
If you want solidity to be different from the actual course model (which is almost surely needed because of the way textures are grouped together and wall glitches), make a copy of your Sketchup (or any other program's project) file, making sure not to overwrite the old one. Now, change the textures within one of your two 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. Also, 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). Just remember to explode the group before exporting. Once you are done, export just like normal and import your BRRES file to your SZS file. Call it Course_Model_Solidity.brres to avoid making it appear in game, as we will simply use it to create the solidity (with the Create KCL option) in the SZS Modifier. Remember that if you make a change to any solid part of the visible road in your first Sketchup file, you will have to change the solidity Sketchup file too.
 
 
 
''If you are using 3ds max you can rename the 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. If you use Sketchup, name the textures to the value you want to give it or change the name in the OBJ file with notebook afterwards''
 
  
  
 
{{Custom Track Tutorial}}
 
{{Custom Track Tutorial}}
 
[[category:Tutorials]][[category:Custom Track Tutorial]]
 
[[category:Tutorials]][[category:Custom Track Tutorial]]

Revision as of 13:52, 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.
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.

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 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 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.

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.

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.)

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.

KCL Tutorial

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)


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.
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 flags article.
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.