simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed,...

14
2D Vehicle physics/mechanics 1.0 Description: This asset allows you to cut time developing any game that has cars in it. It is easy to use, no programming experience required. The asset was created using real life vehicle physics to make it as realistic as possible. You can use it from realy simple 2D hill climber to advanced drag racing type of game. Features: 1. Adjustable center of mass. 2. Adjustable position of fuel tank. 3. Different, Ajustable fuel consumption while idling and driving. 4. Fuel tank changes mass while consuming fuel.

Transcript of simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed,...

Page 1: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

2D Vehicle physics/mechanics 1.0

Description:

This asset allows you to cut time developing any game that has cars in it. It is easy to use, no programming experience required. The asset was created using real life vehicle physics to make it as realistic as possible. You can use it from realy simple 2D hill climber to advanced drag racing type of game.

Features:

1. Adjustable center of mass.2. Adjustable position of fuel tank.3. Different, Ajustable fuel consumption while idling and driving.4. Fuel tank changes mass while consuming fuel.5. Variable number of wheels.6. Variable power distribution on each wheel.7. Variable number of gears.8. Adjustable gear ratios (torque and max. speed).9. Adjustable  anti-lock braking system (ABS).

Page 2: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

10. Adjustable launch control system (LCS).11. Manual and Automatic transmission.12. Adjustable nitrous oxide system (NOS).13. Programmable commands (mostly for NPC’s).14. Basic stats (speed, wheel speed, current gear and engine status) displayed.15. Adjustable engine pitch (idle pitch, max. pitch, rev up speed, rev down speed).16. Keyboard and Touch controls.17. Basic, adjustable spoiler aerodynamics.18. Implemented Exhaust effect.19. Adjustable grip for each wheel.20. Adjustable suspension.

Additional features:

1. Demo scene.2. Example vehicle.3. Camera script (for following the Player and easy driving at high speeds).4. Mobile friendly.

Page 3: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

How to use it?Playing with demo scene:

1. Import package to the project.2. Open “Demo” scene in _Scenes folder.3. Press play button to start.

4. Press Engine start button to start the engine.

5. Watch the demo (the vehicle in demo scene is programmed to drive by it self).6. You can control the vehicle after all the commands are completed (when the car stops).

Page 4: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

How to implement vehicle in your own scene?

1. Open Prefabs folder.2. Drag CarControlCanvas prefab and Vehicle prefab in to the Hierarchy.

3. If you want to follow the Player car you need to drag PlayerCameraFollow script on to the Main Camera.

Page 5: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

4. Create EventSystem.5. Press Play button.

Note: As long as you have some kind of Terrain under the Vehicle everything should work.

How to change vehicle parameters?

1. Most of the settings related to the vehicle can be changed using ConfigurationScript which is attached to Vehicle game object.

Section One (Gas):

1. Gas In Liters: Determine how much fuel vehicle will have at the beginning of game.2. Consumption Idling: How much fuel will be used while not accelerating (per

minute).3. Consumption Driving: How much fuel will be used while accelerating (per minute).

Page 6: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

Section Two (ABS):

1. ABS: Switches anti-lock braking system on and off.2. ABS Delta: How much can wheel speed be different from vehicle speed (if this speed

is exceeded brakes will be released, km/h).

Section Three (Launch Control):

1. Launch Control: Switches launch control system on and off.2. LC Delta: How much can wheel speed be different from vehicle speed (if this speed

is exceeded throttle will be lowered by a certain amount, km/h).3. LC Change Step: By what amount throttle will be lowedred when LCS is activated

(Can be different for every vehicle).

Section Four (NOS):

1. NOS: Switches NOS on and off.2. Boost Percentage: How much power (%) should be added when activated.3. NOS Quantity: How long can boost be applied (in seconds).

Section Five (Engine sound):

1. Engine Pitch: Engine pitch while Idling.2. Highest Engine Pitch: Engine pitch at the end of every gear.

Page 7: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

Wheels and Gears:

1. Expand Wheel and Gear settings in ConfigurationScript.

2. Wheel Size setting determine how much wheels vehicle have.3. Each wheel have two settings:

1. Wheel game object.2. The amout of power the wheel is getting (%).

4. Gear Size setting determine how much gears vehicle have.

5. Each gear have two settings:

1. The amount of torque (power) the gear has (Element 0 torque is negative because it is reverse gear).

2. Maximum speed the vehicle will be able to reach with chosen gear.

Page 8: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

Programmable commands:

1. Expand Programmable Commands settings in ConfigurationScript.

2. Programmable Commands Size setting determine the number of commands to execute.

3. The Seconds setting determine how long to hold particular speed.

4. The Cruise Speed setting determine how fast the vehicle will go.

Note: In this example the vehicle will go at 10 km/h for 21 seconds, then come to a complete stop for 3 seconds, then will proceed with the rest five commands.

Note: The vehicle will proceed to execute commands as soon as the engine will start.

Revving:

1. Rev Up Script is located on the bottom of components on Vehicle game object.

2. Two parameters determine how fast the engine will rev up and rev down.

Page 9: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

Spoiler aerodynamics:

1. SpoilerAerodynamics script is located on Spoiler game object.

2. The faster vehicle go the more downforce spoiler produces. To adjust downforce change Downward Force Multiplier setting.

Note: You can duplicate Spoiler game object and put it in front of a vehicle to have a front spoiler.

Page 10: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

Cruise control:

When Cruise control is activated the vehicle will maintain current speed.

Suspension:

1. The suspension parameters can be changed on Vehicle game object -> Wheel Joint 2D components.

Page 11: simulation31.files.wordpress.com€¦  · Web view02/09/2016  · Basic stats (speed, wheel speed, current gear and engine status) displayed. Adjustable engine pitch (idle pitch,

Weight distribution:

To balance the car just change the position of CenterOfMass and FuelTank releative to Vehicle game object.

Speed Camera:

To make camera to ajust depending on vehicle speed, change parameters shown here.

Note: Multiplyer Distance = 0.03 and Multiplyer Forward = 0.03 is a good combination.