You are here

FAQ and Problem Solving - Vehicles

AlexTSK's picture
I was in the War!
Posts: 2611
FAQ and Problem Solving - Vehicles
#1 Submitted: Tue, 21/07/2015 - 22:03

This is going to be a little problem solving and FAQ section specifically pertaining custom vehicles. So if you have an issue you may find the solution here. I'll do my best to update this topic with

new solutions as the problems arise. Please don't hesitate to post any issues/solutions you have peronally come across and I will do my best to find a solution or if the solution isn't on the list, add it.

Error Logs
First off, I'd like to start off with enabling logging. It used to be automatic and may make its way back but it has been disabled in the current version, here's how to enable it:

1: Create a folder named 'Diagnostics' in your CR root directory
2: In steam, right-click on CR and select
3: Select Properties
4: Under the general tab select "Set Launch Options"
5: Add the following too the launch options box "-dumplogs" (minus the quotes)
6: You should now have the logs up and running.

Within the "Diagnostics" folder you will find folders with various date and time names which correspond to each launch of the game(they are only created when logging is enabled). There are two files only one of which is important and that is the SCRIPT_LOG.txt. As it stands there are a few things the SCRIPT_LOG.txt will simply not log despite the game crashing and you will find these issues and how to solved them below. Again these will be updates as I go.
----------------------------------------------------------------------------------------------------------------------------------
Non-Logged Errors

Q: My Car loads fine in car select but the game crashes?! HALP!
A: Check the following

- If the game crashes when loading an event, then the problem is usually in the structure.xml (if all parts necessary are present in hierarchy, though remember, not all parts need to be in the hierarchy to work, especially very small separate parts as they will still load up in-game but they will all inherit the properties of their parent)

Wheels

The absence of wheels is usually noticeable in the car select screen before loading into a level, if your car is missing all/some of its wheels when it loads up in car select, chances are good that attempting to load a level while using the car will crash the game. CR is very finicky with wheel setup and even one mistake can lead to a game crash, these issues are not logged at this moment.

-You have 4 wheels defined

-Each wheel has the correct physics properties, a mismatch in which will case the game to crash

- If the Physics properties are mixed up between each wheel, hub, brake (Example: assigning FRONT_LEFT... when it should be FRONT_RIGHT..) then the game will crash without logging the error.

Front Left Wheel - DamageParameters:Add_PhysicsProperty( "FRONT_LEFT_WHEEL" )
Front Right Wheel - DamageParameters:Add_PhysicsProperty( "FRONT_RIGHT_WHEEL" )
Rear Left Wheel - DamageParameters:Add_PhysicsProperty( "REAR_LEFT_WHEEL" )
Rear Left Wheel - DamageParameters:Add_PhysicsProperty( "REAR_RIGHT_WHEEL" )

