Welcome!

_images/mmv-main-page.jpg

Welcome to the MMV (Modern Military Vehicle System) documentation. Here you will have all the information you need to create your own vehicles based on the system, if you find any writing errors or even system inconsistency please report the problem to us via github. Implementation and correction requests are also welcome!

To get started, you can download the system through the store.

Video tutorials are also available on Youtube

Below you will see all the MMV documentation separated by themes, enjoy:

Introduction

MMV is a military vehicle control system for games made in Unity, it should provide good vehicle physics in addition to a range of possibilities for different games through its architecture that allows the implementation of custom systems. The system also provides by default some systems ready to help and all of them will be explained in the following modules of the documentation.

Overview

Here’s a summary of how the MMV architecture works and what you can do.

The Main System

The main system consists of vehicle physics and the entire control system, such as acceleration, steering, braking and gun turret movement. All other systems are just add-ons to this main system and are not mandatory, allowing them to be replaced by one customized to the developer’s taste. Here’s a summary of how the MMV architecture works and what you can do.

0%

The vehicle system is made up of modules that communicate, each module is responsible for an essential part of the vehicle. You can access some vehicle API functions and give commands, for example, tell the vehicle where to go or tell the gun turret module where to aim, (this will be explained in the next modules of this documentation).

How the tracked vehicle behaves

The MMV has a custom wheel physics system, we managed to make the wheel configuration very simple and it is still very stable for the purpose of Asset. The vehicle’s system will already do most of the hard work for you and so you just need to take care of passing the control commands.

Movimentation

In the case of tracked vehicle, all your vehicle movement control is based on the acceleration of the wheels, whether they are going backwards or forwards and the speed at which they are moving. An MBT vehicle from the MMV is no different, we use this same principle, to better understand, below is an example of how the acceleration influences the vehicle’s direction.

0%

How do Tracks Work

The tracks use fake simulation to look like they actually move. The treadmill model is linked to a bone armature, one bone per wheel and via script this bone will follow the wheel’s position generating the effect that movement.

0%

This solves the suspension problem, but there is another point that needs attention, which is the issue of vehicle acceleration, the treadmill needs to respond to the speed at which the vehicle moves and for that there is an integrated system in the wheel control script of the MBT vehicle that changes the texture offset of the mat material giving the feeling of movement.

0%

Weapon System

Only the turret system is integrated into the vehicle, fire control is done separately by other scripts. The main job of the turret is just aiming at some position in the world respecting the vehicle’s angle limits.

0%

Tracked vehicle Component Configuration

Responsible for simulating the entire system of a vehicle with tracks.

Vehicle Component

A vehicle component is composed of some modules, each module controls a specific part as you can see in the image.

_images/vehicle_modules.jpg

Let’s explain the vehicle component separated by modules.

Engine

Module responsible for all parts of the vehicle’s power, movement, engine sound and braking system.

_images/engine_acceleration.jpg

Engine Settings: configuration file containing all engine parameters

Engine Sound
_images/engine_sound.jpg

Control the sound of the vehicle’s engine.

audio source: Any audio source that is in the vehicle that can be used to reproduce the sound of the engine.

audio clip: Your engine’s audio clip.

min pitch: The lowest pitch that the engine sound can reach if it’s not accelerating.

max pitch: The maximum pitch that the engine sound can reach when accelerating.

Turret

_images/vehicle_turret.jpg

This module is responsible for controlling the turret and aiming the vehicle.

Transforms
_images/vehicle_turret_demo.jpg

turret: Vehicle weapon system turret.

cannon: Cannon that is connected to the vehicle’s turret.

horizontal velocity: The speed at which the turret flips horizontally towards the target. vertical velocity: The speed at which the cannon turns vertically towards the target.

Wheels

_images/wheels.jpg

The wheel module manages all of the vehicle’s wheels, applies suspension physics and tells them when to accelerate or brake. It makes the vehicle turn and even the tracks move.

settings: Configuration file that contains all the parameters for suspension and behavior of the vehicle’s wheels

Tracks

_images/vehicle_wheels_mbt_tracks.jpg

Add here the meshes of your vehicle’s tracks, so that they follow the movement of the wheels.

