ghiboz edited this page Jul 29, 2018 · 6 revisions

#:warning: This guide will change according to the development

Prerequisites

To start creating a car you need as following:

Example Project

in this link you can find the 'unity car' project example to use with gRally.. is not full working (for example the interiors, the lights are not full managed), but the chassis, wheels, livery, sound, phyiscs are fully functional.

https://www.ghiboz.com/gRally/GWK.rar

Unity3d

We will not explain how to use Unity3d. We recommend to learn the interface and the basic operations using the official learning resources. You'll find here https://unity3d.com/learn/tutorials

It's strongly recommended to take a look at the "interface&essentials" video section.

Now just a quick tour about Unity3d environment. Launch it and you'll see something like this

Click con "New" button and you'll have this

  1. Insert the project name
  2. Insert the folder where you like to store it;
  3. Make sure 3D template is selected;
  4. Leave OFF Enable Unity Analytics;
  5. Click Create project;

Probably when you'll start Unity3d you'll have a different interface layout, don't worry you can rearrange it as you prefere dragging the single panel in the position you feel more confortable.

According to this layout, here a brief panels explanation:

  1. The Scene panel (CTRL+1). Here is the editing scene, where you can see your objects, select, move, etc..
  2. The Game panel (CTRL+2). Here is shown your game when is launced clicking play.
  3. The Console panel (CTRL+Shift+C). Here you can see the errors, warnings or message about everything is running both in editor mode and in game mode.
  4. The Hierarchy panel (CTRL+4). Here you can see the tree view of your scene with all the gameobjects of the scenes.
  5. The Project panel (CTRL+5). Here you can see the folders of your project (the same folder/files hierarchy that you see in windows explorer inside the project root folder you choosen in point 2 of the previous step.).
  6. The Inspector panel (CTRL+3). Here you can see and edit all the GameObject properties.

In Unity3d, a GameObject is the name of everything you place into a scene: can be a light, a camera, a 3d mesh or something else.

Before adding the gRally tools I suggest you to set some project settings in order to have the best match in terms of visual preview with the game. This step is ** strongly recommended** but not necessary.

Go to Unity menu Edit-> Project Settings
Select "Player" and scroll to "other settings".
Change Color Space to "Linear".

Then, again from the Project Settings, go to "Quality"
In this category you can set quality levels for the different quality levels. We suggest to start, to change the "Ultra" level as following and leave the others as they're set.

  • AntiAliasing -> Disabled
  • Shadow Cascades -> Two Cascades
  • V-Sync Count -> Don't Sync

After this, from Project Settings select "Graphics", uncheck the "use defaults" in the "Low (Tier1)"
From the Tier1 settings, just change "Rendering path" to "Deferred".

Ok. Now you are ready to add gCarEditor

gCarEditor

The first thing to do is to install gCarEditor package: download from the Prerequisites section at the top of this page.

After from Unity3d go to Assets ->Import Package ->Custom Package.. and choose the downloaded file :

Make sure to have all the items checked and click Import.

Now you have a new folder called gCarEditor into your Assets folder:

:warning: Please, leave the gCarEditor folder tree as you get from import or future upgrade. It'll be easier for us to help you for any problem about it.

1. Prepare the workplace

After the installation the first thing to do is to prepare the requisities to define a car;

To do this, simply go to the gRally Menu:

Click on: 1. Create default car data 2. Create car tree

The default car data contains some info about the car, like the name, brand, traction, description:

The "car tree" creates everything you need to build a car (a skeleton, to be edited and improved later) to have a working car for gRally;

  • Wheel base: the distance in meters from the front axle and the rear axle;
  • Track/tread (front): the distance in meters between the front left and the front right wheel (center);
  • Track/tread (rear): the distance in meters between the rear left and the rear right wheel (center);
  • Wheel size (front): the commercial size of the front wheels;
  • Wheel size (rear): the commercial size of the rear wheels;

⚠️ all these settings are editable later, but is better set these this time 'cause each parameter affect different settings;

once you created the car tree, you can see the RallyCar gameobject with all the child needed;

To this sample I used this car: https://www.assetstore.unity3d.com/en/#!/content/69324

Meshes

The car mesh must be aligned with Z positive in front and the center must be in the rear axle:

The car meshes needs to be placed under these gameobjects:

  • RallyCar/Body/Common for the meshes that must be seen in exterior and in interior view;
  • RallyCar/Body/Ext for the meshes that must be seen only in exterior view;
  • RallyCar/Body/Int for the meshes that must be seen only in interior view;

In my example, you can see that the car is rotated by 180° and not centered to 0.0.0 to the rear axle.. we can move and rotate directly from unity to have the right position/orientation. ⚠️ the Common gameobject must be in 0.0.0 and not rotated, please rotate only the childs.

The wheel meshes must be placed under these gameobjects:

  • RallyCar/WheelFL
  • RallyCar/WheelFR
  • RallyCar/WheelBL
  • RallyCar/WheelBR

And same like the car body, you can move/rotate the mesh but only the child, not the gameobject listed above;

Here I placed the basic meshes in the right place.

Materials

The most important material is the car body material, go on choose it (selecting from the car body mesh):

This material must use the gRally/grsCarTemporary2 shader and must have these textures:

  • Template: a transparent png with only the items that must be added over the livery: like the emergency decal, the door handles, the window seals, the windscreens, the grids, etc...
  • Decals: leave it blank, it's added automatically;
  • Ambient occlusion: ao for the body or white if you don't have one;
  • Metallic: RGB => Specular, A => Smoothness;
  • Normal: the normal map: if you don't have one, there's a texture called flat_normal to use;

Sounds:

The GameObject that contains the sounds is RallyCar->Body .

The first elements are for the shift and brake sounds;

Next, there are External and Internal sections: the only difference is that the External sounds are heard when the camera is outside the car and Internal when you're inside the car; The Power and the Coaster section has the availiabilty to add many sounds, to be mixed together to have a more realistic output sound: The mix is managed with the 2 curves: Volume and Pitch;

The Pitch usually is a linear curve, where in the x axis there's the ratio between the rpm and rpm max, and the y axis has the pitch (1.0 is the natural sound recordered);

The Volume is a curve where in the x axis (like the Pitch) there's the ratio between the rpm and rpm max, the y axis has the gain of the sound item;

After the two sections (Power and Coaster) that should have many items, there are 3 optional audio: Reverse, Idle and MaxRPM.. the curves are managed like above; ⚠️I suggest to use max 2 sounds mixed each time.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.