Adding a custom car to Just Drive goes as follow:
As the best free an dopen source 3D modeling tool, we will be using Blender. In this section we will see how to correctly structure all the objects in a Blender project.
It is recommended to use Blender 4.2 as the workflow has been tested and it's quite smooth
The image below shows the minumum required objects with correct structure and model orientation in a Blender scene.
Objects hierarchy
As we can see in the scene hierarchy panel in the image above, we have the following structure:
If you have extra object in the scene, be sure to select only those that will be used for setting up the car in Godot.
With all the needed objects selected, go to File/Export/glTF 2.0 and click on that.
Now lets see how to setup the exporter settings so it correctly imports into Godot engine:
So let's now see how to setup the car in Godot 4.3. I will assume i have downloaded the empty project from the link above.
In the mods/cars folder, we have to create a folder, where we will store the model and car scene. In this case we named out car "Columbia", so we will name the folder the same name.
So in this "Columbia" folder, you just create another folder named "model" or "models" ( this really desn't matter as Godot will know how to load all the needed resources in order to display the car correctly). Inside the "model" folder, we can create two more folders just to better organize the project. One will be named "materials" were we will export all the materials in a minute, and one named "textures", where we can store all of our textures.
So now if you double click on te Columbia.glb file, the import settings panel will open. Just go to "Actions" tab at the top of the screen and choose "Extract Materials". Then just choose where to export them, in ths case i've created the "materials" folder, so i will extract them inside that folder.
This image shows, a good way of organizing the assets. Also, be sure to select each material and load textures if needed. And finaly click on the "3D Scene" button at the Scene inspector ( the one highlighted in the image ). This will
Now after we clicked on 3D Scene, a new scene window will open with a root node called Node3D. Rename this node to however you want to call your car ( in this case we use Columbia ) and then drag and drop the Columbia.glb file as a child of tha root node. Then right click on that new node and coose "Make Local"
Clicking on "Make Local" will expose the all child nodes, which we have to just reparent to the root. After reparent the child nodes, the root node of the glb file we just added will remain there and empty. Just delete it. Now you have to have the exact same hierarchy of nodes as in the image below:
Lastly, save the car inside the car folder ( in this case inside "Columbia" folder). It is important the car scene to be saved directly inside the car folder and not inside any subfolder as the "model" folder. As you can see in the image, there's a new file called "Columbia.tscn". That is our car.
Now let's generate a Collision Shape for the car. This is needed to prevent the car from going through walls.
So, first select the "car_shape_1" mesh and click on the "Mesh" tab and then on "Create Collision Shape...". Note that if you dont' see the "Mesh" button, your "car_shape_1" node is not of a type MeshInstance3D which it should be.
Once you click on "Create Collision Shape...", a small popup window will appear. You have to select "Sbiling" and "Single Convex" and press "Create".
This should add a new node named "CollisionShape3D" next to the "car_shape_1". The nodes of type CollisionShape3D are those that prevent the 3D objects from going through walls in Godot engine ( you may have heard the term HitBoxes ).
Now just delete the original "car_shape_1" as it is just a mesh, and rename the CollisionShape3D to "car_shape_1". This is not required, but it's recommended for consistency.
When ready to export the car to a PCK file, click on Project tab andd select Export.
Now, to export anything, game or a package for Windows, you will have to choose Windows Desktop from te "Add..." menu. So just click on Add and then pick Windows Desktop, and this will add it to the Presets list.
Once you pick Windows Desktop export template, it should be visible in the Presets list. Note that this should be selected in case you have more templates downloaded. Now just click on "Export PCK/ZIP" button.
This will open the windows that let's you pick the save folder. So be sure to name the pck file with the exact name as you names the folder, the glb file and the car scene file. In this case i will name it again "Columbia" and be sure to pipck the *.pck (Godot Project Pack (*.pck)) format from the drop down list on the right. Also disable "Export With Debug".
Godot's "user" folder is located at C:\Users\your user name\AppData\Roaming\Godot\app_userdata\ where data is stored per game.
For our custom car, we will navigate further down to:
C:\Users\your user name\AppData\Roaming\Godot\app_userdata\Just Drive\mods\cars\Columbia
Note that, you will have to run the game at least once in order to see the folders Just Drive/mods/cars.
Now in the Just Drive/mods/cars folder ( in the Godot's user folder ), we will have to create a folder named again as the car we created. So in this case i will create a folder named Columbia and will paste the Columbia.pck file inside.
As you can see in that image, we now have the data.json and icon.png files.
Download data.json file : NOTE that you will have to edit all the data for this specific car you are creating.You can add the image later after you successfully loaded the car into the game from where you can just take a screenshot.
Now as we have our car imported into the game, it's time to set it up.
To do that, select the "MODS" button in the main menu and press Enter. Then in the newly opened menu, select the car UI element and press Enter or click it with the mouse. This will open the car setup scene.
As with the game version 0.5.0, not all settings are added. There a few more related to camera, eventually cluch and few others. These should come in the next update.
In this section, you will learn how to create a custom maps, how to export them and how to load it into "Just Drive". Godot Engine supports modding and extending games using packages. We are able to create and export any type of a scene as a package and then include it into the game by following some requirements. You will learn how to structure a Godot project so when it's exported, the game will correctly load the level. Note that for every map we want to create, we create a new project. So let's see how to do that.
Before attempt to create your own map, you may want to download the "desert-road" demo map to see how loading a map works and to have some fun trying the level.
To try the demo map, click the link below. It will load a new web page where you will be able to download the file from google drive. This is a zip file that contains a single folder called desert-road. Just extract the folder, let's say to the desktop so you have a quick access to it. Now in order to be able to play the map, you will have to copy the folder to the so called Godot user folder.
This is found at: C:\Users\"your user name"\AppData\Roaming\Godot\app_userdata\Just Drive\mods\maps "Just Drive" is the actual user folder.
Some notes to keep in mind:
Let's first see what folder structure we have to make in order for the level to be correctly exported an loaded. It is important to place each level in the mods/maps folder and then in its specific folder. So be sure when you're creating a new project first create a folder named mods and then inside create another folder named maps. Inside that maps folder, create a new folder with the name that you want to name the map, like in this case Track_01.
Then create a new 3D scene and save it inside the Track_01 folder and be sure to name the scene exactly the same way (we named our map Track_01 just for the demo purpose. You can name yours however you like). The folder and scene names should match.
Time attack mode, should have the following elements. Note that the groups names are case sensitive and should match.
All the elements should be of the base type - Node. So first, create a new 3d scene and add a new Node and call it level. Then add more nodes of the same type and name them as the nodes in the screenshot. When ready, be sure you have the exact same hierarchy as in the image.
The game already has some gameplay music. However if you want to include your own track for that specific level, you can do this. Simply add an AudioStreamPlayer2D as a child node to the audio node and then load the music clip to the stream its property.
In the FX group, you have to create a DirectionalLight3D node and a WorldEnvironment node. The game will automatically try yo find these two nodes and apply game settings like shadows, AA etc. In the WorldEnvironment, you add any effect you would like. Feel free to setup color correction and enable/disable features you like.
In this node, you place all the level meshes and props. You will have to correctly setup the collision meshes and materials in order to display the level in the game. If you have the level correctly displayed in your working project, it will be well displayed in the game as well.
You will have to have a node of type Node3D called spawn_point_single_player added as a child to the spawn_points node. This Node3D object should be correctly placed so it is found before the first point of the Path3D that represents the racing track and will be used to track the progress on track . We will see later how to create and use that Path3D node.
Split screen support: to be able to play in Split Screen mode, you'll have to add 2 more Node3D objects. For best result, use the spawn point for the single player as reference. If that single player spawn point node is placed at position (0.0, 0.1, 0.0), just place the P1 spawn point on the left at position (-5.0, 0.1, 0.0) and P2 spawn point on the right at position (+5.0, 0.1, 0.0).
Here you place all the meshes that should be displayed in the minimap. In order for this to show in the game, be sure you set all the meshes in layer 5. The meshes can you any material you like to setup. It is recommended to apply a unlit white material and for example unlit materials with different colors like blue, green etc... for decoration meshes.
Here you place all the meshes that should be displayed in the minimap. In order for this to show in the game, be sure you set all the meshes in layer 5. The meshes can you any material you like to setup. It is recommended to apply a unlit white material and for example unlit materials with different colors like blue, green etc... for decoration meshes.
So here is how you set it up. First be sure to create a node of type Node3D inside the reset_system node. Give it a name (you can go and follow the naming convention as in the image and just name the node reset_area_01). This is the way the game is looking for the path to be used to sample a position where the player's vehicle should be reset back on track. Here's a quick snippet and we will see in the next section how exactly we do this.
Inside this node we have to create a node of type Path3D. Use the Path3D editor tools to create a spline(curve) along the racing track. It is required the curve to go along the middle of the track. Later we will see where to set the track width. You will have to know the width of the track you are creating. A good value is around 14 meters.
Once ready for testing the map, we are ready to export it as a package. To do this, navigate to top menu, click on Project and then select Export.
A new window will show up. This is where we select the export template and setup before we export. If you haven't exported previously, you will have to download an export template. Fortunately, this is really easy. Just click the "Add" button which is highlighted in the image and then select the "Windows Desktop" option. If the template is not available locally, the engine will prompt you to install it, so go ahead and do that. Note that there might be some errors initially shown at the bottom of the panel. If any, just go ahead and fix that. In general, the engine will tell you what you have to do to fix an error.
When you are ready installing the template, select the "Windows Desktop (Runnable)". If it doesn't say "(Runnable)", this is also fine and will not stop you from exporting the map.
The maps should be placed in the so called user:// directory of the game. In Windows this is located at AppData/RoamingGodot/app_userdata. The AppData folder is usually hidden unless you set up the hidden folder to be visible.
An easy way to reach that folder is to use the Run window. Just press Win+R buttons on your keyboard and a small window will be displayed. Just enter the text %AppData% and press the OK button. This will open a new explorer with visible content of the Roadming folder. This is exactly where we want to start navigating to our user folder from. So from here, just navigate to Godot/app_userdata/Just Drive. Note that you must have the game installed and played at least once in order for the Just Drive folder to be visible. Note that in the Just Drive folder you have to manually create the folder mods and inside the folder maps where you store all the custom maps. As we mentioned, it is a good practice to name the folder, exported package and the level name the same way. So for our tutorial, we named our map Track_01, thus we have to create a folder named Track_01 as well. So in your case, create a folder with the name of your map and then you can just copy the path from windows explorer so we can navigate to it when exporting the package.
To create this file, you just create a new text file and you rename it to data.json using the rename option from the right click menu when done on the file. You can open this file with any text editor. Note that as this is a json file, we have to strictly follow its syntax. Here's what the settings are meant for:
Fields:
Content for drift track tutorial...