multiply rotation velocity: If your belt is not moving at the correct speed, change this value to correct the speed.

Left/Right Wheels

Add your vehicle’s wheels here.

_images/wheels_wheels.jpg

Mesh: Object that will be used to apply wheel physics on the vehicle.

Bone: A track bone, which is next to the wheel.

Left/Right Additional Wheels Renderers

Add here the wheel meshes that don’t apply physics but must rotate along with the others like the front and back wheels of the tank.

_images/vehicle_mbt_additional_wheels_demo.jpg
_images/wheels_additional_wheels.jpg
Wheels Particles
_images/wheels_particles.jpg

It is possible to add particles to the wheels so that when the vehicle moves, they are installed, such as dust.

_images/vehicle_dust_particle_demo.jpg
_images/vehicle_dust_particle_demo_2.jpg

left/right particle: The particle on either side of the vehicle.

max emission: The particle on either side of the vehicle.

Stability

Control vehicle stability.

_images/vehicle_stability.jpg

Angle deceleration: how much gravity influences the vehicle when going uphill or steep places.

center of mass: The vehicle’s center of mass, recommended to leave in the center, the higher on the Y axis, the easier it will be for the vehicle to tip over in curves.

Wheeled Vehicle

Responsible for simulating all types of vehicle that uses wheels.

Vehicle Component

A vehicle component is composed of some modules, each module controls a specific part as you can see in the image.

_images/vehicle_modules1.jpg

Let’s explain the vehicle component separated by modules.

Engine

Module responsible for all parts of the vehicle’s power, movement, engine sound and braking system.

_images/engine.jpg

Engine Settings: configuration file containing all engine parameters

Engine Sound
_images/engine_sound.jpg

Control the sound of the vehicle’s engine.

audio source: Any audio source that is in the vehicle that can be used to reproduce the sound of the engine.

audio clip: Your engine’s audio clip.

min pitch: The lowest pitch that the engine sound can reach if it’s not accelerating.

max pitch: The maximum pitch that the engine sound can reach when accelerating.

Turret

_images/vehicle_turret.jpg

This module is responsible for controlling the turret and aiming the vehicle.

Transforms
_images/transforms.jpg

turret: Vehicle weapon system turret.

cannon: Cannon that is connected to the vehicle’s turret.

horizontal velocity: The speed at which the turret flips horizontally towards the target. vertical velocity: The speed at which the cannon turns vertically towards the target.

Wheels

_images/wheels1.jpg

The wheel module manages all of the vehicle’s wheels, applies suspension physics and tells them when to accelerate, brake and steer.

settings: Configuration file that contains all the parameters for suspension and behavior of the vehicle’s wheels

Left/Right Wheels

Add your vehicle’s wheels here.

_images/wheels_wheels1.jpg

Mesh: Object that will be used to apply wheel physics on the vehicle

Accelerate: If the wheel is able to use the acceleration force

Brake: If the wheel is able to brake

Steer Angle: How far can this wheel turn

Wheels Particles

Add a particle to each of your wheels so that when the vehicle is driven, dust can come out of the wheels.

_images/wheel_particles.jpg

Emission intensity: The intensity of particles that will be instantiated at vehicle speed

Left/Right wheels: particle from each of your wheels

Stability

Control vehicle stability.

_images/vehicle_stability.jpg

Angle deceleration: how much gravity influences the vehicle when going uphill or steep places.

center of mass: The vehicle’s center of mass, recommended to leave in the center, the higher on the Y axis, the easier it will be for the vehicle to tip over in curves.

Configuration Files

Configuration files are scriptableObjects that contain data that can be used by different MMV systems. For example, create a configuration file that contains all information about a type of engine, and that engine can be used by many different vehicles.

Creating Any Configuration File

To create a configuration file, go to your “Project” window and right click somewhere:
Create -> MMV -> ….
_images/creating_file.jpg

Engine Settings

An engine configuration file is responsible for storing all the behavior data of an engine in an MMV vehicle.

_images/engine_settings.jpg

Max acceleration: The maximum acceleration force that the vehicle can achieve

Slowdown: Speed at which the vehicle decelerates

