Create custom maps in Godot Engine


In this tutorial, you will learn how to create a custom level, how to export it and how to load it into "Just Drive" so you can play it. 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.

Time Attack Tutorial

Download and test a demo map first

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:

  • you have to replace the "your user name" with your actual user name
  • the AppData folder is initially a hidden folder in windows. You can check section Exporting (10/10) below for detailed information on how to navigate to that folder
  • you will have to run the game at least once in order for that user folder to get created.

TIME ATTACK MODE

Project Structure

1 of 10

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.

NOTE:

As we're using the name Track_01 for this tutorial, you are not required to follow such naming for you custom map. You can pick whatever name you'd like. Bear in mind that if someone else creates a map with the same name you won't be able to import both of them simultaneously. Each custom map should have unique name. 

NOTE:

The map name (like in this case Track_01) is really important and should match the property in the json data file we will create later. This is important so the game knows where the map is stored once loaded.

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.

Level Structure

2 of 10

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.

NOTE:

As not all of the Nodes in the level are strictly required, it's still recommended to have them all. You will find more info for each of the nodes in their specific sections !

AUDIO

3 of 10

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.

NOTE:

OPTIONAL FEATURE: You can skip adding custom audio track. If not present, the game will play one of the music tracks included into the game.

FX

4 of 10

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.

LEVEL

5 of 10

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. 

SPAWN POINTS

6 of 10

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.

NOTE:

The spawn point should be placed correctly in order for the car to be correctly placed. It is recommended to place the node3d with a bit of a space to the ground. A space of additional 0.05 or 0.1 related to the ground should be fine. Also the node3d should be pointing to the direction towards which the player suppose to start driving.

MINIMAP

7 of 10

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. 

RESET SYSTEM

8 of 10

For the Time Attack Mode, the Reset System should be setup in a specific way. The game uses the Path3D node that represents the racing track but also to return the vehicle to the track if needed.

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.

NOTE:

As you can see in the first image in this section, there are two more nodes of type Node3D added as children. The reset_points and reset_cuves are additional nodes where you can store Node3Ds and additional Path3D nodes to be used for resetting. As it is enough to have the track_path added to a group with the same name as the reset area (in this case reset_area_01), you can still add some more points and curves if you design a bit more complex track. In general these two groups for points and curves are using in the other game modes but as the reset system is more generic you can use those in the time attack mode as well.

TRACK

9 of 10

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.

EXPORTING

10 of 10

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.

NOTE:

The AppData folder is originally hidden and you may not be able to navigate through windows explorer if you haven't set hidden folders 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.

Note that we have a json file next to the level package. This is needed for the game to know some specifics for your map. Here is what we have to enter for the Time Attack mode.

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:

  • type - for the time attack mode ne sure you have the text "time-attack" correctly entered
  • display-name - this is the name that will be used for displaying in the levels menu, so you can give it whatever name you like
  • scene-name - remember that we mentioned a few times, how our scene name and  folders etc... should be having the same name. So here you should enter the name of your scene
  • track-length - this is just useful for displaying the track length in the menu. It is recommended to have you correct track length entered here
  • track-width- now, this is important. This value will be used to know when the car is going out of the track, so be sure you  have the correct value entered here. The value is in meters.
  • play-time- this is the maximum allowed play time for the level in seconds, i.e. the game will start count, but as soon as it reaches that value, the player will unsuccessfully completed the track.

SCORE ATTACK MODE

Coming Soon

PLAYGROUND MODE

Coming Soon