-You also want a parent for the wheel node, (typically this will be an axle shaft, or a brake disc/drum mesh), this will hold the point of rotation
- The point of rotation will make the object spin with the wheels, so it makes sense to have this set on a brake disc(which you don't want to stay stationary)

NB: Do not put the below physics properties on the wheel node itself, bad things happen

Front Left Brake Drum/Disc/Axle: CDamageParameters:Add_PhysicsProperty( "FRONT_LEFT_POINT_OF_ROTATION" )
Front Right Brake Drum/Disc/Axle: CDamageParameters:Add_PhysicsProperty( "FRONT_LEFT_POINT_OF_ROTATION" )
Rear Left Brake Drum/Disc/Axle: CDamageParameters:Add_PhysicsProperty( "REAR_LEFT_POINT_OF_ROTATION" )
Rear Right Brake Drum/Disc/Axle: CDamageParameters:Add_PhysicsProperty( "REAR_RIGHT_POINT_OF_ROTATION" )

You may also have a hub mesh or node, this is the part of wheel that will not spin but rather act as a mounting point for your brake disc/drum and brake caliper(if you have one) as well as be the point of suspension and the point of steering for the front wheels. Alternatively, if you don't have a hub you can add these properties to your Brake Drum/Disc/Axle combo, which will then become your hub

Make sure the physics properties are correct on your hubs(Don't add points of steering to the rear wheels, there is no 4 wheel steering, at least not yet):

Front Left Hub :
CDamageParameters:Add_PhysicsProperty( "FRONT_LEFT_POINT_OF_SUSPENSION" )
CDamageParameters:Add_PhysicsProperty( "FRONT_LEFT_POINT_OF_STEERING" )

Front Right Hub :
CDamageParameters:Add_PhysicsProperty( "FRONT_RIGHT_POINT_OF_SUSPENSION" )
CDamageParameters:Add_PhysicsProperty( "FRONT_RIGHT_POINT_OF_STEERING" )

Rear Left Hub :
CDamageParameters:Add_PhysicsProperty( "REAR_LEFT_POINT_OF_SUSPENSION" )

Rear Right Hub :
CDamageParameters:Add_PhysicsProperty( "REAR_LEFT_POINT_OF_SUSPENSION" )

- Wheels need to have collision and physics properties set, flummery outputs these correctly so don't change the properties on the wheels

----------------------------------------------------------------------------------------------------------------------------------
Collision/Convex Hull Error

This one is rather sneaky and I've only recently discovered it thanks to Trent and Errol's snooping. The basic principle of this is, the game draws a collision shape for each detachable part, an sometimes the detachable parts may be very complex (in my case it was the engine mesh). This collision mesh may intersect other detachables and cause the game to go into nuclear meltdown attempting to compute the collisions, which results in a game crash before you've loaded into a race.

If you are encountering game crashes and it's not the wheels or hierarchy, you may be running into this error, it is however a pretty simple fix. All you need to do is define a shape for the Part in Structure.xml.

Add one of these this to the Part you think may be causing the collision issue :

CDamageParameters:Set_ShapeType( "TIC_TAC_X" )
CDamageParameters:Set_ShapeType( "TIC_TAC_Y" )
CDamageParameters:Set_ShapeType( "TIC_TAC_Z" )

This could be a temporary solution, or a permanent one, we don't quite know how the collision boxes work yet, but it has fixed my headache and may help you.

----------------------------------------------------------------------------------------------------------------------------------
Non Critical Issues
Q: My Car loads fine in car select but the wheels or tires are offset in game
A: Check the following

- The welds on the wheels nodes MUST have Add_PartSpaceVertex(0,0,0) otherwise tires will be offset in-game

Edited by: AlexTSK on 01/08/2015 - 21:17
starbuck's picture
Velociraptor Fister
PayPal Backer
Posts: 1289
Submitted: Tue, 21/07/2015 - 22:57

While this is a perfect idea for cars cause they look complicated we should have one for maps too.

Why is it that when you are a child at the dinner table you can get punished asking for someone to please pass you the fork and knife ?

AlexTSK's picture
I was in the War!
Posts: 2611
Submitted: Tue, 21/07/2015 - 23:28

starbuck wrote:
While this is a perfect idea for cars cause they look complicated we should have one for maps too.

No experience in that I'm afraid, If get into map making I'll make one for maps as well.

Edited by: AlexTSK on Tue, 21/07/2015 - 23:28
Mad Mike's picture
Velociraptor Fister
Kickstarter Backer
Posts: 1060
Submitted: Fri, 24/07/2015 - 09:06

Beating me to it on tutorial setup hehe.

I would add:

  • - If the game crashes when loading an event, then the problem is usually in the structure.xml (if all parts are present in hierarchy)
  • - If the Physics properties are mixed up between each wheel, hub, brake (Example: assigning FRONT_LEFT... when it should be FRONT_RIGHT..) then the game will crash without giving an error in the Script_Log, unless that has changed since Gold Release
  • - Driveshafts are usually animated manually in their local axis (see animation controllers below)
  • ---> Use GEARBOX_OUTPUT_ANGLE for transmission to live axle or transfer box
  • ---> Use WHEEL_ROTATION_XX, where XX is FL, FR, RL, RR
  • - Wheels need to have collision properties set (Use TIC_TAC_X)
  • - The welds on the wheels nodes MUST have Add_PartSpaceVertex(0,0,0), otherwise tires will be offset in-game

I'm hoping to get some basic tutorials setup soon too, so I might be back with some other useful info for car setup.

One man... Alone... Wrecking opponents in the Automobile he loves
Twitter Manifestation, Mods for Max Damage

AlexTSK's picture
I was in the War!
Posts: 2611
Submitted: Sat, 01/08/2015 - 20:50

Thanks, will add a couple of these.