Acceleration curve: Acceleration curve based on current vehicle speed, must never go beyond (0 - 1) horizontally or vertically

Max forward velocity: Maximum speed the vehicle can reach by accelerating forward

Max reverse velocity: Maximum speed the vehicle can reach by accelerating backwards

Max brake force: Vehicle braking force

Gears Forward/Backward: Forward or reverse gear shifting speeds

Wheels Settings

_images/wheels_settings.jpg

Wheel radius: vehicle wheel size

Spring length: Suspension size of each wheel

Spring stiffness: Suspension force

Spring damper: Suspension smoothing

Spring height: Height of start of suspension

Forward friction: front wheel friction

Side friction: side wheel friction

Another Systems

Shooter Manager Component

Responsible for managing gun fire.

_images/shooter_manager.jpg

Shot

_images/shooter_manager_shot.jpg

Describe all main shooting behavior.

spawner: Transform from the position where the shot will come from.

bullet: The projectile that will be instantiated. It is important that this object has the Projectile component.

ignore layer: The projectile will only identify a collision with another object if it does not have that layer defined.

bullet velocity: Speed in meters per second that the projectile moves.

bullet life time: After “X” seconds the projectile will be destroyed automatically even without having collided with another object.

bullet explosion force: The explosion force that will be assigned to nearby objects when they collide with something.

bullet explosion range: The distance to identify nearby objects to apply explosion force after colliding with another object.

explosion force curve: The strength of the explosion force over the distance when the projectile collides.

reload time: The weapon’s reload time.

recoil: The force of the shot applied to the vehicle.

Effects

_images/shooter_effects.jpg

Instantiates objects when a projectile is instantiated.

Spawn on shot: Objects that must be created, such as particles

Sound

_images/shooter_manager_sound.jpg

audio source: Audio source that will be used to play the trigger sound.

clip: The audio clip of the shot.

Bullet Projectile

A projectile is an object that can be used by a Shooter manager.

it is formed by a GameObject with a kinematic Rigidbody and a Collider marked as trigger, add a projectile component and your projectile will be fired.

_images/projectile.jpg

Standart Camera Contoller Component

Standard MMV camera controller, capable of delivering different types of camera positioning such as 3rd person, commander’s view and sniper’s view.

_images/standart_camera_controller.jpg

target: add the target vehicle to be followed by the camera.

_images/standart_camera_controller_inputs.jpg

Add player controls to be able to control the camera, it is possible to configure both keyboard and mouse and gamepad.

See for configure your Axes: Unity Input Manager

horizontal Axes: Horizontal Axes of the Input Axes to rotate the camera horizontally.

vertical Axes: Vertical Axes of the Input Axes to rotate the camera vertically.

invert horizontal Axes: Invert the direction of the player control’s horizontal Axes.

invert vertical Axes: Invert the direction of the player control’s vertical Axes.

change camera key: The key or button to switch between cameras if you have more than one.

axis sensitivity: Camera movement sensitivity

Camera Behaviour

_images/standart_camera_controller_camera_behaviour.jpg

Describe how the camera should behave.

camera turn speed: The speed at which the camera rotates

crosshair layer: Layer of objects that have a collider.

types

Game cameras
0%
_images/standart_camera_controller_camera_names.jpg

amount: Number of vehicle cameras.

Camera “X”

camera: The chosen camera.

type: The type of camera.

Note

THIRD_PERSON: The camera moves around the vehicle and uses the “Camera Collider” to avoid obstacles.

FIRST_PERSON: Stays in the same place, but can be rotated vertically and horizontally.

_images/standart_camera_controller_camera_types_demo.jpg

min vertical: The minimum angle to the vertical.

max vertical: The maximum angle vertically.

align to vehicle: Aligns the Y axis of the camera with that of the vehicle, by default it is already activated in FIRST_PERSON mode.

Options for FIRST_PERSON

max horizontal: The maximum angle the camera can turn horizontally.

Options for THIRD_PERSON

camera height: The height of the camera relative to the vehicle.

camera distance: The distance of the camera from the vehicle

camera collision: Camera collision sensor, prevents it from entering walls, add here the collision layers of your scene, by default the layer is “Default”.