Engine Performance Customization
Learn how to make your own engine part types to add deeper performance customization to your game.
Last updated
Learn how to make your own engine part types to add deeper performance customization to your game.
Last updated
Version 1.1.0 added engine performance customization to the asset.
First of all, open engine part creation window by going to Tools -> CustomVehicleController -> Engine Part Creator Window
In this window you can create and delete engine part types and make instances of part types that are currently in the project.
Open the "Engine Part Type Management" foldout, enter a name and click "Create New Engine Part Type"
This will create a new class that derives from CustomEnginePart class. The folder will be created at "CustomVehicleController/VehicleController/VehicleParts/EngineParts/" with the specified name. A csharp file will be created in this folder.
Open the "Engine Part Type Management" foldout, select the engine type from the foldout and click "Delete selected part type"
This will delete a folder and every file that existed in it at a location "CustomVehicleController/VehicleController/VehicleParts/EngineParts/(selected type)".
Open the "Engine Part Settings" foldout.
In the "Engine Part Type" dropdown select engine part type that exists in the project. Enter a name of the asset in the "New Asset Name" text field and click "Create New Asset". This will create a scriptable object of the selected type at location "CustomVehicleController/VehicleController/VehicleParts/EngineParts/(selected type)".
Open the "Engine Part Settings" foldout.
In the "Engine Part Type" dropdown select engine part type that exists in the project.
Select engine part asset in the "(selected type) SO" object field.
Here is the explanation for each field.
Engine parts can be assigned from code and the "Engine Part Creator Window"
Open the "engine part creator window" and select a gameobject with a CustomVehicleController script on it. The "Engine Parts Container" will have a list with fields for every engine part type that exist in the project.
Assign the engine part to their appropriate fields by selecting them from the object field:
A vehicle controller can only contain 1 part of each type of engine parts.
Get a reference to the CustomVehicleController script (for example, by calling GetComponent<CustomVehicleController>).
Call a "SetNewEnginePart(CustomEnginePart newPart)" method and pass in an instance of any engine part that you created (every engine part type that you create derives from the CustomEnginePart class). If the vehicle controller already has a part of that type, the part will be changed, otherwise a new part type field will be added with a new part as a value.
Field Name | Description |
---|---|
Torque Increase
The amount of torque that will be added to the engine.
Non-linear boost
If toggled, the engine will read the value from the EffectCurve.
Effect Curve
Animation Curve that holds the keys with time keys [0;1]. The engine will read the value from the EffectCurve using the engine rpm percent and use it as a multiplier to the Torque Increase value.
Change Working RPM
If toggled, the engine will modify it's idle and maximum rpm values based on the IdleRPMChange and MaxRPMChange values.
IdleRPMChange
The change of idle rpm of the engine.
MaxRPMChange
The change of maximum rpm of the engine